remove trailing whitespace
This commit is contained in:
@@ -158,7 +158,7 @@ cpw_entry(struct passwd_options *opt, int argc, char **argv)
|
||||
"--random-key, --random-password, --password, --key\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
if (opt->key_string) {
|
||||
const char *error;
|
||||
|
||||
|
12
kadmin/get.c
12
kadmin/get.c
@@ -171,23 +171,23 @@ format_field(kadm5_principal_ent_t princ, unsigned int field,
|
||||
case KADM5_PRINC_EXPIRE_TIME:
|
||||
time_t2str(princ->princ_expire_time, buf, buf_len, !condensed);
|
||||
break;
|
||||
|
||||
|
||||
case KADM5_PW_EXPIRATION:
|
||||
time_t2str(princ->pw_expiration, buf, buf_len, !condensed);
|
||||
break;
|
||||
|
||||
|
||||
case KADM5_LAST_PWD_CHANGE:
|
||||
time_t2str(princ->last_pwd_change, buf, buf_len, !condensed);
|
||||
break;
|
||||
|
||||
|
||||
case KADM5_MAX_LIFE:
|
||||
deltat2str(princ->max_life, buf, buf_len);
|
||||
break;
|
||||
|
||||
|
||||
case KADM5_MAX_RLIFE:
|
||||
deltat2str(princ->max_renewable_life, buf, buf_len);
|
||||
break;
|
||||
|
||||
|
||||
case KADM5_MOD_TIME:
|
||||
time_t2str(princ->mod_date, buf, buf_len, !condensed);
|
||||
break;
|
||||
@@ -489,7 +489,7 @@ getit(struct get_options *opt, const char *name, int argc, char **argv)
|
||||
ret = setup_columns(&data, DEFAULT_COLUMNS_SHORT);
|
||||
} else
|
||||
ret = setup_columns(&data, opt->column_info_string);
|
||||
|
||||
|
||||
if(ret != 0) {
|
||||
if(data.table != NULL)
|
||||
rtbl_destroy(data.table);
|
||||
|
@@ -222,8 +222,8 @@ Possible attributes are:
|
||||
.Li disallow-forwardable ,
|
||||
.Li disallow-postdated
|
||||
.Pp
|
||||
Attributes may be negated with a "-", e.g.,
|
||||
.Pp
|
||||
Attributes may be negated with a "-", e.g.,
|
||||
.Pp
|
||||
kadmin -l modify -a -disallow-proxiable user
|
||||
.Ed
|
||||
.Pp
|
||||
|
@@ -63,15 +63,15 @@ static struct getargs args[] = {
|
||||
"key-file", 'k', arg_string, &keyfile,
|
||||
"location of master key file", "file"
|
||||
},
|
||||
{
|
||||
{
|
||||
"realm", 'r', arg_string, &realm,
|
||||
"realm to use", "realm"
|
||||
},
|
||||
{
|
||||
{
|
||||
"admin-server", 'a', arg_string, &admin_server,
|
||||
"server to contact", "host"
|
||||
},
|
||||
{
|
||||
{
|
||||
"server-port", 's', arg_integer, &server_port,
|
||||
"port to use", "port number"
|
||||
},
|
||||
@@ -211,7 +211,7 @@ main(int argc, char **argv)
|
||||
|
||||
kadm5_setup_passwd_quality_check (context,
|
||||
check_library, check_function);
|
||||
|
||||
|
||||
for (i = 0; i < policy_libraries.num_strings; i++) {
|
||||
ret = kadm5_add_passwd_quality_verifier(context,
|
||||
policy_libraries.strings[i]);
|
||||
@@ -221,7 +221,7 @@ main(int argc, char **argv)
|
||||
ret = kadm5_add_passwd_quality_verifier(context, NULL);
|
||||
if (ret)
|
||||
krb5_err(context, 1, ret, "kadm5_add_passwd_quality_verifier");
|
||||
|
||||
|
||||
ret = kadm5_s_init_with_password_ctx(context,
|
||||
KADM5_ADMIN_SERVICE,
|
||||
NULL,
|
||||
|
@@ -1,34 +1,34 @@
|
||||
.\" Copyright (c) 2002 - 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.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd December 8, 2004
|
||||
|
@@ -162,7 +162,7 @@ main(int argc, char **argv)
|
||||
|
||||
if(debug_flag) {
|
||||
int debug_port;
|
||||
|
||||
|
||||
if(port_str == NULL)
|
||||
debug_port = krb5_getportbyname (context, "kerberos-adm",
|
||||
"tcp", 749);
|
||||
|
@@ -205,7 +205,7 @@ parse_keys(hdb_entry *ent, char *str)
|
||||
if (key->salt == NULL)
|
||||
krb5_errx (context, 1, "malloc: out of memory");
|
||||
key->salt->type = type;
|
||||
|
||||
|
||||
if (p_len) {
|
||||
if(*p == '\"') {
|
||||
ret = krb5_data_copy(&key->salt->salt, p + 1, p_len - 2);
|
||||
@@ -411,7 +411,7 @@ doit(const char *filename, int mergep)
|
||||
}
|
||||
}
|
||||
p = skip_next(p);
|
||||
|
||||
|
||||
e.key = p;
|
||||
p = skip_next(p);
|
||||
|
||||
@@ -454,14 +454,14 @@ doit(const char *filename, int mergep)
|
||||
krb5_free_error_message(context, msg);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (parse_keys(&ent.entry, e.key)) {
|
||||
fprintf (stderr, "%s:%d:error parsing keys (%s)\n",
|
||||
filename, line, e.key);
|
||||
hdb_free_entry (context, &ent);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (parse_event(&ent.entry.created_by, e.created) == -1) {
|
||||
fprintf (stderr, "%s:%d:error parsing created event (%s)\n",
|
||||
filename, line, e.created);
|
||||
|
@@ -63,7 +63,7 @@ add_constrained_delegation(krb5_context contextp,
|
||||
HDB_extension ext;
|
||||
krb5_data buf;
|
||||
size_t size = 0;
|
||||
|
||||
|
||||
memset(&ext, 0, sizeof(ext));
|
||||
ext.mandatory = FALSE;
|
||||
ext.data.element = choice_HDB_extension_data_allowed_to_delegate_to;
|
||||
@@ -79,7 +79,7 @@ add_constrained_delegation(krb5_context contextp,
|
||||
calloc(strings->num_strings,
|
||||
sizeof(ext.data.u.allowed_to_delegate_to.val[0]));
|
||||
ext.data.u.allowed_to_delegate_to.len = strings->num_strings;
|
||||
|
||||
|
||||
for (i = 0; i < strings->num_strings; i++) {
|
||||
ret = krb5_parse_name(contextp, strings->strings[i], &p);
|
||||
if (ret)
|
||||
@@ -126,7 +126,7 @@ add_aliases(krb5_context contextp, kadm5_principal_ent_rec *princ,
|
||||
calloc(strings->num_strings,
|
||||
sizeof(ext.data.u.aliases.aliases.val[0]));
|
||||
ext.data.u.aliases.aliases.len = strings->num_strings;
|
||||
|
||||
|
||||
for (i = 0; i < strings->num_strings; i++) {
|
||||
ret = krb5_parse_name(contextp, strings->strings[i], &p);
|
||||
ret = copy_Principal(p, &ext.data.u.aliases.aliases.val[i]);
|
||||
@@ -168,7 +168,7 @@ add_pkinit_acl(krb5_context contextp, kadm5_principal_ent_rec *princ,
|
||||
calloc(strings->num_strings,
|
||||
sizeof(ext.data.u.pkinit_acl.val[0]));
|
||||
ext.data.u.pkinit_acl.len = strings->num_strings;
|
||||
|
||||
|
||||
for (i = 0; i < strings->num_strings; i++) {
|
||||
ext.data.u.pkinit_acl.val[i].subject = estrdup(strings->strings[i]);
|
||||
}
|
||||
|
64
kadmin/rpc.c
64
kadmin/rpc.c
@@ -109,47 +109,47 @@ parse_name(const unsigned char *p, size_t len,
|
||||
const gss_OID oid, char **name)
|
||||
{
|
||||
size_t l;
|
||||
|
||||
|
||||
if (len < 4)
|
||||
return 1;
|
||||
|
||||
|
||||
/* TOK_ID */
|
||||
if (memcmp(p, "\x04\x01", 2) != 0)
|
||||
return 1;
|
||||
len -= 2;
|
||||
p += 2;
|
||||
|
||||
|
||||
/* MECH_LEN */
|
||||
l = (p[0] << 8) | p[1];
|
||||
len -= 2;
|
||||
p += 2;
|
||||
if (l < 2 || len < l)
|
||||
return 1;
|
||||
|
||||
|
||||
/* oid wrapping */
|
||||
if (p[0] != 6 || p[1] != l - 2)
|
||||
return 1;
|
||||
p += 2;
|
||||
l -= 2;
|
||||
len -= 2;
|
||||
|
||||
|
||||
/* MECH */
|
||||
if (l != oid->length || memcmp(p, oid->elements, oid->length) != 0)
|
||||
return 1;
|
||||
len -= l;
|
||||
p += l;
|
||||
|
||||
|
||||
/* MECHNAME_LEN */
|
||||
if (len < 4)
|
||||
return 1;
|
||||
l = p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3];
|
||||
len -= 4;
|
||||
p += 4;
|
||||
|
||||
|
||||
/* MECH NAME */
|
||||
if (len != l)
|
||||
return 1;
|
||||
|
||||
|
||||
*name = malloc(l + 1);
|
||||
INSIST(*name != NULL);
|
||||
memcpy(*name, p, l);
|
||||
@@ -184,7 +184,7 @@ gss_error(krb5_context contextp,
|
||||
}
|
||||
|
||||
static void
|
||||
gss_print_errors (krb5_context contextp,
|
||||
gss_print_errors (krb5_context contextp,
|
||||
OM_uint32 maj_stat, OM_uint32 min_stat)
|
||||
{
|
||||
gss_error(contextp, GSS_C_NO_OID, GSS_C_GSS_CODE, maj_stat);
|
||||
@@ -202,13 +202,13 @@ read_data(krb5_storage *sp, krb5_storage *msg, size_t len)
|
||||
|
||||
if (tlen > sizeof(buf))
|
||||
tlen = sizeof(buf);
|
||||
|
||||
|
||||
slen = krb5_storage_read(sp, buf, tlen);
|
||||
INSIST((size_t)slen == tlen);
|
||||
|
||||
|
||||
slen = krb5_storage_write(msg, buf, tlen);
|
||||
INSIST((size_t)slen == tlen);
|
||||
|
||||
|
||||
len -= tlen;
|
||||
}
|
||||
return 0;
|
||||
@@ -226,7 +226,7 @@ collect_framents(krb5_storage *sp, krb5_storage *msg)
|
||||
ret = krb5_ret_uint32(sp, &len);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
last_fragment = (len & LAST_FRAGMENT);
|
||||
len &= ~LAST_FRAGMENT;
|
||||
|
||||
@@ -341,7 +341,7 @@ store_string_xdr(krb5_storage *sp, const char *str)
|
||||
c.length = strlen(str) + 1;
|
||||
} else
|
||||
krb5_data_zero(&c);
|
||||
|
||||
|
||||
return store_data_xdr(sp, c);
|
||||
}
|
||||
|
||||
@@ -512,7 +512,7 @@ ret_principal_ent(krb5_context contextp,
|
||||
} else {
|
||||
INSIST(ent->n_tl_data == 0);
|
||||
}
|
||||
|
||||
|
||||
CHECK(krb5_ret_uint32(sp, &num));
|
||||
INSIST(num == (uint32_t)ent->n_key_data);
|
||||
|
||||
@@ -637,7 +637,7 @@ proc_get_principal(kadm5_server_context *contextp,
|
||||
|
||||
static void
|
||||
proc_chrand_principal_v2(kadm5_server_context *contextp,
|
||||
krb5_storage *in,
|
||||
krb5_storage *in,
|
||||
krb5_storage *out)
|
||||
{
|
||||
krb5_error_code ret;
|
||||
@@ -741,7 +741,7 @@ struct gctx {
|
||||
};
|
||||
|
||||
static int
|
||||
process_stream(krb5_context contextp,
|
||||
process_stream(krb5_context contextp,
|
||||
unsigned char *buf, size_t ilen,
|
||||
krb5_storage *sp)
|
||||
{
|
||||
@@ -798,11 +798,11 @@ process_stream(krb5_context contextp,
|
||||
buf = tmp;
|
||||
}
|
||||
INSIST(ilen >= 4);
|
||||
|
||||
|
||||
_krb5_get_int(buf, &len, 4);
|
||||
last_fragment = (len & LAST_FRAGMENT) != 0;
|
||||
len &= ~LAST_FRAGMENT;
|
||||
|
||||
|
||||
ilen -= 4;
|
||||
buf += 4;
|
||||
|
||||
@@ -820,7 +820,7 @@ process_stream(krb5_context contextp,
|
||||
}
|
||||
|
||||
CHECK(read_data(sp, msg, len));
|
||||
|
||||
|
||||
if (!last_fragment) {
|
||||
ret = collect_framents(sp, msg);
|
||||
if (ret == HEIM_ERR_EOF)
|
||||
@@ -880,7 +880,7 @@ process_stream(krb5_context contextp,
|
||||
INSIST(gctx.done);
|
||||
|
||||
INSIST(krb5_data_cmp(&gcred.handle, &gctx.handle) == 0);
|
||||
|
||||
|
||||
CHECK(ret_data_xdr(msg, &data));
|
||||
|
||||
gin.value = data.data;
|
||||
@@ -904,7 +904,7 @@ process_stream(krb5_context contextp,
|
||||
INSIST(seq > gctx.seq_num);
|
||||
gctx.seq_num = seq;
|
||||
|
||||
/*
|
||||
/*
|
||||
* If contextp is setup, priv data have the seq_num stored
|
||||
* first in the block, so add it here before users data is
|
||||
* added.
|
||||
@@ -914,7 +914,7 @@ process_stream(krb5_context contextp,
|
||||
if (chdr.proc >= sizeof(procs)/sizeof(procs[0])) {
|
||||
krb5_warnx(contextp, "proc number out of array");
|
||||
} else if (procs[chdr.proc].func == NULL) {
|
||||
krb5_warnx(contextp, "proc '%s' never implemented",
|
||||
krb5_warnx(contextp, "proc '%s' never implemented",
|
||||
procs[chdr.proc].name);
|
||||
} else {
|
||||
krb5_warnx(contextp, "proc %s", procs[chdr.proc].name);
|
||||
@@ -946,7 +946,7 @@ process_stream(krb5_context contextp,
|
||||
gout.length = 0;
|
||||
|
||||
maj_stat = gss_accept_sec_context(&min_stat,
|
||||
&gctx.ctx,
|
||||
&gctx.ctx,
|
||||
GSS_C_NO_CREDENTIAL,
|
||||
&gin,
|
||||
GSS_C_NO_CHANNEL_BINDINGS,
|
||||
@@ -966,13 +966,13 @@ process_stream(krb5_context contextp,
|
||||
char *client;
|
||||
|
||||
gctx.done = 1;
|
||||
|
||||
|
||||
memset(&realm_params, 0, sizeof(realm_params));
|
||||
|
||||
maj_stat = gss_export_name(&min_stat, src_name, &bufp);
|
||||
INSIST(maj_stat == GSS_S_COMPLETE);
|
||||
|
||||
CHECK(parse_name(bufp.value, bufp.length,
|
||||
CHECK(parse_name(bufp.value, bufp.length,
|
||||
GSS_KRB5_MECHANISM, &client));
|
||||
|
||||
gss_release_buffer(&min_stat, &bufp);
|
||||
@@ -992,7 +992,7 @@ process_stream(krb5_context contextp,
|
||||
INSIST(gctx.ctx != GSS_C_NO_CONTEXT);
|
||||
|
||||
CHECK(krb5_store_uint32(dreply, 0));
|
||||
CHECK(store_gss_init_res(dreply, gctx.handle,
|
||||
CHECK(store_gss_init_res(dreply, gctx.handle,
|
||||
maj_stat, min_stat, 1, &gout));
|
||||
if (gout.value)
|
||||
gss_release_buffer(&min_stat, &gout);
|
||||
@@ -1004,7 +1004,7 @@ process_stream(krb5_context contextp,
|
||||
case RPG_DESTROY:
|
||||
krb5_errx(contextp, 1, "client destroyed gss contextp");
|
||||
default:
|
||||
krb5_errx(contextp, 1, "client sent unknown gsscode %d",
|
||||
krb5_errx(contextp, 1, "client sent unknown gsscode %d",
|
||||
(int)gcred.proc);
|
||||
}
|
||||
|
||||
@@ -1061,16 +1061,16 @@ process_stream(krb5_context contextp,
|
||||
|
||||
gin.value = data.data;
|
||||
gin.length = data.length;
|
||||
|
||||
|
||||
maj_stat = gss_wrap(&min_stat, gctx.ctx, 1, 0,
|
||||
&gin, &conf_state, &gout);
|
||||
INSIST(maj_stat == GSS_S_COMPLETE);
|
||||
INSIST(conf_state != 0);
|
||||
krb5_data_free(&data);
|
||||
|
||||
|
||||
data.data = gout.value;
|
||||
data.length = gout.length;
|
||||
|
||||
|
||||
store_data_xdr(reply, data);
|
||||
gss_release_buffer(&min_stat, &gout);
|
||||
}
|
||||
@@ -1099,7 +1099,7 @@ handle_mit(krb5_context contextp, void *buf, size_t len, krb5_socket_t sock)
|
||||
|
||||
sp = krb5_storage_from_fd(sock);
|
||||
INSIST(sp != NULL);
|
||||
|
||||
|
||||
process_stream(contextp, buf, len, sp);
|
||||
|
||||
return 0;
|
||||
|
@@ -115,7 +115,7 @@ stash(struct stash_options *opt, int argc, char **argv)
|
||||
ret = ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
if(unlink(new) < 0 && errno != ENOENT) {
|
||||
ret = errno;
|
||||
goto out;
|
||||
|
Reference in New Issue
Block a user