remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,34 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 1997-2002 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "hdb_locl.h"
|
||||
@@ -43,7 +43,7 @@ hdb_principal2key(krb5_context context, krb5_const_principal p, krb5_data *key)
|
||||
int ret;
|
||||
|
||||
ret = copy_Principal(p, &new);
|
||||
if(ret)
|
||||
if(ret)
|
||||
return ret;
|
||||
new.name.name_type = 0;
|
||||
|
||||
@@ -65,7 +65,7 @@ hdb_entry2value(krb5_context context, const hdb_entry *ent, krb5_data *value)
|
||||
{
|
||||
size_t len;
|
||||
int ret;
|
||||
|
||||
|
||||
ASN1_MALLOC_ENCODE(hdb_entry, value->data, value->length, ent, &len, ret);
|
||||
if (ret == 0 && value->length != len)
|
||||
krb5_abortx(context, "internal asn.1 encoder error");
|
||||
@@ -79,14 +79,14 @@ hdb_value2entry(krb5_context context, krb5_data *value, hdb_entry *ent)
|
||||
}
|
||||
|
||||
int
|
||||
hdb_entry_alias2value(krb5_context context,
|
||||
hdb_entry_alias2value(krb5_context context,
|
||||
const hdb_entry_alias *alias,
|
||||
krb5_data *value)
|
||||
{
|
||||
size_t len;
|
||||
int ret;
|
||||
|
||||
ASN1_MALLOC_ENCODE(hdb_entry_alias, value->data, value->length,
|
||||
|
||||
ASN1_MALLOC_ENCODE(hdb_entry_alias, value->data, value->length,
|
||||
alias, &len, ret);
|
||||
if (ret == 0 && value->length != len)
|
||||
krb5_abortx(context, "internal asn.1 encoder error");
|
||||
@@ -94,7 +94,7 @@ hdb_entry_alias2value(krb5_context context,
|
||||
}
|
||||
|
||||
int
|
||||
hdb_value2entry_alias(krb5_context context, krb5_data *value,
|
||||
hdb_value2entry_alias(krb5_context context, krb5_data *value,
|
||||
hdb_entry_alias *ent)
|
||||
{
|
||||
return decode_hdb_entry_alias(value->data, value->length, ent, NULL);
|
||||
@@ -161,7 +161,7 @@ hdb_remove_aliases(krb5_context context, HDB *db, krb5_data *key)
|
||||
return 0;
|
||||
else if (code)
|
||||
return code;
|
||||
|
||||
|
||||
code = hdb_value2entry(context, &value, &oldentry);
|
||||
krb5_data_free(&value);
|
||||
if (code)
|
||||
@@ -188,18 +188,18 @@ hdb_remove_aliases(krb5_context context, HDB *db, krb5_data *key)
|
||||
}
|
||||
|
||||
static krb5_error_code
|
||||
hdb_add_aliases(krb5_context context, HDB *db,
|
||||
hdb_add_aliases(krb5_context context, HDB *db,
|
||||
unsigned flags, hdb_entry_ex *entry)
|
||||
{
|
||||
const HDB_Ext_Aliases *aliases;
|
||||
krb5_error_code code;
|
||||
krb5_data key, value;
|
||||
int i;
|
||||
|
||||
|
||||
code = hdb_entry_get_aliases(&entry->entry, &aliases);
|
||||
if (code || aliases == NULL)
|
||||
return code;
|
||||
|
||||
|
||||
for (i = 0; i < aliases->aliases.len; i++) {
|
||||
hdb_entry_alias entryalias;
|
||||
entryalias.principal = entry->entry.principal;
|
||||
|
68
lib/hdb/db.c
68
lib/hdb/db.c
@@ -1,34 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "hdb_locl.h"
|
||||
@@ -107,7 +107,7 @@ DB_seq(krb5_context context, HDB *db,
|
||||
db->hdb_unlock(context, db); /* XXX check value */
|
||||
if(code == -1) {
|
||||
code = errno;
|
||||
krb5_set_error_message(context, code, "Database %s seq error: %s",
|
||||
krb5_set_error_message(context, code, "Database %s seq error: %s",
|
||||
db->hdb_name, strerror(code));
|
||||
return code;
|
||||
}
|
||||
@@ -168,7 +168,7 @@ DB_rename(krb5_context context, HDB *db, const char *new_name)
|
||||
free(new);
|
||||
if(ret)
|
||||
return errno;
|
||||
|
||||
|
||||
free(db->hdb_name);
|
||||
db->hdb_name = strdup(new_name);
|
||||
return 0;
|
||||
@@ -190,7 +190,7 @@ DB__get(krb5_context context, HDB *db, krb5_data key, krb5_data *reply)
|
||||
db->hdb_unlock(context, db);
|
||||
if(code < 0) {
|
||||
code = errno;
|
||||
krb5_set_error_message(context, code, "Database %s get error: %s",
|
||||
krb5_set_error_message(context, code, "Database %s get error: %s",
|
||||
db->hdb_name, strerror(code));
|
||||
return code;
|
||||
}
|
||||
@@ -198,13 +198,13 @@ DB__get(krb5_context context, HDB *db, krb5_data key, krb5_data *reply)
|
||||
krb5_clear_error_string(context);
|
||||
return HDB_ERR_NOENTRY;
|
||||
}
|
||||
|
||||
|
||||
krb5_data_copy(reply, v.data, v.size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static krb5_error_code
|
||||
DB__put(krb5_context context, HDB *db, int replace,
|
||||
DB__put(krb5_context context, HDB *db, int replace,
|
||||
krb5_data key, krb5_data value)
|
||||
{
|
||||
DB *d = (DB*)db->hdb_db;
|
||||
@@ -222,7 +222,7 @@ DB__put(krb5_context context, HDB *db, int replace,
|
||||
db->hdb_unlock(context, db);
|
||||
if(code < 0) {
|
||||
code = errno;
|
||||
krb5_set_error_message(context, code, "Database %s put error: %s",
|
||||
krb5_set_error_message(context, code, "Database %s put error: %s",
|
||||
db->hdb_name, strerror(code));
|
||||
return code;
|
||||
}
|
||||
@@ -248,7 +248,7 @@ DB__del(krb5_context context, HDB *db, krb5_data key)
|
||||
db->hdb_unlock(context, db);
|
||||
if(code == 1) {
|
||||
code = errno;
|
||||
krb5_set_error_message(context, code, "Database %s put error: %s",
|
||||
krb5_set_error_message(context, code, "Database %s put error: %s",
|
||||
db->hdb_name, strerror(code));
|
||||
return code;
|
||||
}
|
||||
@@ -290,15 +290,15 @@ DB_open(krb5_context context, HDB *db, int flags, mode_t mode)
|
||||
if (ret) {
|
||||
DB_close(context, db);
|
||||
krb5_set_error_message(context, ret, "hdb_open: failed %s database %s",
|
||||
(flags & O_ACCMODE) == O_RDONLY ?
|
||||
"checking format of" : "initialize",
|
||||
(flags & O_ACCMODE) == O_RDONLY ?
|
||||
"checking format of" : "initialize",
|
||||
db->hdb_name);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
krb5_error_code
|
||||
hdb_db_create(krb5_context context, HDB **db,
|
||||
hdb_db_create(krb5_context context, HDB **db,
|
||||
const char *filename)
|
||||
{
|
||||
*db = calloc(1, sizeof(**db));
|
||||
|
@@ -1,34 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 1997 - 2006 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "hdb_locl.h"
|
||||
@@ -161,7 +161,7 @@ DB_rename(krb5_context context, HDB *db, const char *new_name)
|
||||
free(new);
|
||||
if(ret)
|
||||
return errno;
|
||||
|
||||
|
||||
free(db->hdb_name);
|
||||
db->hdb_name = strdup(new_name);
|
||||
return 0;
|
||||
@@ -193,7 +193,7 @@ DB__get(krb5_context context, HDB *db, krb5_data key, krb5_data *reply)
|
||||
}
|
||||
|
||||
static krb5_error_code
|
||||
DB__put(krb5_context context, HDB *db, int replace,
|
||||
DB__put(krb5_context context, HDB *db, int replace,
|
||||
krb5_data key, krb5_data value)
|
||||
{
|
||||
DB *d = (DB*)db->hdb_db;
|
||||
@@ -282,7 +282,7 @@ DB_open(krb5_context context, HDB *db, int flags, mode_t mode)
|
||||
ret = (*d->open)(db->hdb_db, NULL, db->hdb_name, NULL, DB_BTREE,
|
||||
myflags, mode);
|
||||
#else
|
||||
ret = (*d->open)(db->hdb_db, db->hdb_name, NULL, DB_BTREE,
|
||||
ret = (*d->open)(db->hdb_db, db->hdb_name, NULL, DB_BTREE,
|
||||
myflags, mode);
|
||||
#endif
|
||||
}
|
||||
@@ -311,8 +311,8 @@ DB_open(krb5_context context, HDB *db, int flags, mode_t mode)
|
||||
if (ret) {
|
||||
DB_close(context, db);
|
||||
krb5_set_error_message(context, ret, "hdb_open: failed %s database %s",
|
||||
(flags & O_ACCMODE) == O_RDONLY ?
|
||||
"checking format of" : "initialize",
|
||||
(flags & O_ACCMODE) == O_RDONLY ?
|
||||
"checking format of" : "initialize",
|
||||
db->hdb_name);
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@ DB_open(krb5_context context, HDB *db, int flags, mode_t mode)
|
||||
}
|
||||
|
||||
krb5_error_code
|
||||
hdb_db_create(krb5_context context, HDB **db,
|
||||
hdb_db_create(krb5_context context, HDB **db,
|
||||
const char *filename)
|
||||
{
|
||||
*db = calloc(1, sizeof(**db));
|
||||
|
@@ -1,34 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 2005 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "hdb_locl.h"
|
||||
@@ -105,7 +105,7 @@ hdb_get_dbinfo(krb5_context context, struct hdb_dbinfo **dbp)
|
||||
databases = NULL;
|
||||
|
||||
db_binding = krb5_config_get(context, NULL, krb5_config_list,
|
||||
"kdc",
|
||||
"kdc",
|
||||
"database",
|
||||
NULL);
|
||||
if (db_binding) {
|
||||
@@ -121,7 +121,7 @@ hdb_get_dbinfo(krb5_context context, struct hdb_dbinfo **dbp)
|
||||
if (db_binding->type != krb5_config_list)
|
||||
continue;
|
||||
|
||||
ret = get_dbinfo(context, db_binding->u.list,
|
||||
ret = get_dbinfo(context, db_binding->u.list,
|
||||
db_binding->name, &di);
|
||||
if (ret)
|
||||
krb5_err(context, 1, ret, "failed getting realm");
|
||||
@@ -159,7 +159,7 @@ hdb_get_dbinfo(krb5_context context, struct hdb_dbinfo **dbp)
|
||||
else
|
||||
/* the filename is something.else, replace .else with
|
||||
.mkey */
|
||||
asprintf(&di->mkey_file, "%.*s.mkey",
|
||||
asprintf(&di->mkey_file, "%.*s.mkey",
|
||||
(int)(p - di->dbname), di->dbname);
|
||||
}
|
||||
if(di->acl_file == NULL)
|
||||
|
@@ -1,34 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 2004 - 2005 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "hdb_locl.h"
|
||||
@@ -44,12 +44,12 @@ hdb_entry_check_mandatory(krb5_context context, const hdb_entry *ent)
|
||||
if (ent->extensions == NULL)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
/*
|
||||
* check for unknown extensions and if they where tagged mandatory
|
||||
*/
|
||||
|
||||
for (i = 0; i < ent->extensions->len; i++) {
|
||||
if (ent->extensions->val[i].data.element !=
|
||||
if (ent->extensions->val[i].data.element !=
|
||||
choice_HDB_extension_data_asn1_ellipsis)
|
||||
continue;
|
||||
if (ent->extensions->val[i].mandatory) {
|
||||
@@ -83,8 +83,8 @@ hdb_find_extension(const hdb_entry *entry, int type)
|
||||
*/
|
||||
|
||||
krb5_error_code
|
||||
hdb_replace_extension(krb5_context context,
|
||||
hdb_entry *entry,
|
||||
hdb_replace_extension(krb5_context context,
|
||||
hdb_entry *entry,
|
||||
const HDB_extension *ext)
|
||||
{
|
||||
HDB_extension *ext2;
|
||||
@@ -102,7 +102,7 @@ hdb_replace_extension(krb5_context context,
|
||||
} else if (ext->data.element != choice_HDB_extension_data_asn1_ellipsis) {
|
||||
ext2 = hdb_find_extension(entry, ext->data.element);
|
||||
} else {
|
||||
/*
|
||||
/*
|
||||
* This is an unknown extention, and we are asked to replace a
|
||||
* possible entry in `entry' that is of the same type. This
|
||||
* might seem impossible, but ASN.1 CHOICE comes to our
|
||||
@@ -159,7 +159,7 @@ hdb_replace_extension(krb5_context context,
|
||||
return ret;
|
||||
}
|
||||
|
||||
es = realloc(entry->extensions->val,
|
||||
es = realloc(entry->extensions->val,
|
||||
(entry->extensions->len+1)*sizeof(entry->extensions->val[0]));
|
||||
if (es == NULL) {
|
||||
krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
|
||||
@@ -178,8 +178,8 @@ hdb_replace_extension(krb5_context context,
|
||||
}
|
||||
|
||||
krb5_error_code
|
||||
hdb_clear_extension(krb5_context context,
|
||||
hdb_entry *entry,
|
||||
hdb_clear_extension(krb5_context context,
|
||||
hdb_entry *entry,
|
||||
int type)
|
||||
{
|
||||
int i;
|
||||
@@ -249,7 +249,7 @@ hdb_entry_get_pw_change_time(const hdb_entry *entry, time_t *t)
|
||||
}
|
||||
|
||||
krb5_error_code
|
||||
hdb_entry_set_pw_change_time(krb5_context context,
|
||||
hdb_entry_set_pw_change_time(krb5_context context,
|
||||
hdb_entry *entry,
|
||||
time_t t)
|
||||
{
|
||||
@@ -265,7 +265,7 @@ hdb_entry_set_pw_change_time(krb5_context context,
|
||||
}
|
||||
|
||||
int
|
||||
hdb_entry_get_password(krb5_context context, HDB *db,
|
||||
hdb_entry_get_password(krb5_context context, HDB *db,
|
||||
const hdb_entry *entry, char **p)
|
||||
{
|
||||
HDB_extension *ext;
|
||||
@@ -280,7 +280,7 @@ hdb_entry_get_password(krb5_context context, HDB *db,
|
||||
if (db->hdb_master_key_set && ext->data.u.password.mkvno) {
|
||||
hdb_master_key key;
|
||||
|
||||
key = _hdb_find_master_key(ext->data.u.password.mkvno,
|
||||
key = _hdb_find_master_key(ext->data.u.password.mkvno,
|
||||
db->hdb_master_key);
|
||||
|
||||
if (key == NULL) {
|
||||
@@ -322,14 +322,14 @@ hdb_entry_get_password(krb5_context context, HDB *db,
|
||||
if (ret == 0) {
|
||||
krb5_set_error_message(context, ENOENT, "no password attributefor %s", str);
|
||||
free(str);
|
||||
} else
|
||||
} else
|
||||
krb5_clear_error_string(context);
|
||||
|
||||
return ENOENT;
|
||||
}
|
||||
|
||||
int
|
||||
hdb_entry_set_password(krb5_context context, HDB *db,
|
||||
hdb_entry_set_password(krb5_context context, HDB *db,
|
||||
hdb_entry *entry, const char *p)
|
||||
{
|
||||
HDB_extension ext;
|
||||
@@ -350,12 +350,12 @@ hdb_entry_set_password(krb5_context context, HDB *db,
|
||||
}
|
||||
|
||||
ret = _hdb_mkey_encrypt(context, key, HDB_KU_MKEY,
|
||||
p, strlen(p) + 1,
|
||||
p, strlen(p) + 1,
|
||||
&ext.data.u.password.password);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ext.data.u.password.mkvno =
|
||||
ext.data.u.password.mkvno =
|
||||
malloc(sizeof(*ext.data.u.password.mkvno));
|
||||
if (ext.data.u.password.mkvno == NULL) {
|
||||
free_HDB_extension(&ext);
|
||||
@@ -367,7 +367,7 @@ hdb_entry_set_password(krb5_context context, HDB *db,
|
||||
} else {
|
||||
ext.data.u.password.mkvno = NULL;
|
||||
|
||||
ret = krb5_data_copy(&ext.data.u.password.password,
|
||||
ret = krb5_data_copy(&ext.data.u.password.password,
|
||||
p, strlen(p) + 1);
|
||||
if (ret) {
|
||||
krb5_set_error_message(context, ret, "malloc: out of memory");
|
||||
@@ -386,17 +386,17 @@ hdb_entry_set_password(krb5_context context, HDB *db,
|
||||
int
|
||||
hdb_entry_clear_password(krb5_context context, hdb_entry *entry)
|
||||
{
|
||||
return hdb_clear_extension(context, entry,
|
||||
return hdb_clear_extension(context, entry,
|
||||
choice_HDB_extension_data_password);
|
||||
}
|
||||
|
||||
krb5_error_code
|
||||
hdb_entry_get_ConstrainedDelegACL(const hdb_entry *entry,
|
||||
hdb_entry_get_ConstrainedDelegACL(const hdb_entry *entry,
|
||||
const HDB_Ext_Constrained_delegation_acl **a)
|
||||
{
|
||||
const HDB_extension *ext;
|
||||
|
||||
ext = hdb_find_extension(entry,
|
||||
ext = hdb_find_extension(entry,
|
||||
choice_HDB_extension_data_allowed_to_delegate_to);
|
||||
if (ext)
|
||||
*a = &ext->data.u.allowed_to_delegate_to;
|
||||
|
@@ -74,7 +74,7 @@ struct hdbldapdb {
|
||||
*
|
||||
*/
|
||||
|
||||
static char * krb5kdcentry_attrs[] = {
|
||||
static char * krb5kdcentry_attrs[] = {
|
||||
"cn",
|
||||
"createTimestamp",
|
||||
"creatorsName",
|
||||
@@ -409,7 +409,7 @@ LDAP_entry2mods(krb5_context context, HDB * db, hdb_entry_ex * ent,
|
||||
goto out;
|
||||
|
||||
is_new_entry = FALSE;
|
||||
|
||||
|
||||
vals = ldap_get_values_len(HDB2LDAP(db), msg, "objectClass");
|
||||
if (vals) {
|
||||
int num_objectclasses = ldap_count_values_len(vals);
|
||||
@@ -430,7 +430,7 @@ LDAP_entry2mods(krb5_context context, HDB * db, hdb_entry_ex * ent,
|
||||
* If this is just a "account" entry and no other objectclass
|
||||
* is hanging on this entry, it's really a new entry.
|
||||
*/
|
||||
if (is_samba_account == FALSE && is_heimdal_principal == FALSE &&
|
||||
if (is_samba_account == FALSE && is_heimdal_principal == FALSE &&
|
||||
is_heimdal_entry == FALSE) {
|
||||
if (is_account == TRUE) {
|
||||
is_new_entry = TRUE;
|
||||
@@ -454,7 +454,7 @@ LDAP_entry2mods(krb5_context context, HDB * db, hdb_entry_ex * ent,
|
||||
|
||||
/* account is the structural object class */
|
||||
if (is_account == FALSE) {
|
||||
ret = LDAP_addmod(&mods, LDAP_MOD_ADD, "objectClass",
|
||||
ret = LDAP_addmod(&mods, LDAP_MOD_ADD, "objectClass",
|
||||
structural_object);
|
||||
is_account = TRUE;
|
||||
if (ret)
|
||||
@@ -472,7 +472,7 @@ LDAP_entry2mods(krb5_context context, HDB * db, hdb_entry_ex * ent,
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (is_new_entry ||
|
||||
if (is_new_entry ||
|
||||
krb5_principal_compare(context, ent->entry.principal, orig.entry.principal)
|
||||
== FALSE)
|
||||
{
|
||||
@@ -506,7 +506,7 @@ LDAP_entry2mods(krb5_context context, HDB * db, hdb_entry_ex * ent,
|
||||
|
||||
if (is_heimdal_entry && (ent->entry.kvno != orig.entry.kvno || is_new_entry)) {
|
||||
ret = LDAP_addmod_integer(context, &mods, LDAP_MOD_REPLACE,
|
||||
"krb5KeyVersionNumber",
|
||||
"krb5KeyVersionNumber",
|
||||
ent->entry.kvno);
|
||||
if (ret)
|
||||
goto out;
|
||||
@@ -525,7 +525,7 @@ LDAP_entry2mods(krb5_context context, HDB * db, hdb_entry_ex * ent,
|
||||
|
||||
if (ent->entry.valid_end) {
|
||||
if (orig.entry.valid_end == NULL || (*(ent->entry.valid_end) != *(orig.entry.valid_end))) {
|
||||
if (is_heimdal_entry) {
|
||||
if (is_heimdal_entry) {
|
||||
ret = LDAP_addmod_generalized_time(&mods, LDAP_MOD_REPLACE,
|
||||
"krb5ValidEnd",
|
||||
ent->entry.valid_end);
|
||||
@@ -534,7 +534,7 @@ LDAP_entry2mods(krb5_context context, HDB * db, hdb_entry_ex * ent,
|
||||
}
|
||||
if (is_samba_account) {
|
||||
ret = LDAP_addmod_integer(context, &mods, LDAP_MOD_REPLACE,
|
||||
"sambaKickoffTime",
|
||||
"sambaKickoffTime",
|
||||
*(ent->entry.valid_end));
|
||||
if (ret)
|
||||
goto out;
|
||||
@@ -554,7 +554,7 @@ LDAP_entry2mods(krb5_context context, HDB * db, hdb_entry_ex * ent,
|
||||
|
||||
if (is_samba_account) {
|
||||
ret = LDAP_addmod_integer(context, &mods, LDAP_MOD_REPLACE,
|
||||
"sambaPwdMustChange",
|
||||
"sambaPwdMustChange",
|
||||
*(ent->entry.pw_end));
|
||||
if (ret)
|
||||
goto out;
|
||||
@@ -567,7 +567,7 @@ LDAP_entry2mods(krb5_context context, HDB * db, hdb_entry_ex * ent,
|
||||
if (is_samba_account && ent->entry.last_pw_change) {
|
||||
if (orig.entry.last_pw_change == NULL || (*(ent->entry.last_pw_change) != *(orig.entry.last_pw_change))) {
|
||||
ret = LDAP_addmod_integer(context, &mods, LDAP_MOD_REPLACE,
|
||||
"sambaPwdLastSet",
|
||||
"sambaPwdLastSet",
|
||||
*(ent->entry.last_pw_change));
|
||||
if (ret)
|
||||
goto out;
|
||||
@@ -580,7 +580,7 @@ LDAP_entry2mods(krb5_context context, HDB * db, hdb_entry_ex * ent,
|
||||
|| (*(ent->entry.max_life) != *(orig.entry.max_life))) {
|
||||
|
||||
ret = LDAP_addmod_integer(context, &mods, LDAP_MOD_REPLACE,
|
||||
"krb5MaxLife",
|
||||
"krb5MaxLife",
|
||||
*(ent->entry.max_life));
|
||||
if (ret)
|
||||
goto out;
|
||||
@@ -629,13 +629,13 @@ LDAP_entry2mods(krb5_context context, HDB * db, hdb_entry_ex * ent,
|
||||
&& ent->entry.keys.val[i].key.keytype == ETYPE_ARCFOUR_HMAC_MD5) {
|
||||
char *ntHexPassword;
|
||||
char *nt;
|
||||
|
||||
|
||||
/* the key might have been 'sealed', but samba passwords
|
||||
are clear in the directory */
|
||||
ret = hdb_unseal_key(context, db, &ent->entry.keys.val[i]);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
|
||||
nt = ent->entry.keys.val[i].key.keyvalue.data;
|
||||
/* store in ntPassword, not krb5key */
|
||||
ret = hex_encode(nt, 16, &ntHexPassword);
|
||||
@@ -645,12 +645,12 @@ LDAP_entry2mods(krb5_context context, HDB * db, hdb_entry_ex * ent,
|
||||
"hex encode key");
|
||||
goto out;
|
||||
}
|
||||
ret = LDAP_addmod(&mods, LDAP_MOD_REPLACE, "sambaNTPassword",
|
||||
ret = LDAP_addmod(&mods, LDAP_MOD_REPLACE, "sambaNTPassword",
|
||||
ntHexPassword);
|
||||
free(ntHexPassword);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
|
||||
/* have to kill the LM passwod if it exists */
|
||||
vals = ldap_get_values_len(HDB2LDAP(db), msg, "sambaLMPassword");
|
||||
if (vals) {
|
||||
@@ -660,7 +660,7 @@ LDAP_entry2mods(krb5_context context, HDB * db, hdb_entry_ex * ent,
|
||||
if (ret)
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
} else if (is_heimdal_entry) {
|
||||
unsigned char *buf;
|
||||
size_t len, buf_size;
|
||||
@@ -681,7 +681,7 @@ LDAP_entry2mods(krb5_context context, HDB * db, hdb_entry_ex * ent,
|
||||
if (ent->entry.etypes) {
|
||||
int add_krb5EncryptionType = 0;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Only add/modify krb5EncryptionType if it's a new heimdal
|
||||
* entry or krb5EncryptionType already exists on the entry.
|
||||
*/
|
||||
@@ -701,7 +701,7 @@ LDAP_entry2mods(krb5_context context, HDB * db, hdb_entry_ex * ent,
|
||||
|
||||
if (add_krb5EncryptionType) {
|
||||
for (i = 0; i < ent->entry.etypes->len; i++) {
|
||||
if (is_samba_account &&
|
||||
if (is_samba_account &&
|
||||
ent->entry.keys.val[i].key.keytype == ETYPE_ARCFOUR_HMAC_MD5)
|
||||
{
|
||||
;
|
||||
@@ -810,8 +810,8 @@ LDAP__lookup_princ(krb5_context context,
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
rc = ldap_search_ext_s(HDB2LDAP(db), HDB2BASE(db),
|
||||
LDAP_SCOPE_SUBTREE, filter,
|
||||
rc = ldap_search_ext_s(HDB2LDAP(db), HDB2BASE(db),
|
||||
LDAP_SCOPE_SUBTREE, filter,
|
||||
krb5kdcentry_attrs, 0,
|
||||
NULL, NULL, NULL,
|
||||
0, msg);
|
||||
@@ -837,12 +837,12 @@ LDAP__lookup_princ(krb5_context context,
|
||||
krb5_set_error_message(context, ret, "asprintf: out of memory");
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
ret = LDAP_no_size_limit(context, HDB2LDAP(db));
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
rc = ldap_search_ext_s(HDB2LDAP(db), HDB2BASE(db), LDAP_SCOPE_SUBTREE,
|
||||
rc = ldap_search_ext_s(HDB2LDAP(db), HDB2BASE(db), LDAP_SCOPE_SUBTREE,
|
||||
filter, krb5kdcentry_attrs, 0,
|
||||
NULL, NULL, NULL,
|
||||
0, msg);
|
||||
@@ -932,7 +932,7 @@ LDAP_message2entry(krb5_context context, HDB * db, LDAPMessage * msg,
|
||||
if (ret)
|
||||
goto out;
|
||||
} else {
|
||||
krb5_set_error_message(context, HDB_ERR_NOENTRY,
|
||||
krb5_set_error_message(context, HDB_ERR_NOENTRY,
|
||||
"hdb-ldap: ldap entry missing"
|
||||
"principal name");
|
||||
return HDB_ERR_NOENTRY;
|
||||
@@ -1068,16 +1068,16 @@ LDAP_message2entry(krb5_context context, HDB * db, LDAPMessage * msg,
|
||||
break;
|
||||
/* If there is no ARCFOUR enctype, add one */
|
||||
if (i == ent->entry.etypes->len) {
|
||||
etypes = realloc(ent->entry.etypes->val,
|
||||
(ent->entry.etypes->len + 1) *
|
||||
etypes = realloc(ent->entry.etypes->val,
|
||||
(ent->entry.etypes->len + 1) *
|
||||
sizeof(ent->entry.etypes->val[0]));
|
||||
if (etypes == NULL) {
|
||||
ret = ENOMEM;
|
||||
krb5_set_error_message(context, ret, "malloc: out of memory");
|
||||
goto out;
|
||||
goto out;
|
||||
}
|
||||
ent->entry.etypes->val = etypes;
|
||||
ent->entry.etypes->val[ent->entry.etypes->len] =
|
||||
ent->entry.etypes->val[ent->entry.etypes->len] =
|
||||
ETYPE_ARCFOUR_HMAC_MD5;
|
||||
ent->entry.etypes->len++;
|
||||
}
|
||||
@@ -1130,7 +1130,7 @@ LDAP_message2entry(krb5_context context, HDB * db, LDAPMessage * msg,
|
||||
free(ent->entry.valid_start);
|
||||
ent->entry.valid_start = NULL;
|
||||
}
|
||||
|
||||
|
||||
ent->entry.valid_end = malloc(sizeof(*ent->entry.valid_end));
|
||||
if (ent->entry.valid_end == NULL) {
|
||||
ret = ENOMEM;
|
||||
@@ -1234,29 +1234,29 @@ LDAP_message2entry(krb5_context context, HDB * db, LDAPMessage * msg,
|
||||
ret = LDAP_get_string_value(db, msg, "sambaAcctFlags", &samba_acct_flags);
|
||||
if (ret == 0) {
|
||||
/* parse the [UXW...] string:
|
||||
|
||||
'N' No password
|
||||
'D' Disabled
|
||||
'H' Homedir required
|
||||
'T' Temp account.
|
||||
'U' User account (normal)
|
||||
'M' MNS logon user account - what is this ?
|
||||
'W' Workstation account
|
||||
'S' Server account
|
||||
'L' Locked account
|
||||
'X' No Xpiry on password
|
||||
'I' Interdomain trust account
|
||||
|
||||
*/
|
||||
|
||||
|
||||
'N' No password
|
||||
'D' Disabled
|
||||
'H' Homedir required
|
||||
'T' Temp account.
|
||||
'U' User account (normal)
|
||||
'M' MNS logon user account - what is this ?
|
||||
'W' Workstation account
|
||||
'S' Server account
|
||||
'L' Locked account
|
||||
'X' No Xpiry on password
|
||||
'I' Interdomain trust account
|
||||
|
||||
*/
|
||||
|
||||
int i;
|
||||
int flags_len = strlen(samba_acct_flags);
|
||||
|
||||
if (flags_len < 2)
|
||||
goto out2;
|
||||
|
||||
if (samba_acct_flags[0] != '['
|
||||
|| samba_acct_flags[flags_len - 1] != ']')
|
||||
if (samba_acct_flags[0] != '['
|
||||
|| samba_acct_flags[flags_len - 1] != ']')
|
||||
goto out2;
|
||||
|
||||
/* Allow forwarding */
|
||||
@@ -1329,7 +1329,7 @@ LDAP_close(krb5_context context, HDB * db)
|
||||
ldap_unbind_ext(HDB2LDAP(db), NULL, NULL);
|
||||
((struct hdbldapdb *)db->hdb_db)->h_lp = NULL;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1613,7 +1613,7 @@ LDAP_store(krb5_context context, HDB * db, unsigned flags,
|
||||
ldap_get_option(HDB2LDAP(db), LDAP_OPT_ERROR_STRING,
|
||||
&ld_error);
|
||||
ret = HDB_ERR_CANT_LOCK_DB;
|
||||
krb5_set_error_message(context, ret, "%s: %s (DN=%s) %s: %s",
|
||||
krb5_set_error_message(context, ret, "%s: %s (DN=%s) %s: %s",
|
||||
errfn, name, dn, ldap_err2string(rc), ld_error);
|
||||
} else
|
||||
ret = 0;
|
||||
@@ -1667,7 +1667,7 @@ LDAP_remove(krb5_context context, HDB *db, krb5_const_principal principal)
|
||||
rc = ldap_delete_ext_s(HDB2LDAP(db), dn, NULL, NULL );
|
||||
if (check_ldap(context, db, rc)) {
|
||||
ret = HDB_ERR_CANT_LOCK_DB;
|
||||
krb5_set_error_message(context, ret, "ldap_delete_ext_s: %s",
|
||||
krb5_set_error_message(context, ret, "ldap_delete_ext_s: %s",
|
||||
ldap_err2string(rc));
|
||||
} else
|
||||
ret = 0;
|
||||
@@ -1720,7 +1720,7 @@ hdb_ldap_common(krb5_context context,
|
||||
if (structural_object == NULL) {
|
||||
const char *p;
|
||||
|
||||
p = krb5_config_get_string(context, NULL, "kdc",
|
||||
p = krb5_config_get_string(context, NULL, "kdc",
|
||||
"hdb-ldap-structural-object", NULL);
|
||||
if (p == NULL)
|
||||
p = default_structural_object;
|
||||
@@ -1731,7 +1731,7 @@ hdb_ldap_common(krb5_context context,
|
||||
}
|
||||
}
|
||||
|
||||
samba_forwardable =
|
||||
samba_forwardable =
|
||||
krb5_config_get_bool_default(context, NULL, TRUE,
|
||||
"kdc", "hdb-samba-forwardable", NULL);
|
||||
|
||||
@@ -1768,7 +1768,7 @@ hdb_ldap_common(krb5_context context,
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
create_base = krb5_config_get_string(context, NULL, "kdc",
|
||||
create_base = krb5_config_get_string(context, NULL, "kdc",
|
||||
"hdb-ldap-create-base", NULL);
|
||||
if (create_base == NULL)
|
||||
create_base = h->h_base;
|
||||
|
@@ -1,34 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 1997 - 2007 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "hdb_locl.h"
|
||||
@@ -75,10 +75,10 @@ hdb_next_enctype2key(krb5_context context,
|
||||
Key **key)
|
||||
{
|
||||
Key *k;
|
||||
|
||||
|
||||
for (k = *key ? (*key) + 1 : e->keys.val;
|
||||
k < e->keys.val + e->keys.len;
|
||||
k++)
|
||||
k < e->keys.val + e->keys.len;
|
||||
k++)
|
||||
{
|
||||
if(k->key.keytype == enctype){
|
||||
*key = k;
|
||||
@@ -86,15 +86,15 @@ hdb_next_enctype2key(krb5_context context,
|
||||
}
|
||||
}
|
||||
krb5_set_error_message(context, KRB5_PROG_ETYPE_NOSUPP,
|
||||
"No next enctype %d for hdb-entry",
|
||||
"No next enctype %d for hdb-entry",
|
||||
(int)enctype);
|
||||
return KRB5_PROG_ETYPE_NOSUPP; /* XXX */
|
||||
}
|
||||
|
||||
krb5_error_code
|
||||
hdb_enctype2key(krb5_context context,
|
||||
hdb_entry *e,
|
||||
krb5_enctype enctype,
|
||||
hdb_enctype2key(krb5_context context,
|
||||
hdb_entry *e,
|
||||
krb5_enctype enctype,
|
||||
Key **key)
|
||||
{
|
||||
*key = NULL;
|
||||
@@ -104,7 +104,7 @@ hdb_enctype2key(krb5_context context,
|
||||
void
|
||||
hdb_free_key(Key *key)
|
||||
{
|
||||
memset(key->key.keyvalue.data,
|
||||
memset(key->key.keyvalue.data,
|
||||
0,
|
||||
key->key.keyvalue.length);
|
||||
free_Key(key);
|
||||
@@ -216,11 +216,11 @@ hdb_init_db(krb5_context context, HDB *db)
|
||||
krb5_data tag;
|
||||
krb5_data version;
|
||||
char ver[32];
|
||||
|
||||
|
||||
ret = hdb_check_db_format(context, db);
|
||||
if(ret != HDB_ERR_NOENTRY)
|
||||
return ret;
|
||||
|
||||
|
||||
ret = db->hdb_lock(context, db, HDB_WLOCK);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -249,7 +249,7 @@ hdb_init_db(krb5_context context, HDB *db)
|
||||
|
||||
static const struct hdb_method *
|
||||
find_dynamic_method (krb5_context context,
|
||||
const char *filename,
|
||||
const char *filename,
|
||||
const char **rest)
|
||||
{
|
||||
static struct hdb_method method;
|
||||
@@ -258,7 +258,7 @@ find_dynamic_method (krb5_context context,
|
||||
const char *p;
|
||||
void *dl;
|
||||
size_t len;
|
||||
|
||||
|
||||
p = strchr(filename, ':');
|
||||
|
||||
/* if no prefix, don't know what module to load, just ignore it */
|
||||
@@ -267,11 +267,11 @@ find_dynamic_method (krb5_context context,
|
||||
|
||||
len = p - filename;
|
||||
*rest = filename + len + 1;
|
||||
|
||||
|
||||
prefix = strndup(filename, len);
|
||||
if (prefix == NULL)
|
||||
krb5_errx(context, 1, "out of memory");
|
||||
|
||||
|
||||
if (asprintf(&path, LIBDIR "/hdb_%s.so", prefix) == -1)
|
||||
krb5_errx(context, 1, "out of memory");
|
||||
|
||||
@@ -290,13 +290,13 @@ find_dynamic_method (krb5_context context,
|
||||
free(path);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
if (asprintf(&symbol, "hdb_%s_interface", prefix) == -1)
|
||||
krb5_errx(context, 1, "out of memory");
|
||||
|
||||
mso = dlsym(dl, symbol);
|
||||
if (mso == NULL) {
|
||||
krb5_warnx(context, "error finding symbol %s in %s: %s\n",
|
||||
krb5_warnx(context, "error finding symbol %s in %s: %s\n",
|
||||
symbol, path, dlerror());
|
||||
dlclose(dl);
|
||||
free(symbol);
|
||||
@@ -308,9 +308,9 @@ find_dynamic_method (krb5_context context,
|
||||
free(symbol);
|
||||
|
||||
if (mso->version != HDB_INTERFACE_VERSION) {
|
||||
krb5_warnx(context,
|
||||
krb5_warnx(context,
|
||||
"error wrong version in shared module %s "
|
||||
"version: %d should have been %d\n",
|
||||
"version: %d should have been %d\n",
|
||||
prefix, mso->version, HDB_INTERFACE_VERSION);
|
||||
dlclose(dl);
|
||||
free(prefix);
|
||||
|
@@ -1,34 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 1997 - 2007 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
@@ -78,7 +78,7 @@ typedef struct HDB{
|
||||
struct HDB*,
|
||||
int,
|
||||
mode_t);
|
||||
krb5_error_code (*hdb_close)(krb5_context,
|
||||
krb5_error_code (*hdb_close)(krb5_context,
|
||||
struct HDB*);
|
||||
void (*hdb_free)(krb5_context,
|
||||
struct HDB*,
|
||||
@@ -117,10 +117,10 @@ typedef struct HDB{
|
||||
krb5_data*);
|
||||
krb5_error_code (*hdb__put)(krb5_context,
|
||||
struct HDB*,
|
||||
int,
|
||||
int,
|
||||
krb5_data,
|
||||
krb5_data);
|
||||
krb5_error_code (*hdb__del)(krb5_context,
|
||||
krb5_error_code (*hdb__del)(krb5_context,
|
||||
struct HDB*,
|
||||
krb5_data);
|
||||
krb5_error_code (*hdb_destroy)(krb5_context,
|
||||
|
@@ -1,34 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 1997-2001 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
102
lib/hdb/keys.c
102
lib/hdb/keys.c
@@ -1,34 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 1997 - 2001, 2003 - 2004 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "hdb_locl.h"
|
||||
@@ -57,7 +57,7 @@ hdb_free_keys (krb5_context context, int len, Key *keys)
|
||||
free (keys);
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* for each entry in `default_keys' try to parse it as a sequence
|
||||
* of etype:salttype:salt, syntax of this if something like:
|
||||
* [(des|des3|etype):](pw-salt|afs3)[:string], if etype is omitted it
|
||||
@@ -68,21 +68,21 @@ hdb_free_keys (krb5_context context, int len, Key *keys)
|
||||
* afs or afs3 == des:afs3-salt
|
||||
*/
|
||||
|
||||
static const krb5_enctype des_etypes[] = {
|
||||
static const krb5_enctype des_etypes[] = {
|
||||
ETYPE_DES_CBC_MD5,
|
||||
ETYPE_DES_CBC_MD4,
|
||||
ETYPE_DES_CBC_CRC
|
||||
};
|
||||
|
||||
static const krb5_enctype all_etypes[] = {
|
||||
static const krb5_enctype all_etypes[] = {
|
||||
ETYPE_AES256_CTS_HMAC_SHA1_96,
|
||||
ETYPE_ARCFOUR_HMAC_MD5,
|
||||
ETYPE_DES3_CBC_SHA1
|
||||
};
|
||||
|
||||
static krb5_error_code
|
||||
parse_key_set(krb5_context context, const char *key,
|
||||
krb5_enctype **ret_enctypes, size_t *ret_num_enctypes,
|
||||
parse_key_set(krb5_context context, const char *key,
|
||||
krb5_enctype **ret_enctypes, size_t *ret_num_enctypes,
|
||||
krb5_salt *salt, krb5_principal principal)
|
||||
{
|
||||
const char *p;
|
||||
@@ -92,7 +92,7 @@ parse_key_set(krb5_context context, const char *key,
|
||||
krb5_enctype e;
|
||||
const krb5_enctype *enctypes = NULL;
|
||||
krb5_error_code ret;
|
||||
|
||||
|
||||
p = key;
|
||||
|
||||
*ret_enctypes = NULL;
|
||||
@@ -161,12 +161,12 @@ parse_key_set(krb5_context context, const char *key,
|
||||
salt->saltvalue.length = strlen(buf[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(enctypes == NULL || salt->salttype == 0) {
|
||||
krb5_set_error_message(context, EINVAL, "bad value for default_keys `%s'", key);
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
|
||||
/* if no salt was specified make up default salt */
|
||||
if(salt->saltvalue.data == NULL) {
|
||||
if(salt->salttype == KRB5_PW_SALT)
|
||||
@@ -198,7 +198,7 @@ parse_key_set(krb5_context context, const char *key,
|
||||
}
|
||||
|
||||
static krb5_error_code
|
||||
add_enctype_to_key_set(Key **key_set, size_t *nkeyset,
|
||||
add_enctype_to_key_set(Key **key_set, size_t *nkeyset,
|
||||
krb5_enctype enctype, krb5_salt *salt)
|
||||
{
|
||||
krb5_error_code ret;
|
||||
@@ -209,13 +209,13 @@ add_enctype_to_key_set(Key **key_set, size_t *nkeyset,
|
||||
tmp = realloc(*key_set, (*nkeyset + 1) * sizeof((*key_set)[0]));
|
||||
if (tmp == NULL)
|
||||
return ENOMEM;
|
||||
|
||||
|
||||
*key_set = tmp;
|
||||
|
||||
key.key.keytype = enctype;
|
||||
key.key.keyvalue.length = 0;
|
||||
key.key.keyvalue.data = NULL;
|
||||
|
||||
|
||||
if (salt) {
|
||||
key.salt = malloc(sizeof(*key.salt));
|
||||
if (key.salt == NULL) {
|
||||
@@ -226,8 +226,8 @@ add_enctype_to_key_set(Key **key_set, size_t *nkeyset,
|
||||
key.salt->type = salt->salttype;
|
||||
krb5_data_zero (&key.salt->salt);
|
||||
|
||||
ret = krb5_data_copy(&key.salt->salt,
|
||||
salt->saltvalue.data,
|
||||
ret = krb5_data_copy(&key.salt->salt,
|
||||
salt->saltvalue.data,
|
||||
salt->saltvalue.length);
|
||||
if (ret) {
|
||||
free_Key(&key);
|
||||
@@ -235,9 +235,9 @@ add_enctype_to_key_set(Key **key_set, size_t *nkeyset,
|
||||
}
|
||||
} else
|
||||
key.salt = NULL;
|
||||
|
||||
|
||||
(*key_set)[*nkeyset] = key;
|
||||
|
||||
|
||||
*nkeyset += 1;
|
||||
|
||||
return 0;
|
||||
@@ -265,7 +265,7 @@ hdb_generate_key_set(krb5_context context, krb5_principal principal,
|
||||
"arcfour-hmac-md5:pw-salt",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
ktypes = krb5_config_get_strings(context, NULL, "kadmin",
|
||||
"default_keys", NULL);
|
||||
if (ktypes == NULL)
|
||||
@@ -278,7 +278,7 @@ hdb_generate_key_set(krb5_context context, krb5_principal principal,
|
||||
*nkeyset = 0;
|
||||
|
||||
ret = 0;
|
||||
|
||||
|
||||
for(kp = ktypes; kp && *kp; kp++) {
|
||||
const char *p;
|
||||
krb5_salt salt;
|
||||
@@ -295,7 +295,7 @@ hdb_generate_key_set(krb5_context context, krb5_principal principal,
|
||||
p = "des:afs3-salt";
|
||||
else if (strcmp(p, "arcfour-hmac-md5") == 0)
|
||||
p = "arcfour-hmac-md5:pw-salt";
|
||||
|
||||
|
||||
memset(&salt, 0, sizeof(salt));
|
||||
|
||||
ret = parse_key_set(context, p,
|
||||
@@ -319,14 +319,14 @@ hdb_generate_key_set(krb5_context context, krb5_principal principal,
|
||||
break;
|
||||
if (k->salt->type == salt.salttype &&
|
||||
k->salt->salt.length == salt.saltvalue.length &&
|
||||
memcmp(k->salt->salt.data, salt.saltvalue.data,
|
||||
memcmp(k->salt->salt.data, salt.saltvalue.data,
|
||||
salt.saltvalue.length) == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* not a duplicate, lets add it */
|
||||
if (j == *nkeyset) {
|
||||
ret = add_enctype_to_key_set(&key_set, nkeyset, enctypes[i],
|
||||
ret = add_enctype_to_key_set(&key_set, nkeyset, enctypes[i],
|
||||
no_salt ? NULL : &salt);
|
||||
if (ret) {
|
||||
free(enctypes);
|
||||
@@ -338,7 +338,7 @@ hdb_generate_key_set(krb5_context context, krb5_principal principal,
|
||||
free(enctypes);
|
||||
krb5_free_salt(context, salt);
|
||||
}
|
||||
|
||||
|
||||
*ret_key_set = key_set;
|
||||
|
||||
out:
|
||||
@@ -346,14 +346,14 @@ hdb_generate_key_set(krb5_context context, krb5_principal principal,
|
||||
krb5_config_free_strings(ktypes);
|
||||
|
||||
if (ret) {
|
||||
krb5_warn(context, ret,
|
||||
krb5_warn(context, ret,
|
||||
"failed to parse the [kadmin]default_keys values");
|
||||
|
||||
for (i = 0; i < *nkeyset; i++)
|
||||
free_Key(&key_set[i]);
|
||||
free(key_set);
|
||||
} else if (*nkeyset == 0) {
|
||||
krb5_warnx(context,
|
||||
krb5_warnx(context,
|
||||
"failed to parse any of the [kadmin]default_keys values");
|
||||
ret = EINVAL; /* XXX */
|
||||
}
|
||||
@@ -363,10 +363,10 @@ hdb_generate_key_set(krb5_context context, krb5_principal principal,
|
||||
|
||||
|
||||
krb5_error_code
|
||||
hdb_generate_key_set_password(krb5_context context,
|
||||
krb5_principal principal,
|
||||
const char *password,
|
||||
Key **keys, size_t *num_keys)
|
||||
hdb_generate_key_set_password(krb5_context context,
|
||||
krb5_principal principal,
|
||||
const char *password,
|
||||
Key **keys, size_t *num_keys)
|
||||
{
|
||||
krb5_error_code ret;
|
||||
int i;
|
||||
|
@@ -1,34 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 1999 - 2002 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "hdb_locl.h"
|
||||
@@ -108,15 +108,15 @@ hdb_close(krb5_context context, krb5_keytab id)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static krb5_error_code
|
||||
hdb_get_name(krb5_context context,
|
||||
krb5_keytab id,
|
||||
char *name,
|
||||
static krb5_error_code
|
||||
hdb_get_name(krb5_context context,
|
||||
krb5_keytab id,
|
||||
char *name,
|
||||
size_t namesize)
|
||||
{
|
||||
struct hdb_data *d = id->data;
|
||||
|
||||
snprintf(name, namesize, "%s%s%s",
|
||||
snprintf(name, namesize, "%s%s%s",
|
||||
d->dbname ? d->dbname : "",
|
||||
(d->dbname || d->mkey) ? ":" : "",
|
||||
d->mkey ? d->mkey : "");
|
||||
@@ -220,7 +220,7 @@ hdb_get_entry(krb5_context context,
|
||||
(*db->hdb_destroy)(context, db);
|
||||
return ret;
|
||||
}
|
||||
ret = (*db->hdb_fetch)(context, db, principal,
|
||||
ret = (*db->hdb_fetch)(context, db, principal,
|
||||
HDB_F_DECRYPT|
|
||||
HDB_F_GET_CLIENT|HDB_F_GET_SERVER|HDB_F_GET_KRBTGT,
|
||||
&ent);
|
||||
@@ -244,8 +244,8 @@ hdb_get_entry(krb5_context context,
|
||||
if(ent.entry.keys.val[i].key.keytype == enctype) {
|
||||
krb5_copy_principal(context, principal, &entry->principal);
|
||||
entry->vno = ent.entry.kvno;
|
||||
krb5_copy_keyblock_contents(context,
|
||||
&ent.entry.keys.val[i].key,
|
||||
krb5_copy_keyblock_contents(context,
|
||||
&ent.entry.keys.val[i].key,
|
||||
&entry->keyblock);
|
||||
ret = 0;
|
||||
break;
|
||||
|
108
lib/hdb/mkey.c
108
lib/hdb/mkey.c
@@ -1,34 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 2000 - 2004 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "hdb_locl.h"
|
||||
@@ -110,7 +110,7 @@ hdb_add_master_key(krb5_context context, krb5_keyblock *key,
|
||||
}
|
||||
|
||||
static krb5_error_code
|
||||
read_master_keytab(krb5_context context, const char *filename,
|
||||
read_master_keytab(krb5_context context, const char *filename,
|
||||
hdb_master_key *mkey)
|
||||
{
|
||||
krb5_error_code ret;
|
||||
@@ -118,7 +118,7 @@ read_master_keytab(krb5_context context, const char *filename,
|
||||
krb5_kt_cursor cursor;
|
||||
krb5_keytab_entry entry;
|
||||
hdb_master_key p;
|
||||
|
||||
|
||||
ret = krb5_kt_resolve(context, filename, &id);
|
||||
if(ret)
|
||||
return ret;
|
||||
@@ -147,7 +147,7 @@ read_master_keytab(krb5_context context, const char *filename,
|
||||
|
||||
/* read a MIT master keyfile */
|
||||
static krb5_error_code
|
||||
read_master_mit(krb5_context context, const char *filename,
|
||||
read_master_mit(krb5_context context, const char *filename,
|
||||
hdb_master_key *mkey)
|
||||
{
|
||||
int fd;
|
||||
@@ -155,7 +155,7 @@ read_master_mit(krb5_context context, const char *filename,
|
||||
krb5_storage *sp;
|
||||
int16_t enctype;
|
||||
krb5_keyblock key;
|
||||
|
||||
|
||||
fd = open(filename, O_RDONLY | O_BINARY);
|
||||
if(fd < 0) {
|
||||
int save_errno = errno;
|
||||
@@ -177,7 +177,7 @@ read_master_mit(krb5_context context, const char *filename,
|
||||
ret = krb5_ret_int16(sp, &enctype);
|
||||
if((htons(enctype) & 0xff00) == 0x3000) {
|
||||
ret = HEIM_ERR_BAD_MKEY;
|
||||
krb5_set_error_message(context, ret, "unknown keytype in %s: %#x, expected %#x",
|
||||
krb5_set_error_message(context, ret, "unknown keytype in %s: %#x, expected %#x",
|
||||
filename, htons(enctype), 0x3000);
|
||||
goto out;
|
||||
}
|
||||
@@ -196,7 +196,7 @@ read_master_mit(krb5_context context, const char *filename,
|
||||
|
||||
/* read an old master key file */
|
||||
static krb5_error_code
|
||||
read_master_encryptionkey(krb5_context context, const char *filename,
|
||||
read_master_encryptionkey(krb5_context context, const char *filename,
|
||||
hdb_master_key *mkey)
|
||||
{
|
||||
int fd;
|
||||
@@ -205,20 +205,20 @@ read_master_encryptionkey(krb5_context context, const char *filename,
|
||||
unsigned char buf[256];
|
||||
ssize_t len;
|
||||
size_t ret_len;
|
||||
|
||||
|
||||
fd = open(filename, O_RDONLY | O_BINARY);
|
||||
if(fd < 0) {
|
||||
int save_errno = errno;
|
||||
krb5_set_error_message(context, save_errno, "failed to open %s: %s",
|
||||
krb5_set_error_message(context, save_errno, "failed to open %s: %s",
|
||||
filename, strerror(save_errno));
|
||||
return save_errno;
|
||||
}
|
||||
|
||||
|
||||
len = read(fd, buf, sizeof(buf));
|
||||
close(fd);
|
||||
if(len < 0) {
|
||||
int save_errno = errno;
|
||||
krb5_set_error_message(context, save_errno, "error reading %s: %s",
|
||||
krb5_set_error_message(context, save_errno, "error reading %s: %s",
|
||||
filename, strerror(save_errno));
|
||||
return save_errno;
|
||||
}
|
||||
@@ -235,7 +235,7 @@ read_master_encryptionkey(krb5_context context, const char *filename,
|
||||
problem. */
|
||||
if(key.keytype == KEYTYPE_DES || key.keytype == ETYPE_DES_CBC_MD5)
|
||||
key.keytype = ETYPE_DES_CFB64_NONE;
|
||||
|
||||
|
||||
ret = hdb_process_master_key(context, 0, &key, 0, mkey);
|
||||
krb5_free_keyblock_contents(context, &key);
|
||||
return ret;
|
||||
@@ -243,7 +243,7 @@ read_master_encryptionkey(krb5_context context, const char *filename,
|
||||
|
||||
/* read a krb4 /.k style file */
|
||||
static krb5_error_code
|
||||
read_master_krb4(krb5_context context, const char *filename,
|
||||
read_master_krb4(krb5_context context, const char *filename,
|
||||
hdb_master_key *mkey)
|
||||
{
|
||||
int fd;
|
||||
@@ -251,25 +251,25 @@ read_master_krb4(krb5_context context, const char *filename,
|
||||
krb5_error_code ret;
|
||||
unsigned char buf[256];
|
||||
ssize_t len;
|
||||
|
||||
|
||||
fd = open(filename, O_RDONLY | O_BINARY);
|
||||
if(fd < 0) {
|
||||
int save_errno = errno;
|
||||
krb5_set_error_message(context, save_errno, "failed to open %s: %s",
|
||||
krb5_set_error_message(context, save_errno, "failed to open %s: %s",
|
||||
filename, strerror(save_errno));
|
||||
return save_errno;
|
||||
}
|
||||
|
||||
|
||||
len = read(fd, buf, sizeof(buf));
|
||||
close(fd);
|
||||
if(len < 0) {
|
||||
int save_errno = errno;
|
||||
krb5_set_error_message(context, save_errno, "error reading %s: %s",
|
||||
krb5_set_error_message(context, save_errno, "error reading %s: %s",
|
||||
filename, strerror(save_errno));
|
||||
return save_errno;
|
||||
}
|
||||
if(len != 8) {
|
||||
krb5_set_error_message(context, HEIM_ERR_EOF,
|
||||
krb5_set_error_message(context, HEIM_ERR_EOF,
|
||||
"bad contents of %s", filename);
|
||||
return HEIM_ERR_EOF; /* XXX file might be too large */
|
||||
}
|
||||
@@ -278,7 +278,7 @@ read_master_krb4(krb5_context context, const char *filename,
|
||||
key.keytype = ETYPE_DES_PCBC_NONE;
|
||||
ret = krb5_data_copy(&key.keyvalue, buf, len);
|
||||
memset(buf, 0, sizeof(buf));
|
||||
if(ret)
|
||||
if(ret)
|
||||
return ret;
|
||||
|
||||
ret = hdb_process_master_key(context, 0, &key, 0, mkey);
|
||||
@@ -287,7 +287,7 @@ read_master_krb4(krb5_context context, const char *filename,
|
||||
}
|
||||
|
||||
krb5_error_code
|
||||
hdb_read_master_key(krb5_context context, const char *filename,
|
||||
hdb_read_master_key(krb5_context context, const char *filename,
|
||||
hdb_master_key *mkey)
|
||||
{
|
||||
FILE *f;
|
||||
@@ -304,26 +304,26 @@ hdb_read_master_key(krb5_context context, const char *filename,
|
||||
f = fopen(filename, "r");
|
||||
if(f == NULL) {
|
||||
int save_errno = errno;
|
||||
krb5_set_error_message(context, save_errno, "failed to open %s: %s",
|
||||
krb5_set_error_message(context, save_errno, "failed to open %s: %s",
|
||||
filename, strerror(save_errno));
|
||||
return save_errno;
|
||||
}
|
||||
|
||||
|
||||
if(fread(buf, 1, 2, f) != 2) {
|
||||
fclose(f);
|
||||
krb5_set_error_message(context, HEIM_ERR_EOF, "end of file reading %s", filename);
|
||||
return HEIM_ERR_EOF;
|
||||
}
|
||||
|
||||
|
||||
fseek(f, 0, SEEK_END);
|
||||
len = ftell(f);
|
||||
|
||||
if(fclose(f) != 0)
|
||||
return errno;
|
||||
|
||||
|
||||
if(len < 0)
|
||||
return errno;
|
||||
|
||||
|
||||
if(len == 8) {
|
||||
ret = read_master_krb4(context, filename, mkey);
|
||||
} else if(buf[0] == 0x30 && len <= 127 && buf[1] == len - 2) {
|
||||
@@ -337,7 +337,7 @@ hdb_read_master_key(krb5_context context, const char *filename,
|
||||
}
|
||||
|
||||
krb5_error_code
|
||||
hdb_write_master_key(krb5_context context, const char *filename,
|
||||
hdb_write_master_key(krb5_context context, const char *filename,
|
||||
hdb_master_key mkey)
|
||||
{
|
||||
krb5_error_code ret;
|
||||
@@ -402,7 +402,7 @@ _hdb_mkey_encrypt(krb5_context context, hdb_master_key key,
|
||||
}
|
||||
|
||||
krb5_error_code
|
||||
hdb_unseal_key_mkey(krb5_context context, Key *k, hdb_master_key mkey)
|
||||
hdb_unseal_key_mkey(krb5_context context, Key *k, hdb_master_key mkey)
|
||||
{
|
||||
|
||||
krb5_error_code ret;
|
||||
@@ -429,7 +429,7 @@ hdb_unseal_key_mkey(krb5_context context, Key *k, hdb_master_key mkey)
|
||||
k->key.keyvalue.data,
|
||||
k->key.keyvalue.length,
|
||||
&res);
|
||||
}
|
||||
}
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -463,7 +463,7 @@ hdb_unseal_keys_mkey(krb5_context context, hdb_entry *ent, hdb_master_key mkey)
|
||||
krb5_error_code ret;
|
||||
|
||||
ret = hdb_unseal_key_mkey(context, &ent->keys.val[i], mkey);
|
||||
if (ret)
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
@@ -540,7 +540,7 @@ hdb_seal_keys(krb5_context context, HDB *db, hdb_entry *ent)
|
||||
{
|
||||
if (db->hdb_master_key_set == 0)
|
||||
return 0;
|
||||
|
||||
|
||||
return hdb_seal_keys_mkey(context, ent, db->hdb_master_key);
|
||||
}
|
||||
|
||||
@@ -549,7 +549,7 @@ hdb_seal_key(krb5_context context, HDB *db, Key *k)
|
||||
{
|
||||
if (db->hdb_master_key_set == 0)
|
||||
return 0;
|
||||
|
||||
|
||||
return hdb_seal_key_mkey(context, k, db->hdb_master_key);
|
||||
}
|
||||
|
||||
|
@@ -1,34 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "hdb_locl.h"
|
||||
@@ -76,7 +76,7 @@ NDBM_unlock(krb5_context context, HDB *db)
|
||||
}
|
||||
|
||||
static krb5_error_code
|
||||
NDBM_seq(krb5_context context, HDB *db,
|
||||
NDBM_seq(krb5_context context, HDB *db,
|
||||
unsigned flags, hdb_entry_ex *entry, int first)
|
||||
|
||||
{
|
||||
@@ -194,7 +194,7 @@ NDBM_rename(krb5_context context, HDB *db, const char *new_name)
|
||||
|
||||
close(d->lock_fd);
|
||||
d->lock_fd = lock_fd;
|
||||
|
||||
|
||||
free(db->hdb_name);
|
||||
db->hdb_name = strdup(new_name);
|
||||
return 0;
|
||||
@@ -222,7 +222,7 @@ NDBM__get(krb5_context context, HDB *db, krb5_data key, krb5_data *reply)
|
||||
}
|
||||
|
||||
static krb5_error_code
|
||||
NDBM__put(krb5_context context, HDB *db, int replace,
|
||||
NDBM__put(krb5_context context, HDB *db, int replace,
|
||||
krb5_data key, krb5_data value)
|
||||
{
|
||||
struct ndbm_db *d = (struct ndbm_db *)db->hdb_db;
|
||||
@@ -323,15 +323,15 @@ NDBM_open(krb5_context context, HDB *db, int flags, mode_t mode)
|
||||
if (ret) {
|
||||
NDBM_close(context, db);
|
||||
krb5_set_error_message(context, ret, "hdb_open: failed %s database %s",
|
||||
(flags & O_ACCMODE) == O_RDONLY ?
|
||||
"checking format of" : "initialize",
|
||||
(flags & O_ACCMODE) == O_RDONLY ?
|
||||
"checking format of" : "initialize",
|
||||
db->hdb_name);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
krb5_error_code
|
||||
hdb_ndbm_create(krb5_context context, HDB **db,
|
||||
hdb_ndbm_create(krb5_context context, HDB **db,
|
||||
const char *filename)
|
||||
{
|
||||
*db = calloc(1, sizeof(**db));
|
||||
|
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 1999-2005 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of KTH nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
RCSID("$Id$");
|
||||
|
||||
/*
|
||||
/*
|
||||
This is the present contents of a dump line. This might change at
|
||||
any time. Fields are separated by white space.
|
||||
|
||||
@@ -143,11 +143,11 @@ entry2string_int (krb5_context context, krb5_storage *sp, hdb_entry *ent)
|
||||
for(i = 0; i < ent->keys.len; i++){
|
||||
/* --- mkvno, keytype */
|
||||
if(ent->keys.val[i].mkvno)
|
||||
append_string(context, sp, ":%d:%d:",
|
||||
*ent->keys.val[i].mkvno,
|
||||
append_string(context, sp, ":%d:%d:",
|
||||
*ent->keys.val[i].mkvno,
|
||||
ent->keys.val[i].key.keytype);
|
||||
else
|
||||
append_string(context, sp, "::%d:",
|
||||
append_string(context, sp, "::%d:",
|
||||
ent->keys.val[i].key.keytype);
|
||||
/* --- keydata */
|
||||
append_hex(context, sp, &ent->keys.val[i].key.keyvalue);
|
||||
@@ -176,7 +176,7 @@ entry2string_int (krb5_context context, krb5_storage *sp, hdb_entry *ent)
|
||||
append_string(context, sp, "%s ", time2str(*ent->valid_end));
|
||||
else
|
||||
append_string(context, sp, "- ");
|
||||
|
||||
|
||||
/* --- password ends */
|
||||
if(ent->pw_end)
|
||||
append_string(context, sp, "%s ", time2str(*ent->pw_end));
|
||||
@@ -194,7 +194,7 @@ entry2string_int (krb5_context context, krb5_storage *sp, hdb_entry *ent)
|
||||
append_string(context, sp, "%d ", *ent->max_renew);
|
||||
else
|
||||
append_string(context, sp, "- ");
|
||||
|
||||
|
||||
/* --- flags */
|
||||
append_string(context, sp, "%d ", HDBFlags2int(ent->flags));
|
||||
|
||||
@@ -228,14 +228,14 @@ entry2string_int (krb5_context context, krb5_storage *sp, hdb_entry *ent)
|
||||
}
|
||||
|
||||
free(d);
|
||||
append_string(context, sp, "%s%s", p,
|
||||
append_string(context, sp, "%s%s", p,
|
||||
ent->extensions->len - 1 != i ? ":" : "");
|
||||
free(p);
|
||||
}
|
||||
} else
|
||||
append_string(context, sp, "-");
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ hdb_entry2string (krb5_context context, hdb_entry *ent, char **str)
|
||||
krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
ret = entry2string_int(context, sp, ent);
|
||||
if(ret) {
|
||||
krb5_storage_free(sp);
|
||||
@@ -281,7 +281,7 @@ hdb_print_entry(krb5_context context, HDB *db, hdb_entry_ex *entry, void *data)
|
||||
krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
ret = entry2string_int(context, sp, &entry->entry);
|
||||
if(ret) {
|
||||
krb5_storage_free(sp);
|
||||
|
@@ -1,34 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 2005 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "hdb_locl.h"
|
||||
@@ -60,7 +60,7 @@ main(int argc, char **argv)
|
||||
|
||||
if(help_flag)
|
||||
krb5_std_usage(0, args, num_args);
|
||||
|
||||
|
||||
if(version_flag){
|
||||
print_version(NULL);
|
||||
exit(0);
|
||||
|
Reference in New Issue
Block a user