remove trailing whitespace

This commit is contained in:
Love Hornquist Astrand
2011-05-21 11:57:31 -07:00
parent 25e86d6f4d
commit 0879b9831a
539 changed files with 6825 additions and 6825 deletions

View File

@@ -104,7 +104,7 @@ kt_add(struct add_options *opt, int argc, char **argv)
if (opt->hex_flag) { if (opt->hex_flag) {
size_t len; size_t len;
void *data; void *data;
len = (strlen(opt->password_string) + 1) / 2; len = (strlen(opt->password_string) + 1) / 2;
data = malloc(len); data = malloc(len);

View File

@@ -73,7 +73,7 @@ change_entry (krb5_keytab keytab,
free(conf.realm); free(conf.realm);
krb5_set_error_message(context, ENOMEM, "malloc failed"); krb5_set_error_message(context, ENOMEM, "malloc failed");
return ENOMEM; return ENOMEM;
} }
conf.mask |= KADM5_CONFIG_ADMIN_SERVER; conf.mask |= KADM5_CONFIG_ADMIN_SERVER;
} }

View File

@@ -157,7 +157,7 @@ kt_get(struct get_options *opt, int argc, char **argv)
if(kadm_handle == NULL) if(kadm_handle == NULL)
break; break;
} }
ret = kadm5_create_principal(kadm_handle, &princ, mask, "x"); ret = kadm5_create_principal(kadm_handle, &princ, mask, "x");
if(ret == 0) if(ret == 0)
created = 1; created = 1;
@@ -174,7 +174,7 @@ kt_get(struct get_options *opt, int argc, char **argv)
failed++; failed++;
continue; continue;
} }
ret = kadm5_get_principal(kadm_handle, princ_ent, &princ, ret = kadm5_get_principal(kadm_handle, princ_ent, &princ,
KADM5_PRINCIPAL | KADM5_KVNO | KADM5_ATTRIBUTES); KADM5_PRINCIPAL | KADM5_KVNO | KADM5_ATTRIBUTES);
if (ret) { if (ret) {
@@ -226,7 +226,7 @@ kt_get(struct get_options *opt, int argc, char **argv)
} }
krb5_free_keyblock_contents(context, &keys[j]); krb5_free_keyblock_contents(context, &keys[j]);
} }
kadm5_free_principal_ent(kadm_handle, &princ); kadm5_free_principal_ent(kadm_handle, &princ);
krb5_free_principal(context, princ_ent); krb5_free_principal(context, princ_ent);
} }

View File

@@ -1,34 +1,34 @@
.\" Copyright (c) 1997-2004 Kungliga Tekniska Högskolan .\" Copyright (c) 1997-2004 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden). .\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions
.\" are met: .\" are met:
.\" .\"
.\" 1. Redistributions of source code must retain the above copyright .\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer. .\" notice, this list of conditions and the following disclaimer.
.\" .\"
.\" 2. Redistributions in binary form must reproduce the above copyright .\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the .\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution. .\" documentation and/or other materials provided with the distribution.
.\" .\"
.\" 3. Neither the name of the Institute nor the names of its contributors .\" 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 .\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission. .\" 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$ .\" $Id$
.\" .\"
.Dd April 14, 2005 .Dd April 14, 2005

View File

@@ -52,7 +52,7 @@ static struct getargs args[] = {
NULL NULL
}, },
{ {
"help", "help",
'h', 'h',
arg_flag, arg_flag,
&help_flag, &help_flag,
@@ -60,7 +60,7 @@ static struct getargs args[] = {
NULL NULL
}, },
{ {
"keytab", "keytab",
'k', 'k',
arg_string, arg_string,
&keytab_string, &keytab_string,
@@ -101,7 +101,7 @@ ktutil_open_keytab(void)
} }
if (verbose_flag) if (verbose_flag)
fprintf (stderr, "Using keytab %s\n", keytab_string); fprintf (stderr, "Using keytab %s\n", keytab_string);
return keytab; return keytab;
} }

View File

@@ -76,7 +76,7 @@ do_list(struct list_options *opt, const char *keytab_str)
} }
printf ("%s:\n\n", keytab_str); printf ("%s:\n\n", keytab_str);
table = rtbl_create(); table = rtbl_create();
rtbl_add_column_by_id(table, 0, "Vno", RTBL_ALIGN_RIGHT); rtbl_add_column_by_id(table, 0, "Vno", RTBL_ALIGN_RIGHT);
rtbl_add_column_by_id(table, 1, "Type", 0); rtbl_add_column_by_id(table, 1, "Type", 0);
@@ -129,12 +129,12 @@ do_list(struct list_options *opt, const char *keytab_str)
if (entry.aliases) { if (entry.aliases) {
unsigned int i; unsigned int i;
struct rk_strpool *p = NULL; struct rk_strpool *p = NULL;
for (i = 0; i< entry.aliases->len; i++) { for (i = 0; i< entry.aliases->len; i++) {
krb5_unparse_name_fixed(context, entry.principal, buf, sizeof(buf)); krb5_unparse_name_fixed(context, entry.principal, buf, sizeof(buf));
rk_strpoolprintf(p, "%s%s", buf, rk_strpoolprintf(p, "%s%s", buf,
i + 1 < entry.aliases->len ? ", " : ""); i + 1 < entry.aliases->len ? ", " : "");
} }
rtbl_add_column_entry_by_id(table, 5, rk_strpoolcollect(p)); rtbl_add_column_entry_by_id(table, 5, rk_strpoolcollect(p));
} }

View File

@@ -1,34 +1,34 @@
.\" Copyright (c) 2002 - 2007 Kungliga Tekniska Högskolan .\" Copyright (c) 2002 - 2007 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden). .\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions
.\" are met: .\" are met:
.\" .\"
.\" 1. Redistributions of source code must retain the above copyright .\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer. .\" notice, this list of conditions and the following disclaimer.
.\" .\"
.\" 2. Redistributions in binary form must reproduce the above copyright .\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the .\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution. .\" documentation and/or other materials provided with the distribution.
.\" .\"
.\" 3. Neither the name of the Institute nor the names of its contributors .\" 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 .\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission. .\" 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$ .\" $Id$
.\" .\"
.Dd November 26, 2002 .Dd November 26, 2002
@@ -70,7 +70,7 @@ obtains AFS tokens for a number of cells. What cells to get tokens for
can either be specified as an explicit list, as file paths to get can either be specified as an explicit list, as file paths to get
tokens for, or be left unspecified, in which case tokens for, or be left unspecified, in which case
.Nm .Nm
will use whatever magic will use whatever magic
.Xr krb_afslog 3 .Xr krb_afslog 3
decides upon. decides upon.
.Pp .Pp
@@ -131,22 +131,22 @@ Instead of using
and and
.Fl p , .Fl p ,
you may also pass a list of cells and file paths after any other you may also pass a list of cells and file paths after any other
options. These arguments are considered files if they are either options. These arguments are considered files if they are either
the strings the strings
.Do . Dc .Do . Dc
or or
.Dq .. .Dq ..
or they contain a slash, or if there exists a file by that name. or they contain a slash, or if there exists a file by that name.
.Sh EXAMPLES .Sh EXAMPLES
Assuming that there is no file called Assuming that there is no file called
.Dq openafs.org .Dq openafs.org
in the current directory, and that in the current directory, and that
.Pa /afs/openafs.org .Pa /afs/openafs.org
points to that cell, the follwing should be identical: points to that cell, the follwing should be identical:
.Bd -literal -offset indent .Bd -literal -offset indent
$ afslog -c openafs.org $ afslog -c openafs.org
$ afslog openafs.org $ afslog openafs.org
$ afslog /afs/openafs.org/some/file $ afslog /afs/openafs.org/some/file
.Ed .Ed
.Sh SEE ALSO .Sh SEE ALSO
.Xr krb_afslog 3 .Xr krb_afslog 3

View File

@@ -1,34 +1,34 @@
.\" Copyright (c) 2005 Kungliga Tekniska Högskolan .\" Copyright (c) 2005 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden). .\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions
.\" are met: .\" are met:
.\" .\"
.\" 1. Redistributions of source code must retain the above copyright .\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer. .\" notice, this list of conditions and the following disclaimer.
.\" .\"
.\" 2. Redistributions in binary form must reproduce the above copyright .\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the .\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution. .\" documentation and/or other materials provided with the distribution.
.\" .\"
.\" 3. Neither the name of the Institute nor the names of its contributors .\" 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 .\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission. .\" 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$ .\" $Id$
.\" .\"
.Dd February 12, 2005 .Dd February 12, 2005

View File

@@ -601,7 +601,7 @@ int k5dcecreate(luid, luser, pname, krbtgt)
"Error while adding credentials for %s because %s\n", "Error while adding credentials for %s because %s\n",
username, err_string); username, err_string);
goto abort; goto abort;
} }
DEEDEBUG("validating and certifying\n"); DEEDEBUG("validating and certifying\n");
/* /*
* Now "validate" and certify the identity, * Now "validate" and certify the identity,

View File

@@ -987,7 +987,7 @@ setprompt(int argc, char **argv)
void void
setglob(int argc, char **argv) setglob(int argc, char **argv)
{ {
doglob = !doglob; doglob = !doglob;
printf("Globbing %s.\n", onoff(doglob)); printf("Globbing %s.\n", onoff(doglob));
code = doglob; code = doglob;

View File

@@ -196,7 +196,7 @@ struct cmd cmdtab[] = {
#if defined(KRB5) #if defined(KRB5)
{ "afslog", afsloghelp, 0, 1, 0, afslog }, { "afslog", afsloghelp, 0, 1, 0, afslog },
#endif #endif
{ 0 }, { 0 },
}; };

View File

@@ -89,7 +89,7 @@ hookup (const char *host, int port)
strlcpy (hostnamebuf, a->ai_canonname, sizeof(hostnamebuf)); strlcpy (hostnamebuf, a->ai_canonname, sizeof(hostnamebuf));
memcpy (hisctladdr, a->ai_addr, a->ai_addrlen); memcpy (hisctladdr, a->ai_addr, a->ai_addrlen);
error = connect (s, a->ai_addr, a->ai_addrlen); error = connect (s, a->ai_addr, a->ai_addrlen);
if (error < 0) { if (error < 0) {
char addrstr[256]; char addrstr[256];
@@ -98,7 +98,7 @@ hookup (const char *host, int port)
addrstr, sizeof(addrstr), addrstr, sizeof(addrstr),
NULL, 0, NI_NUMERICHOST) != 0) NULL, 0, NI_NUMERICHOST) != 0)
strlcpy (addrstr, "unknown address", sizeof(addrstr)); strlcpy (addrstr, "unknown address", sizeof(addrstr));
warn ("connect %s", addrstr); warn ("connect %s", addrstr);
close (s); close (s);
s = -1; s = -1;
@@ -622,7 +622,7 @@ copy_stream (FILE * from, FILE * to)
goto try_read; goto try_read;
break; break;
} }
res = sec_write (fileno (to), chunk, len); res = sec_write (fileno (to), chunk, len);
if (msync (chunk, len, MS_ASYNC)) if (msync (chunk, len, MS_ASYNC))
warn ("msync"); warn ("msync");

View File

@@ -158,7 +158,7 @@ sockaddr_to_gss_address (struct sockaddr *sa,
} }
default : default :
errx (1, "unknown address family %d", sa->sa_family); errx (1, "unknown address family %d", sa->sa_family);
} }
} }
@@ -187,7 +187,7 @@ gss_adat(void *app_data, void *buf, size_t len)
sockaddr_to_gss_address (ctrl_addr, sockaddr_to_gss_address (ctrl_addr,
&bindings->acceptor_addrtype, &bindings->acceptor_addrtype,
&bindings->acceptor_address); &bindings->acceptor_address);
bindings->application_data.length = 0; bindings->application_data.length = 0;
bindings->application_data.value = NULL; bindings->application_data.value = NULL;
} else } else
@@ -302,7 +302,7 @@ import_name(const char *kname, const char *host, gss_name_t *target_name)
OM_uint32 new_stat; OM_uint32 new_stat;
OM_uint32 msg_ctx = 0; OM_uint32 msg_ctx = 0;
gss_buffer_desc status_string; gss_buffer_desc status_string;
gss_display_status(&new_stat, gss_display_status(&new_stat,
min_stat, min_stat,
GSS_C_MECH_CODE, GSS_C_MECH_CODE,
@@ -337,7 +337,7 @@ gss_auth(void *app_data, char *host)
OM_uint32 mech_flags = GSS_C_MUTUAL_FLAG | GSS_C_SEQUENCE_FLAG; OM_uint32 mech_flags = GSS_C_MUTUAL_FLAG | GSS_C_SEQUENCE_FLAG;
const char *knames[] = { "ftp", "host", NULL }, **kname = knames; const char *knames[] = { "ftp", "host", NULL }, **kname = knames;
if(import_name(*kname++, host, &target_name)) if(import_name(*kname++, host, &target_name))
return AUTH_ERROR; return AUTH_ERROR;
@@ -349,14 +349,14 @@ gss_auth(void *app_data, char *host)
bindings = malloc(sizeof(*bindings)); bindings = malloc(sizeof(*bindings));
if (bindings == NULL) if (bindings == NULL)
errx(1, "out of memory"); errx(1, "out of memory");
sockaddr_to_gss_address (myctladdr, sockaddr_to_gss_address (myctladdr,
&bindings->initiator_addrtype, &bindings->initiator_addrtype,
&bindings->initiator_address); &bindings->initiator_address);
sockaddr_to_gss_address (hisctladdr, sockaddr_to_gss_address (hisctladdr,
&bindings->acceptor_addrtype, &bindings->acceptor_addrtype,
&bindings->acceptor_address); &bindings->acceptor_address);
bindings->application_data.length = 0; bindings->application_data.length = 0;
bindings->application_data.value = NULL; bindings->application_data.value = NULL;
} else } else
@@ -397,7 +397,7 @@ gss_auth(void *app_data, char *host)
} }
continue; continue;
} }
if (bindings != GSS_C_NO_CHANNEL_BINDINGS) if (bindings != GSS_C_NO_CHANNEL_BINDINGS)
free(bindings); free(bindings);
@@ -490,7 +490,7 @@ gss_auth(void *app_data, char *host)
gss_release_name(&min_stat, &targ_name); gss_release_name(&min_stat, &targ_name);
} else } else
printf("Failed to get gss name of peer.\n"); printf("Failed to get gss name of peer.\n");
} }
return AUTH_OK; return AUTH_OK;

View File

@@ -142,7 +142,7 @@ main(int argc, char **argv)
} }
if (argc > 0) { if (argc > 0) {
char *xargv[5]; char *xargv[5];
if (setjmp(toplevel)) if (setjmp(toplevel))
exit(0); exit(0);
signal(SIGINT, intr); signal(SIGINT, intr);
@@ -217,7 +217,7 @@ tail(filename)
char *filename; char *filename;
{ {
char *s; char *s;
while (*filename) { while (*filename) {
s = strrchr(filename, '/'); s = strrchr(filename, '/');
if (s == NULL) if (s == NULL)

View File

@@ -818,7 +818,7 @@ sec_login(char *host)
return -1; return -1;
} }
app_data = tmp; app_data = tmp;
if((*m)->init && (*(*m)->init)(app_data) != 0) { if((*m)->init && (*(*m)->init)(app_data) != 0) {
printf("Skipping %s...\n", (*m)->name); printf("Skipping %s...\n", (*m)->name);
continue; continue;
@@ -840,7 +840,7 @@ sec_login(char *host)
} }
ret = (*(*m)->auth)(app_data, host); ret = (*(*m)->auth)(app_data, host);
if(ret == AUTH_CONTINUE) if(ret == AUTH_CONTINUE)
continue; continue;
else if(ret != AUTH_OK){ else if(ret != AUTH_OK){

View File

@@ -161,7 +161,7 @@ cmd
socket_get_address(his_addr), socket_get_address(his_addr),
socket_addr_size(his_addr)) != 0)) { socket_addr_size(his_addr)) != 0)) {
usedefault = 1; usedefault = 1;
reply(500, "Illegal PORT range rejected."); reply(500, "Illegal PORT range rejected.");
} else { } else {
usedefault = 0; usedefault = 0;
if (pdata >= 0) { if (pdata >= 0) {
@@ -1013,7 +1013,7 @@ struct tab sitetab[] = {
{ "FIND", LOCATE, STR1, 1, "<sp> globexpr" }, { "FIND", LOCATE, STR1, 1, "<sp> globexpr" },
{ "URL", URL, ARGS, 1, "?" }, { "URL", URL, ARGS, 1, "?" },
{ NULL, 0, 0, 0, 0 } { NULL, 0, 0, 0, 0 }
}; };

View File

@@ -191,7 +191,7 @@ parse_auth_level(char *str)
else else
warnx("bad value for -a: `%s'", p); warnx("bad value for -a: `%s'", p);
} }
return ret; return ret;
} }
/* /*
@@ -277,7 +277,7 @@ main(int argc, char **argv)
if(help_flag) if(help_flag)
usage(0); usage(0);
if(version_flag) { if(version_flag) {
print_version(NULL); print_version(NULL);
exit(0); exit(0);
@@ -288,7 +288,7 @@ main(int argc, char **argv)
{ {
char *p; char *p;
long val = 0; long val = 0;
if(guest_umask_string) { if(guest_umask_string) {
val = strtol(guest_umask_string, &p, 8); val = strtol(guest_umask_string, &p, 8);
if (*p != '\0' || val < 0) if (*p != '\0' || val < 0)
@@ -319,7 +319,7 @@ main(int argc, char **argv)
else else
warnx("bad value for -p"); warnx("bad value for -p");
} }
if (maxtimeout < ftpd_timeout) if (maxtimeout < ftpd_timeout)
maxtimeout = ftpd_timeout; maxtimeout = ftpd_timeout;
@@ -401,7 +401,7 @@ main(int argc, char **argv)
show_file(_PATH_FTPWELCOME, 220); show_file(_PATH_FTPWELCOME, 220);
/* reply(220,) must follow */ /* reply(220,) must follow */
gethostname(hostname, sizeof(hostname)); gethostname(hostname, sizeof(hostname));
reply(220, "%s FTP server (%s" reply(220, "%s FTP server (%s"
#ifdef KRB5 #ifdef KRB5
"+%s" "+%s"
@@ -947,7 +947,7 @@ pass(char *passwd)
} }
if(!do_login(230, passwd)) if(!do_login(230, passwd))
return; return;
/* Forget all about it... */ /* Forget all about it... */
end_login(); end_login();
} }
@@ -983,7 +983,7 @@ retrieve(const char *cmd, char *name)
for(p = cmds; p->ext; p++){ for(p = cmds; p->ext; p++){
char *tail = name + strlen(name) - strlen(p->ext); char *tail = name + strlen(name) - strlen(p->ext);
char c = *tail; char c = *tail;
if(strcmp(tail, p->ext) == 0 && if(strcmp(tail, p->ext) == 0 &&
(*tail = 0) == 0 && (*tail = 0) == 0 &&
access(name, R_OK) == 0){ access(name, R_OK) == 0){
@@ -1007,7 +1007,7 @@ retrieve(const char *cmd, char *name)
free(ext); free(ext);
} }
} }
} }
if(p->ext){ if(p->ext){
fin = ftpd_popen(line, "r", 0, 0); fin = ftpd_popen(line, "r", 0, 0);
@@ -1279,7 +1279,7 @@ dataconn(const char *name, off_t size, const char *mode)
#if defined(IP_TOS) && defined(HAVE_SETSOCKOPT) #if defined(IP_TOS) && defined(HAVE_SETSOCKOPT)
{ {
int tos = IPTOS_THROUGHPUT; int tos = IPTOS_THROUGHPUT;
setsockopt(s, IPPROTO_IP, IP_TOS, (void *)&tos, setsockopt(s, IPPROTO_IP, IP_TOS, (void *)&tos,
sizeof(tos)); sizeof(tos));
} }
@@ -1373,7 +1373,7 @@ send_data(FILE *instr, FILE *outstr)
goto data_err; goto data_err;
reply(226, "Transfer complete."); reply(226, "Transfer complete.");
return; return;
case TYPE_I: case TYPE_I:
case TYPE_L: case TYPE_L:
#if 0 /* XXX handle urg flag */ #if 0 /* XXX handle urg flag */
@@ -1557,13 +1557,13 @@ receive_data(FILE *instr, FILE *outstr)
urgflag = 0; urgflag = 0;
return (-1); return (-1);
} }
data_err: data_err:
transflag = 0; transflag = 0;
urgflag = 0; urgflag = 0;
perror_reply(426, "Data Connection"); perror_reply(426, "Data Connection");
return (-1); return (-1);
file_err: file_err:
transflag = 0; transflag = 0;
urgflag = 0; urgflag = 0;
@@ -1887,7 +1887,7 @@ dologout(int status)
exit(status); exit(status);
#else #else
_exit(status); _exit(status);
#endif #endif
} }
void abor(void) void abor(void)
@@ -2097,7 +2097,7 @@ eprt(char *str)
case 2 : case 2 :
data_dest->sa_family = AF_INET6; data_dest->sa_family = AF_INET6;
break; break;
#endif #endif
case 1 : case 1 :
data_dest->sa_family = AF_INET; data_dest->sa_family = AF_INET;
break; break;
@@ -2338,7 +2338,7 @@ out:
transflag = 0; transflag = 0;
if (dout != NULL){ if (dout != NULL){
sec_write(fileno(dout), buf, 0); /* XXX flush */ sec_write(fileno(dout), buf, 0); /* XXX flush */
fclose(dout); fclose(dout);
} }
data = -1; data = -1;

View File

@@ -101,7 +101,7 @@ print_tickets (krb5_context context,
&cursor, &cursor,
&cred)) == 0) { &cred)) == 0) {
if (print_cred(context, &cred)) if (print_cred(context, &cred))
return 500; return 500;
krb5_free_cred_contents (context, &cred); krb5_free_cred_contents (context, &cred);
} }
if (ret != KRB5_CC_END) { if (ret != KRB5_CC_END) {
@@ -137,7 +137,7 @@ klist5(void)
else else
ret = krb5_cc_default (context, &ccache); ret = krb5_cc_default (context, &ccache);
if (ret) { if (ret) {
lreply(500, "krb5_cc_default: %d", ret); lreply(500, "krb5_cc_default: %d", ret);
return 500; return 500;
} }
@@ -155,7 +155,7 @@ klist5(void)
ret = krb5_cc_close (context, ccache); ret = krb5_cc_close (context, ccache);
if (ret) { if (ret) {
lreply(500, "krb5_cc_close: %d", ret); lreply(500, "krb5_cc_close: %d", ret);
exit_status = 500; exit_status = 500;
} }

View File

@@ -179,10 +179,10 @@ ftpd_logwtmp_wtmp(char *line, char *name, char *host)
if(fd >= 0) { if(fd >= 0) {
#ifdef WTMP_FILE #ifdef WTMP_FILE
write(fd, &ut, sizeof(struct utmp)); /* XXX */ write(fd, &ut, sizeof(struct utmp)); /* XXX */
#endif #endif
#ifdef WTMPX_FILE #ifdef WTMPX_FILE
write(fdx, &utx, sizeof(struct utmpx)); write(fdx, &utx, sizeof(struct utmpx));
#endif #endif
} }
} }

View File

@@ -425,19 +425,19 @@ lstat_file (const char *file, struct stat *sb)
static ino_t ino_counter = 0, ino_last = 0; static ino_t ino_counter = 0, ino_last = 0;
int ret; int ret;
const int maxsize = 2048; const int maxsize = 2048;
path_bkp = strdup (file); path_bkp = strdup (file);
if (path_bkp == NULL) if (path_bkp == NULL)
return -1; return -1;
a_params.out = malloc (maxsize); a_params.out = malloc (maxsize);
if (a_params.out == NULL) { if (a_params.out == NULL) {
free (path_bkp); free (path_bkp);
return -1; return -1;
} }
/* If path contains more than the filename alone - split it */ /* If path contains more than the filename alone - split it */
last = strrchr (path_bkp, '/'); last = strrchr (path_bkp, '/');
if (last != NULL) { if (last != NULL) {
if(last[1] == '\0') if(last[1] == '\0')
@@ -457,10 +457,10 @@ lstat_file (const char *file, struct stat *sb)
dir = "."; dir = ".";
a_params.in = path_bkp; a_params.in = path_bkp;
} }
a_params.in_size = strlen (a_params.in) + 1; a_params.in_size = strlen (a_params.in) + 1;
a_params.out_size = maxsize; a_params.out_size = maxsize;
ret = k_pioctl (dir, VIOC_AFS_STAT_MT_PT, &a_params, 0); ret = k_pioctl (dir, VIOC_AFS_STAT_MT_PT, &a_params, 0);
free (a_params.out); free (a_params.out);
if (ret < 0) { if (ret < 0) {
@@ -602,7 +602,7 @@ list_files(FILE *out, const char **files, int n_files, int flags)
max_inode = find_log10(max_inode); max_inode = find_log10(max_inode);
max_bsize = find_log10(max_bsize); max_bsize = find_log10(max_bsize);
max_n_link = find_log10(max_n_link); max_n_link = find_log10(max_n_link);
if(n_print > 0) if(n_print > 0)
sec_fprintf2(out, "total %lu\r\n", (unsigned long)total_blocks); sec_fprintf2(out, "total %lu\r\n", (unsigned long)total_blocks);
if(flags & LS_SORT_REVERSE) if(flags & LS_SORT_REVERSE)

View File

@@ -196,8 +196,8 @@ ftpd_popen(char *program, char *type, int do_stderr, int no_glob)
close(pdes[0]); close(pdes[0]);
} }
pids[fileno(iop)] = pid; pids[fileno(iop)] = pid;
pfree: pfree:
for (argc = 1; gargv[argc] != NULL; argc++) for (argc = 1; gargv[argc] != NULL; argc++)
free(gargv[argc]); free(gargv[argc]);

View File

@@ -327,7 +327,7 @@ build_context(struct client *ipeer, struct client *apeer,
krb5_data_zero(&itoken); krb5_data_zero(&itoken);
while (!iDone || !aDone) { while (!iDone || !aDone) {
if (iDone) { if (iDone) {
warnx("iPeer already done, aPeer want extra rtt"); warnx("iPeer already done, aPeer want extra rtt");
val = GSMERR_ERROR; val = GSMERR_ERROR;
@@ -405,7 +405,7 @@ build_context(struct client *ipeer, struct client *apeer,
out: out:
return val; return val;
} }
static void static void
test_mic(struct client *c1, int32_t hc1, struct client *c2, int32_t hc2) test_mic(struct client *c1, int32_t hc1, struct client *c2, int32_t hc2)
{ {
@@ -540,17 +540,17 @@ test_token(struct client *c1, int32_t hc1, struct client *c2, int32_t hc2, int w
if (val) return val; if (val) return val;
val = test_wrap_ext(c2, hc2, c1, hc1, 1, 0); val = test_wrap_ext(c2, hc2, c1, hc1, 1, 0);
if (val) return val; if (val) return val;
val = test_wrap_ext(c1, hc1, c2, hc2, 1, 1); val = test_wrap_ext(c1, hc1, c2, hc2, 1, 1);
if (val) return val; if (val) return val;
val = test_wrap_ext(c2, hc2, c1, hc1, 1, 1); val = test_wrap_ext(c2, hc2, c1, hc1, 1, 1);
if (val) return val; if (val) return val;
val = test_wrap_ext(c1, hc1, c2, hc2, 0, 0); val = test_wrap_ext(c1, hc1, c2, hc2, 0, 0);
if (val) return val; if (val) return val;
val = test_wrap_ext(c2, hc2, c1, hc1, 0, 0); val = test_wrap_ext(c2, hc2, c1, hc1, 0, 0);
if (val) return val; if (val) return val;
val = test_wrap_ext(c1, hc1, c2, hc2, 0, 1); val = test_wrap_ext(c1, hc1, c2, hc2, 0, 1);
if (val) return val; if (val) return val;
val = test_wrap_ext(c2, hc2, c1, hc1, 0, 1); val = test_wrap_ext(c2, hc2, c1, hc1, 0, 1);
@@ -780,7 +780,7 @@ main(int argc, char **argv)
if (password == NULL) if (password == NULL)
errx(1, "password missing from %s", user); errx(1, "password missing from %s", user);
*password++ = 0; *password++ = 0;
if (slaves.num_strings == 0) if (slaves.num_strings == 0)
errx(1, "no principals"); errx(1, "no principals");
@@ -834,7 +834,7 @@ main(int argc, char **argv)
int32_t hCred, val, delegCred; int32_t hCred, val, delegCred;
int32_t clientC, serverC; int32_t clientC, serverC;
struct client *c = clients[i]; struct client *c = clients[i];
if (c->target_name == NULL) if (c->target_name == NULL)
continue; continue;
@@ -893,18 +893,18 @@ main(int argc, char **argv)
int32_t hCred, val, delegCred = 0; int32_t hCred, val, delegCred = 0;
int32_t clientC = 0, serverC = 0; int32_t clientC = 0, serverC = 0;
struct client *client, *server; struct client *client, *server;
p = list[i]; p = list[i];
client = get_client(p[0]); client = get_client(p[0]);
val = acquire_cred(client, user, password, 1, &hCred); val = acquire_cred(client, user, password, 1, &hCred);
if (val != GSMERR_OK) if (val != GSMERR_OK)
errx(1, "failed to acquire_cred: %d", (int)val); errx(1, "failed to acquire_cred: %d", (int)val);
for (j = 1; j < num_clients + 1; j++) { for (j = 1; j < num_clients + 1; j++) {
server = get_client(p[j % num_clients]); server = get_client(p[j % num_clients]);
if (server->target_name == NULL) if (server->target_name == NULL)
break; break;
@@ -921,11 +921,11 @@ main(int argc, char **argv)
warnx("build_context failed: %d", (int)val); warnx("build_context failed: %d", (int)val);
break; break;
} }
val = test_token(client, clientC, server, serverC, wrap_ext); val = test_token(client, clientC, server, serverC, wrap_ext);
if (val) if (val)
break; break;
toast_resource(client, clientC); toast_resource(client, clientC);
toast_resource(server, serverC); toast_resource(server, serverC);
if (!delegCred) { if (!delegCred) {

View File

@@ -229,7 +229,7 @@ acquire_cred(struct client *c,
"krb5_get_init_creds failed: %d", ret); "krb5_get_init_creds failed: %d", ret);
return convert_krb5_to_gsm(ret); return convert_krb5_to_gsm(ret);
} }
ret = krb5_cc_new_unique(context, "MEMORY", NULL, &id); ret = krb5_cc_new_unique(context, "MEMORY", NULL, &id);
if (ret) if (ret)
krb5_err (context, 1, ret, "krb5_cc_initialize"); krb5_err (context, 1, ret, "krb5_cc_initialize");
@@ -358,7 +358,7 @@ HandleOP(InitContext)
if (ctx) if (ctx)
krb5_errx(context, 1, "initcreds, context not NULL, but first req"); krb5_errx(context, 1, "initcreds, context not NULL, but first req");
} }
if ((flags & GSS_C_DELEG_FLAG) != 0) if ((flags & GSS_C_DELEG_FLAG) != 0)
logmessage(c, __FILE__, __LINE__, 0, "init_sec_context delegating"); logmessage(c, __FILE__, __LINE__, 0, "init_sec_context delegating");
if ((flags & GSS_C_DCE_STYLE) != 0) if ((flags & GSS_C_DCE_STYLE) != 0)
@@ -484,7 +484,7 @@ HandleOP(AcceptContext)
gss_release_cred(&min_stat, &deleg_cred); gss_release_cred(&min_stat, &deleg_cred);
deleg_hcred = 0; deleg_hcred = 0;
} }
gsm_error = convert_gss_to_gsm(maj_stat); gsm_error = convert_gss_to_gsm(maj_stat);
@@ -799,7 +799,7 @@ HandleOP(Unwrap)
if (maj_stat != GSS_S_COMPLETE) if (maj_stat != GSS_S_COMPLETE)
errx(1, "gss_unwrap failed: %d/%d", maj_stat, min_stat); errx(1, "gss_unwrap failed: %d/%d", maj_stat, min_stat);
krb5_data_free(&token); krb5_data_free(&token);
if (maj_stat == GSS_S_COMPLETE) { if (maj_stat == GSS_S_COMPLETE) {
token.data = output_token.value; token.data = output_token.value;
@@ -1013,7 +1013,7 @@ HandleOP(UnwrapExt)
if (maj_stat != GSS_S_COMPLETE) if (maj_stat != GSS_S_COMPLETE)
errx(1, "gss_unwrap failed: %d/%d", maj_stat, min_stat); errx(1, "gss_unwrap failed: %d/%d", maj_stat, min_stat);
if (maj_stat == GSS_S_COMPLETE) { if (maj_stat == GSS_S_COMPLETE) {
token.data = iov[1].buffer.value; token.data = iov[1].buffer.value;
token.length = iov[1].buffer.length; token.length = iov[1].buffer.length;
@@ -1100,7 +1100,7 @@ create_client(int fd, int port, const char *moniker)
{ {
c->salen = sizeof(c->sa); c->salen = sizeof(c->sa);
getpeername(fd, (struct sockaddr *)&c->sa, &c->salen); getpeername(fd, (struct sockaddr *)&c->sa, &c->salen);
getnameinfo((struct sockaddr *)&c->sa, c->salen, getnameinfo((struct sockaddr *)&c->sa, c->salen,
c->servername, sizeof(c->servername), c->servername, sizeof(c->servername),
NULL, 0, NI_NUMERICHOST); NULL, 0, NI_NUMERICHOST);

View File

@@ -1,34 +1,34 @@
.\" Copyright (c) 2000 - 2001 Kungliga Tekniska Högskolan .\" Copyright (c) 2000 - 2001 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden). .\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions
.\" are met: .\" are met:
.\" .\"
.\" 1. Redistributions of source code must retain the above copyright .\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer. .\" notice, this list of conditions and the following disclaimer.
.\" .\"
.\" 2. Redistributions in binary form must reproduce the above copyright .\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the .\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution. .\" documentation and/or other materials provided with the distribution.
.\" .\"
.\" 3. Neither the name of the Institute nor the names of its contributors .\" 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 .\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission. .\" 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$ .\" $Id$
.\" .\"
.Dd July 2, 2000 .Dd July 2, 2000

View File

@@ -1,34 +1,34 @@
.\" Copyright (c) 2000 - 2002 Kungliga Tekniska Högskolan .\" Copyright (c) 2000 - 2002 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden). .\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions
.\" are met: .\" are met:
.\" .\"
.\" 1. Redistributions of source code must retain the above copyright .\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer. .\" notice, this list of conditions and the following disclaimer.
.\" .\"
.\" 2. Redistributions in binary form must reproduce the above copyright .\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the .\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution. .\" documentation and/or other materials provided with the distribution.
.\" .\"
.\" 3. Neither the name of the Institute nor the names of its contributors .\" 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 .\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission. .\" 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$ .\" $Id$
.\" .\"
.Dd July 2, 2000 .Dd July 2, 2000

View File

@@ -693,7 +693,7 @@ replace_cookie(int xserver, int fd, char *filename, int cookiesp) /* XXX */
if (f != NULL) { if (f != NULL) {
Xauth *auth = find_auth_cookie (f); Xauth *auth = find_auth_cookie (f);
u_char len[6] = {0, 0, 0, 0, 0, 0}; u_char len[6] = {0, 0, 0, 0, 0, 0};
fclose (f); fclose (f);
if (auth != NULL) { if (auth != NULL) {

View File

@@ -256,7 +256,7 @@ copy_out (kx_context *kc, int from_fd, int to_fd)
} }
return krb5_write (kc, to_fd, buf, len); return krb5_write (kc, to_fd, buf, len);
} }
/* /*
* Copy from the socket `from_fd' decrypting to `to_fd'. * Copy from the socket `from_fd' decrypting to `to_fd'.
* Return 0, -1 or len. * Return 0, -1 or len.

View File

@@ -1,34 +1,34 @@
.\" Copyright (c) 1996 - 1997 Kungliga Tekniska Högskolan .\" Copyright (c) 1996 - 1997 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden). .\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions
.\" are met: .\" are met:
.\" .\"
.\" 1. Redistributions of source code must retain the above copyright .\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer. .\" notice, this list of conditions and the following disclaimer.
.\" .\"
.\" 2. Redistributions in binary form must reproduce the above copyright .\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the .\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution. .\" documentation and/or other materials provided with the distribution.
.\" .\"
.\" 3. Neither the name of the Institute nor the names of its contributors .\" 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 .\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission. .\" 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$ .\" $Id$
.\" .\"
.Dd September 27, 1996 .Dd September 27, 1996

View File

@@ -182,7 +182,7 @@ status_output (int debugp)
printf ("%u\t%s\t%s\n", (unsigned)getpid(), display, xauthfile); printf ("%u\t%s\t%s\n", (unsigned)getpid(), display, xauthfile);
else { else {
pid_t pid; pid_t pid;
pid = fork(); pid = fork();
if (pid < 0) { if (pid < 0) {
err(1, "fork"); err(1, "fork");
@@ -279,7 +279,7 @@ doit_passive (kx_context *kc)
p++; p++;
p += kx_get_int (p, &tmp, 4, 0); p += kx_get_int (p, &tmp, 4, 0);
} }
++nchild; ++nchild;
child = fork (); child = fork ();
if (child < 0) { if (child < 0) {
@@ -292,7 +292,7 @@ doit_passive (kx_context *kc)
close (otherside); close (otherside);
socket_set_port(kc->thataddr, htons(tmp)); socket_set_port(kc->thataddr, htons(tmp));
fd = socket (kc->thataddr->sa_family, SOCK_STREAM, 0); fd = socket (kc->thataddr->sa_family, SOCK_STREAM, 0);
if (fd < 0) if (fd < 0)
err(1, "socket"); err(1, "socket");

View File

@@ -1,34 +1,34 @@
.\" Copyright (c) 1996 - 1997, 2001 Kungliga Tekniska Högskolan .\" Copyright (c) 1996 - 1997, 2001 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden). .\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions
.\" are met: .\" are met:
.\" .\"
.\" 1. Redistributions of source code must retain the above copyright .\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer. .\" notice, this list of conditions and the following disclaimer.
.\" .\"
.\" 2. Redistributions in binary form must reproduce the above copyright .\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the .\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution. .\" documentation and/or other materials provided with the distribution.
.\" .\"
.\" 3. Neither the name of the Institute nor the names of its contributors .\" 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 .\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission. .\" 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$ .\" $Id$
.\" .\"
.Dd September 27, 1996 .Dd September 27, 1996

View File

@@ -424,7 +424,7 @@ close_connection(int fd, const char *message)
p += mlen; p += mlen;
while((p - buf) % 4) /* pad to multiple of 4 bytes */ while((p - buf) % 4) /* pad to multiple of 4 bytes */
*p++ = 0; *p++ = 0;
/* now fill in length of additional data */ /* now fill in length of additional data */
if(lsb) { if(lsb) {
buf[6] = (p - buf - 8) / 4; buf[6] = (p - buf - 8) / 4;
@@ -502,7 +502,7 @@ doit_passive (kx_context *kc,
memcpy (p, xauthfile, len); memcpy (p, xauthfile, len);
p += len; p += len;
rem -= len; rem -= len;
if(kx_write (kc, sock, msg, p - msg) < 0) { if(kx_write (kc, sock, msg, p - msg) < 0) {
syslog (LOG_ERR, "write: %m"); syslog (LOG_ERR, "write: %m");
cleanup(nsockets, sockets); cleanup(nsockets, sockets);
@@ -515,7 +515,7 @@ doit_passive (kx_context *kc,
int i; int i;
int ret; int ret;
int cookiesp = TRUE; int cookiesp = TRUE;
FD_ZERO(&fds); FD_ZERO(&fds);
if (sock >= FD_SETSIZE) { if (sock >= FD_SETSIZE) {
syslog (LOG_ERR, "fd too large"); syslog (LOG_ERR, "fd too large");
@@ -640,7 +640,7 @@ doit_active (kx_context *kc,
p = msg; p = msg;
*p++ = ACK; *p++ = ACK;
if(kx_write (kc, sock, msg, p - msg) < 0) { if(kx_write (kc, sock, msg, p - msg) < 0) {
syslog (LOG_ERR, "write: %m"); syslog (LOG_ERR, "write: %m");
return 1; return 1;
@@ -648,7 +648,7 @@ doit_active (kx_context *kc,
for (;;) { for (;;) {
pid_t child; pid_t child;
int len; int len;
len = kx_read (kc, sock, msg, sizeof(msg)); len = kx_read (kc, sock, msg, sizeof(msg));
if (len < 0) { if (len < 0) {
syslog (LOG_ERR, "read: %m"); syslog (LOG_ERR, "read: %m");

View File

@@ -1,34 +1,34 @@
.\" Copyright (c) 1996 - 1998, 2001 - 2002 Kungliga Tekniska Högskolan .\" Copyright (c) 1996 - 1998, 2001 - 2002 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden). .\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions
.\" are met: .\" are met:
.\" .\"
.\" 1. Redistributions of source code must retain the above copyright .\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer. .\" notice, this list of conditions and the following disclaimer.
.\" .\"
.\" 2. Redistributions in binary form must reproduce the above copyright .\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the .\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution. .\" documentation and/or other materials provided with the distribution.
.\" .\"
.\" 3. Neither the name of the Institute nor the names of its contributors .\" 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 .\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission. .\" 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$ .\" $Id$
.\" .\"
.Dd March 7, 2004 .Dd March 7, 2004

View File

@@ -1,34 +1,34 @@
.\" Copyright (c) 1996 - 1997, 2001 - 2003 Kungliga Tekniska Högskolan .\" Copyright (c) 1996 - 1997, 2001 - 2003 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden). .\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions
.\" are met: .\" are met:
.\" .\"
.\" 1. Redistributions of source code must retain the above copyright .\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer. .\" notice, this list of conditions and the following disclaimer.
.\" .\"
.\" 2. Redistributions in binary form must reproduce the above copyright .\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the .\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution. .\" documentation and/or other materials provided with the distribution.
.\" .\"
.\" 3. Neither the name of the Institute nor the names of its contributors .\" 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 .\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission. .\" 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$ .\" $Id$
.\" .\"
.Dd April 11, 2003 .Dd April 11, 2003

View File

@@ -1,34 +1,34 @@
.\" Copyright (c) 1997, 2001 - 2002 Kungliga Tekniska Högskolan .\" Copyright (c) 1997, 2001 - 2002 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden). .\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions
.\" are met: .\" are met:
.\" .\"
.\" 1. Redistributions of source code must retain the above copyright .\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer. .\" notice, this list of conditions and the following disclaimer.
.\" .\"
.\" 2. Redistributions in binary form must reproduce the above copyright .\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the .\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution. .\" documentation and/or other materials provided with the distribution.
.\" .\"
.\" 3. Neither the name of the Institute nor the names of its contributors .\" 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 .\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission. .\" 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$ .\" $Id$
.\" .\"
.Dd March 31, 1997 .Dd March 31, 1997

View File

@@ -192,7 +192,7 @@ read_limits_conf(const char *file, const struct passwd *pwd)
continue; continue;
l->has_limit = level; l->has_limit = level;
} }
/* XXX unclear: if you soft to more than default hard, should /* XXX unclear: if you soft to more than default hard, should
we set hard to soft? this code doesn't. */ we set hard to soft? this code doesn't. */
if(strcasecmp(args[1], "soft") == 0 || strcmp(args[1], "-") == 0) if(strcasecmp(args[1], "soft") == 0 || strcmp(args[1], "-") == 0)

View File

@@ -1,5 +1,5 @@
.\" $Id$ .\" $Id$
.\" .\"
.Dd April 22, 2005 .Dd April 22, 2005
.Dt LOGIN 1 .Dt LOGIN 1
.Os HEIMDAL .Os HEIMDAL
@@ -13,8 +13,8 @@
.Op Fl h Ar hostname .Op Fl h Ar hostname
.Ar [username] .Ar [username]
.Sh DESCRIPTION .Sh DESCRIPTION
This manual page documents the This manual page documents the
.Nm login .Nm login
program distributed with the Heimdal Kerberos 5 implementation, it may program distributed with the Heimdal Kerberos 5 implementation, it may
differ in important ways from your system version. differ in important ways from your system version.
.Pp .Pp
@@ -22,7 +22,7 @@ The
.Nm login .Nm login
programs logs users into the system. It is intended to be run by programs logs users into the system. It is intended to be run by
system daemons like system daemons like
.Xr getty 8 .Xr getty 8
or or
.Xr telnetd 8 . .Xr telnetd 8 .
If you are already logged in, but want to change to another user, you If you are already logged in, but want to change to another user, you
@@ -32,16 +32,16 @@ should use
A username can be given on the command line, else one will be prompted A username can be given on the command line, else one will be prompted
for. for.
.Pp .Pp
A password is required to login, unless the A password is required to login, unless the
.Fl f .Fl f
option is given (indicating that the calling program has already done option is given (indicating that the calling program has already done
proper authentication). With proper authentication). With
.Fl f .Fl f
the user will be logged in without further questions. the user will be logged in without further questions.
.Pp .Pp
For password authentication Kerberos 5, Kerberos 4 (if compiled in), For password authentication Kerberos 5, Kerberos 4 (if compiled in),
OTP (if compiled in) and local OTP (if compiled in) and local
.No ( Pa /etc/passwd ) .No ( Pa /etc/passwd )
passwords are supported. OTP will be used if the the user is passwords are supported. OTP will be used if the the user is
registered to use it, and registered to use it, and
.Nm login .Nm login
@@ -70,7 +70,7 @@ to preserve all environment variables. If not given, only the
and and
.Dv TZ .Dv TZ
variables are preserved. It could be a security risk to pass random variables are preserved. It could be a security risk to pass random
variables to variables to
.Nm login .Nm login
or the user shell, so the calling daemon should make sure it only or the user shell, so the calling daemon should make sure it only
passes passes
@@ -90,12 +90,12 @@ Then various system parameters are set up, like changing the owner of
the tty to the user, setting up signals, setting the group list, and the tty to the user, setting up signals, setting the group list, and
user and group id. Also various machine specific tasks are performed. user and group id. Also various machine specific tasks are performed.
.Pp .Pp
Next Next
.Nm login .Nm login
changes to the users home directory, or if that fails, to changes to the users home directory, or if that fails, to
.Pa / . .Pa / .
The environment is setup, by adding some required variables (such as The environment is setup, by adding some required variables (such as
.Dv PATH ) , .Dv PATH ) ,
and also authentication related ones (such as and also authentication related ones (such as
.Dv KRB5CCNAME ) . .Dv KRB5CCNAME ) .
If an environment file exists If an environment file exists
@@ -107,31 +107,31 @@ If one or more login message files are configured, their contents is
printed to the terminal. printed to the terminal.
.Pp .Pp
If a login time command is configured, it is executed. A logout time If a login time command is configured, it is executed. A logout time
command can also be configured, which makes command can also be configured, which makes
.Nm login .Nm login
fork, and wait for the user shell to exit, and then run the command. fork, and wait for the user shell to exit, and then run the command.
This can be used to clean up user credentials. This can be used to clean up user credentials.
.Pp .Pp
Finally, the user's shell is executed. If the user logging in is root, Finally, the user's shell is executed. If the user logging in is root,
and root's login shell does not exist, a default shell (usually and root's login shell does not exist, a default shell (usually
.Pa /bin/sh ) .Pa /bin/sh )
is also tried before giving up. is also tried before giving up.
.Sh ENVIRONMENT .Sh ENVIRONMENT
These environment variables are set by login (not including ones set by These environment variables are set by login (not including ones set by
.Pa /etc/environment ) : .Pa /etc/environment ) :
.Pp .Pp
.Bl -tag -compact -width USERXXLOGNAME .Bl -tag -compact -width USERXXLOGNAME
.It Dv PATH .It Dv PATH
the default system path the default system path
.It Dv HOME .It Dv HOME
the user's home directory (or possibly the user's home directory (or possibly
.Pa / ) .Pa / )
.It Dv USER , Dv LOGNAME .It Dv USER , Dv LOGNAME
both set to the username both set to the username
.It Dv SHELL .It Dv SHELL
the user's shell the user's shell
.It Dv TERM , Dv TZ .It Dv TERM , Dv TZ
set to whatever is passed to set to whatever is passed to
.Nm login .Nm login
.It Dv KRB5CCNAME .It Dv KRB5CCNAME
if the password is verified via Kerberos 5, this will point to the if the password is verified via Kerberos 5, this will point to the
@@ -144,7 +144,7 @@ ticket file
.Bl -tag -compact -width Ds .Bl -tag -compact -width Ds
.It Pa /etc/environment .It Pa /etc/environment
Contains a set of environment variables that should be set in addition Contains a set of environment variables that should be set in addition
to the ones above. It should contain sh-style assignments like to the ones above. It should contain sh-style assignments like
.Dq VARIABLE=value . .Dq VARIABLE=value .
Note that they are not parsed the way a shell would. No variable Note that they are not parsed the way a shell would. No variable
expansion is performed, and all strings are literal, and quotation expansion is performed, and all strings are literal, and quotation
@@ -160,7 +160,7 @@ FOO="this is a string"
BAR= FOO='this is a string' BAR= FOO='this is a string'
.Ed .Ed
.It Pa /etc/login.access .It Pa /etc/login.access
See See
.Xr login.access 5 . .Xr login.access 5 .
.It Pa /etc/login.conf .It Pa /etc/login.conf
This is a termcap style configuration file, that contains various This is a termcap style configuration file, that contains various
@@ -204,14 +204,14 @@ programs typically print all sorts of information by default, such as
last time you logged in, if you have mail, and system message files. last time you logged in, if you have mail, and system message files.
This version of This version of
.Nm login .Nm login
does not, so there is no reason for does not, so there is no reason for
.Pa .hushlogin .Pa .hushlogin
files or similar. We feel that these tasks are best left to the user's files or similar. We feel that these tasks are best left to the user's
shell, but the shell, but the
.Li login_program .Li login_program
facility allows for a shell independent solution, if that is desired. facility allows for a shell independent solution, if that is desired.
.Sh EXAMPLES .Sh EXAMPLES
A A
.Pa login.conf .Pa login.conf
file could look like: file could look like:
.Bd -literal -offset indent .Bd -literal -offset indent
@@ -224,8 +224,8 @@ The
.Pa limits.conf .Pa limits.conf
file consists of a table with four whitespace separated fields. First file consists of a table with four whitespace separated fields. First
field is a username or a groupname (prefixed with field is a username or a groupname (prefixed with
.Sq @ ) , .Sq @ ) ,
or or
.Sq * . .Sq * .
Second field is Second field is
.Sq soft , .Sq soft ,
@@ -234,11 +234,11 @@ or
.Sq - .Sq -
(the last meaning both soft and hard). (the last meaning both soft and hard).
Third field is a limit name (such as Third field is a limit name (such as
.Sq cpu .Sq cpu
or or
.Sq core ) . .Sq core ) .
Last field is the limit value (a number or Last field is the limit value (a number or
.Sq - .Sq -
for unlimited). In the case of data sizes, the value is in kilobytes, for unlimited). In the case of data sizes, the value is in kilobytes,
and cputime is in minutes. and cputime is in minutes.
.Sh SEE ALSO .Sh SEE ALSO

View File

@@ -1,5 +1,5 @@
.\" $Id$ .\" $Id$
.\" .\"
.Dd March 21, 2003 .Dd March 21, 2003
.Dt LOGIN.ACCESS 5 .Dt LOGIN.ACCESS 5
.Os HEIMDAL .Os HEIMDAL
@@ -13,7 +13,7 @@ file specifies on which ttys or from which hosts certain users are
allowed to login. allowed to login.
.Pp .Pp
At login, the At login, the
.Pa /etc/login.access .Pa /etc/login.access
file is checked for the first entry that matches a specific user/host file is checked for the first entry that matches a specific user/host
or user/tty combination. That entry can either allow or deny login or user/tty combination. That entry can either allow or deny login
access to that user. access to that user.
@@ -51,5 +51,5 @@ make the group match if the user also matches.
.Sh AUTHORS .Sh AUTHORS
The The
.Fn login_access .Fn login_access
function was written by function was written by
Wietse Venema. This manual page was written for Heimdal. Wietse Venema. This manual page was written for Heimdal.

View File

@@ -365,7 +365,7 @@ do_login(const struct passwd *pwd, char *tty, char *ttyn)
read_limits_conf(file, pwd); read_limits_conf(file, pwd);
} }
#ifdef HAVE_SETPCRED #ifdef HAVE_SETPCRED
if (setpcred (pwd->pw_name, NULL) == -1) if (setpcred (pwd->pw_name, NULL) == -1)
warn("setpcred(%s)", pwd->pw_name); warn("setpcred(%s)", pwd->pw_name);
@@ -599,7 +599,7 @@ main(int argc, char **argv)
print_version (NULL); print_version (NULL);
return 0; return 0;
} }
if (geteuid() != 0) if (geteuid() != 0)
errx(1, "only root may use login, use su"); errx(1, "only root may use login, use su");
@@ -687,7 +687,7 @@ main(int argc, char **argv)
sig_handler(0); sig_handler(0);
} }
} }
if(pwd == NULL){ if(pwd == NULL){
fprintf(stderr, "Login incorrect.\n"); fprintf(stderr, "Login incorrect.\n");
ask = 1; ask = 1;

View File

@@ -1,34 +1,34 @@
.\" Copyright (c) 1996, 2000 Kungliga Tekniska Högskolan .\" Copyright (c) 1996, 2000 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden). .\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions
.\" are met: .\" are met:
.\" .\"
.\" 1. Redistributions of source code must retain the above copyright .\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer. .\" notice, this list of conditions and the following disclaimer.
.\" .\"
.\" 2. Redistributions in binary form must reproduce the above copyright .\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the .\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution. .\" documentation and/or other materials provided with the distribution.
.\" .\"
.\" 3. Neither the name of the Institute nor the names of its contributors .\" 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 .\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission. .\" 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$ .\" $Id$
.\" .\"
.Dd November 17, 1996 .Dd November 17, 1996

View File

@@ -1,34 +1,34 @@
.\" Copyright (c) 1996, 2000 - 2001 Kungliga Tekniska Högskolan .\" Copyright (c) 1996, 2000 - 2001 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden). .\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions
.\" are met: .\" are met:
.\" .\"
.\" 1. Redistributions of source code must retain the above copyright .\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer. .\" notice, this list of conditions and the following disclaimer.
.\" .\"
.\" 2. Redistributions in binary form must reproduce the above copyright .\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the .\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution. .\" documentation and/or other materials provided with the distribution.
.\" .\"
.\" 3. Neither the name of the Institute nor the names of its contributors .\" 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 .\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission. .\" 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$ .\" $Id$
.\" .\"
.Dd November 17, 1996 .Dd November 17, 1996

View File

@@ -195,7 +195,7 @@ main(int argc, char **argv)
print_version (NULL); print_version (NULL);
return 0; return 0;
} }
if (argc < 1) if (argc < 1)
usage (1); usage (1);

View File

@@ -83,14 +83,14 @@ pop_xdele(POP *p)
continue; /* no point in returning error */ continue; /* no point in returning error */
/* Flag the message for deletion */ /* Flag the message for deletion */
mp->flags |= DEL_FLAG; mp->flags |= DEL_FLAG;
#ifdef DEBUG #ifdef DEBUG
if(p->debug) if(p->debug)
pop_log(p, POP_DEBUG, pop_log(p, POP_DEBUG,
"Deleting message %u at offset %ld of length %ld\n", "Deleting message %u at offset %ld of length %ld\n",
mp->number, mp->offset, mp->length); mp->number, mp->offset, mp->length);
#endif /* DEBUG */ #endif /* DEBUG */
/* Update the messages_deleted and bytes_deleted counters */ /* Update the messages_deleted and bytes_deleted counters */
p->msgs_deleted++; p->msgs_deleted++;
p->bytes_deleted += mp->length; p->bytes_deleted += mp->length;

View File

@@ -105,7 +105,7 @@ add_missing_headers(POP *p, MsgInfoList *mp)
p->user); p->user);
} }
} }
#endif #endif
#ifdef XOVER #ifdef XOVER
if (mp->subject == NULL) if (mp->subject == NULL)
mp->subject = "<none>"; mp->subject = "<none>";
@@ -219,7 +219,7 @@ pop_dropinfo(POP *p)
pop_log(p,POP_DEBUG, pop_log(p,POP_DEBUG,
"Msg %d at offset %ld is %ld octets long and has %u lines and id %s.", "Msg %d at offset %ld is %ld octets long and has %u lines and id %s.",
mp->number,mp->offset,mp->length,mp->lines, mp->msg_id); mp->number,mp->offset,mp->length,mp->lines, mp->msg_id);
#else #else
pop_log(p,POP_DEBUG, pop_log(p,POP_DEBUG,
"Msg %d at offset %d is %d octets long and has %u lines.", "Msg %d at offset %d is %d octets long and has %u lines.",
mp->number,mp->offset,mp->length,mp->lines); mp->number,mp->offset,mp->length,mp->lines);

View File

@@ -62,7 +62,7 @@ krb5_authenticate (POP *p, int s, u_char *buf, struct sockaddr *addr)
if (memcmp (buf, "\x00\x00\x00\x13", 4) != 0) if (memcmp (buf, "\x00\x00\x00\x13", 4) != 0)
return -1; return -1;
len = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | (buf[3]); len = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | (buf[3]);
if (krb5_net_read(p->context, &s, buf, len) != len) if (krb5_net_read(p->context, &s, buf, len) != len)
return -1; return -1;
if (len != sizeof(KRB5_SENDAUTH_VERSION) if (len != sizeof(KRB5_SENDAUTH_VERSION)

View File

@@ -109,7 +109,7 @@ login_user(POP *p)
/* Make a temporary copy of the user's maildrop */ /* Make a temporary copy of the user's maildrop */
/* and set the group and user id */ /* and set the group and user id */
if (pop_dropcopy(p, pw) != POP_SUCCESS) return (POP_FAILURE); if (pop_dropcopy(p, pw) != POP_SUCCESS) return (POP_FAILURE);
/* Get information about the maildrop */ /* Get information about the maildrop */
if (pop_dropinfo(p) != POP_SUCCESS) return(POP_FAILURE); if (pop_dropinfo(p) != POP_SUCCESS) return(POP_FAILURE);
} else { } else {
@@ -143,7 +143,7 @@ pop_pass (POP *p)
#ifdef KRB5 #ifdef KRB5
if (p->version == 5) { if (p->version == 5) {
char *name; char *name;
if (!krb5_kuserok (p->context, p->principal, p->user)) { if (!krb5_kuserok (p->context, p->principal, p->user)) {
pop_log (p, POP_PRIORITY, pop_log (p, POP_PRIORITY,
"krb5 permission denied"); "krb5 permission denied");

View File

@@ -1,34 +1,34 @@
.\" Copyright (c) 2001 - 2004 Kungliga Tekniska Högskolan .\" Copyright (c) 2001 - 2004 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden). .\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions
.\" are met: .\" are met:
.\" .\"
.\" 1. Redistributions of source code must retain the above copyright .\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer. .\" notice, this list of conditions and the following disclaimer.
.\" .\"
.\" 2. Redistributions in binary form must reproduce the above copyright .\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the .\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution. .\" documentation and/or other materials provided with the distribution.
.\" .\"
.\" 3. Neither the name of the Institute nor the names of its contributors .\" 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 .\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission. .\" 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$ .\" $Id$
.\" .\"
.Dd July 14, 2004 .Dd July 14, 2004
@@ -54,7 +54,7 @@ serves mail via the Post Office Protocol. Supported options include:
.It Fl a Ar plaintext Ns \*(Ba Ns Ar otp Ns \*(Ba Ns Ar sasl .It Fl a Ar plaintext Ns \*(Ba Ns Ar otp Ns \*(Ba Ns Ar sasl
Tells Tells
.Nm .Nm
which authentication mode is acceptable, which authentication mode is acceptable,
.Ar sasl .Ar sasl
enables SASL (RFC2222), and enables SASL (RFC2222), and
.Ar otp .Ar otp

View File

@@ -1,34 +1,34 @@
.\" Copyright (c) 2000 - 2002 Kungliga Tekniska Högskolan .\" Copyright (c) 2000 - 2002 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden). .\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions
.\" are met: .\" are met:
.\" .\"
.\" 1. Redistributions of source code must retain the above copyright .\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer. .\" notice, this list of conditions and the following disclaimer.
.\" .\"
.\" 2. Redistributions in binary form must reproduce the above copyright .\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the .\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution. .\" documentation and/or other materials provided with the distribution.
.\" .\"
.\" 3. Neither the name of the Institute nor the names of its contributors .\" 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 .\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission. .\" 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$ .\" $Id$
.\" .\"
.Dd March 4, 2000 .Dd March 4, 2000

View File

@@ -168,20 +168,20 @@ write_state_init (struct write_state *w, int fd)
static void static void
write_state_add (struct write_state *w, void *v, size_t len) write_state_add (struct write_state *w, void *v, size_t len)
{ {
if(w->niovecs == w->allociovecs) { if(w->niovecs == w->allociovecs) {
if(w->niovecs == w->maxiovecs) { if(w->niovecs == w->maxiovecs) {
if(writev (w->fd, w->iovecs, w->niovecs) < 0) if(writev (w->fd, w->iovecs, w->niovecs) < 0)
err(1, "writev"); err(1, "writev");
w->niovecs = 0; w->niovecs = 0;
} else { } else {
w->allociovecs = min(w->allociovecs + STEP, w->maxiovecs); w->allociovecs = min(w->allociovecs + STEP, w->maxiovecs);
w->iovecs = erealloc (w->iovecs, w->iovecs = erealloc (w->iovecs,
w->allociovecs * sizeof(*w->iovecs)); w->allociovecs * sizeof(*w->iovecs));
} }
} }
w->iovecs[w->niovecs].iov_base = v; w->iovecs[w->niovecs].iov_base = v;
w->iovecs[w->niovecs].iov_len = len; w->iovecs[w->niovecs].iov_len = len;
++w->niovecs; ++w->niovecs;
} }
static void static void
@@ -310,12 +310,12 @@ doit(int s,
else else
err (1, "select"); err (1, "select");
} }
if (FD_ISSET(s, &readset)) { if (FD_ISSET(s, &readset)) {
char *beg, *p; char *beg, *p;
size_t rem; size_t rem;
int blank_line = 0; int blank_line = 0;
if(in_len >= in_buf_size) { if(in_len >= in_buf_size) {
char *tmp = erealloc(in_buf, in_buf_size + PUSH_BUFSIZ + 1); char *tmp = erealloc(in_buf, in_buf_size + PUSH_BUFSIZ + 1);
in_ptr = tmp + (in_ptr - in_buf); in_ptr = tmp + (in_ptr - in_buf);
@@ -328,11 +328,11 @@ doit(int s,
err (1, "read"); err (1, "read");
else if (ret == 0) else if (ret == 0)
errx (1, "EOF during read"); errx (1, "EOF during read");
in_len += ret; in_len += ret;
in_ptr += ret; in_ptr += ret;
*in_ptr = '\0'; *in_ptr = '\0';
beg = in_buf; beg = in_buf;
rem = in_len; rem = in_len;
while(rem > 1 while(rem > 1
@@ -727,7 +727,7 @@ main(int argc, char **argv)
print_version(NULL); print_version(NULL);
return 0; return 0;
} }
if (do_from && header_str == NULL) if (do_from && header_str == NULL)
header_str = "From:"; header_str = "From:";
else if (header_str != NULL) else if (header_str != NULL)

View File

@@ -17,7 +17,7 @@
.Ar file... directory .Ar file... directory
.Sh DESCRIPTION .Sh DESCRIPTION
.Nm rcp .Nm rcp
copies files between machines. Each file argument is either a remote file name of the form copies files between machines. Each file argument is either a remote file name of the form
.Dq rname@rhost:path .Dq rname@rhost:path
or a local file (containing no colon or with a slash before the first or a local file (containing no colon or with a slash before the first
colon). colon).
@@ -25,11 +25,11 @@ colon).
Supported options: Supported options:
.Bl -tag -width Ds .Bl -tag -width Ds
.It Xo .It Xo
.Fl 4 , .Fl 4 ,
.Fl 5 , .Fl 5 ,
.Fl K , .Fl K ,
.Fl F , .Fl F ,
.Fl x , .Fl x ,
.Fl z .Fl z
.Xc .Xc
These options are passed on to These options are passed on to
@@ -37,7 +37,7 @@ These options are passed on to
.It Fl P Ar port .It Fl P Ar port
This will pass the option This will pass the option
.Fl p Ar port .Fl p Ar port
to to
.Xr rsh 1 . .Xr rsh 1 .
.It Fl p .It Fl p
Preserve file permissions. Preserve file permissions.
@@ -58,7 +58,7 @@ connection".
.\".Sh SEE ALSO .\".Sh SEE ALSO
.\".Sh STANDARDS .\".Sh STANDARDS
.Sh HISTORY .Sh HISTORY
The The
.Nm rcp .Nm rcp
utility first appeared in 4.2BSD. This version is derived from utility first appeared in 4.2BSD. This version is derived from
4.3BSD-Reno. 4.3BSD-Reno.

View File

@@ -101,7 +101,7 @@ main(int argc, char **argv)
print_version (NULL); print_version (NULL);
return 0; return 0;
} }
iamremote = (fflag || tflag); iamremote = (fflag || tflag);
argc -= optind; argc -= optind;
@@ -384,7 +384,7 @@ rsource(char *name, struct stat *statp)
} }
} }
snprintf(path, sizeof(path), snprintf(path, sizeof(path),
"D%04o %d %s\n", "D%04o %d %s\n",
(unsigned int)(statp->st_mode & MODEMASK), 0, last); (unsigned int)(statp->st_mode & MODEMASK), 0, last);
write(remout, path, strlen(path)); write(remout, path, strlen(path));
if (response() < 0) { if (response() < 0) {

View File

@@ -105,7 +105,7 @@ do_read (int fd, void *buf, size_t sz, void *ivec)
status = krb5_decrypt_ivec(context, crypto, key_usage, status = krb5_decrypt_ivec(context, crypto, key_usage,
edata, outer_len, &data, ivec); edata, outer_len, &data, ivec);
free (edata); free (edata);
if (status) if (status)
krb5_err (context, 1, status, "decrypting data"); krb5_err (context, 1, status, "decrypting data");
if(ivec != NULL) { if(ivec != NULL) {

View File

@@ -1,34 +1,34 @@
.\" Copyright (c) 2002 - 2003 Kungliga Tekniska Högskolan .\" Copyright (c) 2002 - 2003 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden). .\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions
.\" are met: .\" are met:
.\" .\"
.\" 1. Redistributions of source code must retain the above copyright .\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer. .\" notice, this list of conditions and the following disclaimer.
.\" .\"
.\" 2. Redistributions in binary form must reproduce the above copyright .\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the .\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution. .\" documentation and/or other materials provided with the distribution.
.\" .\"
.\" 3. Neither the name of the Institute nor the names of its contributors .\" 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 .\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission. .\" 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$ .\" $Id$
.\" .\"
.Dd February 20, 2004 .Dd February 20, 2004
@@ -126,7 +126,7 @@ The opposite of
This is the default, and is mainly useful if encryption has been This is the default, and is mainly useful if encryption has been
enabled by default, for instance in the enabled by default, for instance in the
.Li appdefaults .Li appdefaults
section of section of
.Pa /etc/krb5.conf .Pa /etc/krb5.conf
when using Kerberos 5. when using Kerberos 5.
.It Xo .It Xo
@@ -142,7 +142,7 @@ Also settable via
.Fl F , .Fl F ,
.Fl Fl forwardable .Fl Fl forwardable
.Xc .Xc
Make the forwarded credentials re-forwardable. Make the forwarded credentials re-forwardable.
Also settable via Also settable via
.Li appdefaults .Li appdefaults
(see (see
@@ -160,7 +160,7 @@ format allow the remote name to be specified.
.Fl n , .Fl n ,
.Fl Fl no-input .Fl Fl no-input
.Xc .Xc
Direct input from Direct input from
.Pa /dev/null .Pa /dev/null
(see the (see the
.Sx BUGS .Sx BUGS
@@ -182,7 +182,7 @@ Specifies the protocol version to use with Kerberos 5.
.Ar N .Ar N
and and
.Ar 2 .Ar 2
select protocol version 2, while select protocol version 2, while
.Ar O .Ar O
and and
.Ar 1 .Ar 1

View File

@@ -297,7 +297,7 @@ send_krb5_auth(int s,
default: default:
abort(); abort();
} }
status = krb5_sendauth (context, status = krb5_sendauth (context,
&auth_context, &auth_context,
&s, &s,
@@ -645,7 +645,7 @@ doit_broken (int argc,
if (connect (priv_socket1, ai->ai_addr, ai->ai_addrlen) < 0) { if (connect (priv_socket1, ai->ai_addr, ai->ai_addrlen) < 0) {
int save_errno = errno; int save_errno = errno;
close(priv_socket1); close(priv_socket1);
close(priv_socket2); close(priv_socket2);

View File

@@ -1,34 +1,34 @@
.\" Copyright (c) 2001 - 2006 Kungliga Tekniska Högskolan .\" Copyright (c) 2001 - 2006 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden). .\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions
.\" are met: .\" are met:
.\" .\"
.\" 1. Redistributions of source code must retain the above copyright .\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer. .\" notice, this list of conditions and the following disclaimer.
.\" .\"
.\" 2. Redistributions in binary form must reproduce the above copyright .\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the .\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution. .\" documentation and/or other materials provided with the distribution.
.\" .\"
.\" 3. Neither the name of the Institute nor the names of its contributors .\" 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 .\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission. .\" 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$ .\" $Id$
.\" .\"
.Dd November 22, 2002 .Dd November 22, 2002

View File

@@ -258,7 +258,7 @@ recv_krb5_auth (int s, u_char *buf,
if (memcmp (buf, "\x00\x00\x00\x13", 4) != 0) if (memcmp (buf, "\x00\x00\x00\x13", 4) != 0)
return -1; return -1;
len = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | (buf[3]); len = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | (buf[3]);
if (net_read(s, buf, len) != len) if (net_read(s, buf, len) != len)
syslog_and_die ("reading auth info: %s", strerror(errno)); syslog_and_die ("reading auth info: %s", strerror(errno));
if (len != sizeof(KRB5_SENDAUTH_VERSION) if (len != sizeof(KRB5_SENDAUTH_VERSION)
@@ -394,7 +394,7 @@ recv_krb5_auth (int s, u_char *buf,
*cmd); *cmd);
free (name); free (name);
} }
} }
krb5_auth_con_free(context, auth_context); krb5_auth_con_free(context, auth_context);
@@ -918,12 +918,12 @@ main(int argc, char **argv)
int error; int error;
struct addrinfo *ai = NULL, hints; struct addrinfo *ai = NULL, hints;
char portstr[NI_MAXSERV]; char portstr[NI_MAXSERV];
memset (&hints, 0, sizeof(hints)); memset (&hints, 0, sizeof(hints));
hints.ai_flags = AI_PASSIVE; hints.ai_flags = AI_PASSIVE;
hints.ai_socktype = SOCK_STREAM; hints.ai_socktype = SOCK_STREAM;
hints.ai_family = PF_UNSPEC; hints.ai_family = PF_UNSPEC;
if(port_str != NULL) { if(port_str != NULL) {
error = getaddrinfo (NULL, port_str, &hints, &ai); error = getaddrinfo (NULL, port_str, &hints, &ai);
if (error) if (error)

View File

@@ -1,34 +1,34 @@
.\" Copyright (c) 2003 - 2006 Kungliga Tekniska Högskolan .\" Copyright (c) 2003 - 2006 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden). .\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions
.\" are met: .\" are met:
.\" .\"
.\" 1. Redistributions of source code must retain the above copyright .\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer. .\" notice, this list of conditions and the following disclaimer.
.\" .\"
.\" 2. Redistributions in binary form must reproduce the above copyright .\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the .\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution. .\" documentation and/or other materials provided with the distribution.
.\" .\"
.\" 3. Neither the name of the Institute nor the names of its contributors .\" 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 .\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission. .\" 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$ .\" $Id$
.\" .\"
.Dd January 12, 2006 .Dd January 12, 2006
@@ -59,25 +59,25 @@ user wanting to change effective UID is present in a file named
.Pa .k5login .Pa .k5login
in the target user id's home directory in the target user id's home directory
.Pp .Pp
A special case exists where A special case exists where
.Ql root Ap s .Ql root Ap s
.Pa ~/.k5login .Pa ~/.k5login
needs to contain an entry for: needs to contain an entry for:
.Ql user Ns / Ns Ao instance Ac Ns @ Ns REALM .Ql user Ns / Ns Ao instance Ac Ns @ Ns REALM
for for
.Nm su .Nm su
to succed (where to succed (where
.Aq instance .Aq instance
is is
.Ql root .Ql root
unless changed with unless changed with
.Fl i ) . .Fl i ) .
.Pp .Pp
In the absence of either an entry for current user in said file or In the absence of either an entry for current user in said file or
other problems like missing other problems like missing
.Ql host/hostname@REALM .Ql host/hostname@REALM
keys in the system's keys in the system's
keytab, or user typing the wrong password, keytab, or user typing the wrong password,
.Nm su .Nm su
will fall back to traditional will fall back to traditional
.Pa /etc/passwd .Pa /etc/passwd
@@ -86,7 +86,7 @@ authentication.
When using When using
.Pa /etc/passwd .Pa /etc/passwd
authentication, authentication,
.Nm su .Nm su
allows allows
.Ql root .Ql root
access only to members of the group access only to members of the group

View File

@@ -152,7 +152,7 @@ krb5_verify(const struct passwd *login_info,
krb5_realm *realms, *r; krb5_realm *realms, *r;
char *login_name = NULL; char *login_name = NULL;
int user_ok = 0; int user_ok = 0;
#if defined(HAVE_GETLOGIN) && !defined(POSIX_GETLOGIN) #if defined(HAVE_GETLOGIN) && !defined(POSIX_GETLOGIN)
login_name = getlogin(); login_name = getlogin();
#endif #endif
@@ -163,7 +163,7 @@ krb5_verify(const struct passwd *login_info,
#endif #endif
return 1; return 1;
} }
ret = krb5_get_default_realms(context, &realms); ret = krb5_get_default_realms(context, &realms);
if (ret) if (ret)
return 1; return 1;
@@ -186,7 +186,7 @@ krb5_verify(const struct passwd *login_info,
krb5_free_host_realm(context, realms); krb5_free_host_realm(context, realms);
return 1; return 1;
} }
/* if we are su-ing too root, check with krb5_kuserok */ /* if we are su-ing too root, check with krb5_kuserok */
if (su_info->pw_uid == 0 && !krb5_kuserok(context, p, su_info->pw_name)) if (su_info->pw_uid == 0 && !krb5_kuserok(context, p, su_info->pw_name))
continue; continue;
@@ -348,7 +348,7 @@ main(int argc, char **argv)
full_login = 1; full_login = 1;
break; break;
} }
if(help_flag) if(help_flag)
usage(0); usage(0);
if(version_flag) { if(version_flag) {
@@ -499,14 +499,14 @@ main(int argc, char **argv)
args[i++] = "-c"; args[i++] = "-c";
args[i++] = cmd; args[i++] = cmd;
} }
if (csh_f_flag) if (csh_f_flag)
args[i++] = "-f"; args[i++] = "-f";
for (argv += optind; *argv; ++argv) for (argv += optind; *argv; ++argv)
args[i++] = *argv; args[i++] = *argv;
args[i] = NULL; args[i] = NULL;
if(setgid(su_info->pw_gid) < 0) if(setgid(su_info->pw_gid) < 0)
err(1, "setgid"); err(1, "setgid");
if (initgroups (su_info->pw_name, su_info->pw_gid) < 0) if (initgroups (su_info->pw_name, su_info->pw_gid) < 0)

View File

@@ -108,7 +108,7 @@ static long i_support_encrypt = typemask(ENCTYPE_DES_CFB64)
static Encryptions encryptions[] = { static Encryptions encryptions[] = {
#if defined(DES_ENCRYPTION) #if defined(DES_ENCRYPTION)
{ "DES_CFB64", ENCTYPE_DES_CFB64, { "DES_CFB64", ENCTYPE_DES_CFB64,
cfb64_encrypt, cfb64_encrypt,
cfb64_decrypt, cfb64_decrypt,
cfb64_init, cfb64_init,
cfb64_start, cfb64_start,
@@ -118,7 +118,7 @@ static long i_support_encrypt = typemask(ENCTYPE_DES_CFB64)
cfb64_keyid, cfb64_keyid,
cfb64_printsub }, cfb64_printsub },
{ "DES_OFB64", ENCTYPE_DES_OFB64, { "DES_OFB64", ENCTYPE_DES_OFB64,
ofb64_encrypt, ofb64_encrypt,
ofb64_decrypt, ofb64_decrypt,
ofb64_init, ofb64_init,
ofb64_start, ofb64_start,
@@ -388,7 +388,7 @@ encrypt_display(void)
ENCTYPE_NAME(encrypt_mode)); ENCTYPE_NAME(encrypt_mode));
else else
printf("Currently not encrypting output\r\n"); printf("Currently not encrypting output\r\n");
if (decrypt_input) if (decrypt_input)
printf("Currently decrypting input with %s\r\n", printf("Currently decrypting input with %s\r\n",
ENCTYPE_NAME(decrypt_mode)); ENCTYPE_NAME(decrypt_mode));
@@ -411,7 +411,7 @@ EncryptStatus(void)
ENCTYPE_NAME(encrypt_mode)); ENCTYPE_NAME(encrypt_mode));
} else } else
printf("Currently not encrypting output\r\n"); printf("Currently not encrypting output\r\n");
if (decrypt_input) { if (decrypt_input) {
printf("Currently decrypting input with %s\r\n", printf("Currently decrypting input with %s\r\n",
ENCTYPE_NAME(decrypt_mode)); ENCTYPE_NAME(decrypt_mode));

View File

@@ -75,7 +75,7 @@ char **
genget(char *name, char **table, int stlen) genget(char *name, char **table, int stlen)
/* name to match */ /* name to match */
/* name entry in table */ /* name entry in table */
{ {
char **c, **found; char **c, **found;
int n; int n;

View File

@@ -135,7 +135,7 @@ Data(Authenticator *ap, int type, const void *d, int c)
memcpy(p0, str_data, sizeof(str_data)); memcpy(p0, str_data, sizeof(str_data));
p = p0 + sizeof(str_data); p = p0 + sizeof(str_data);
if (auth_debug_mode) { if (auth_debug_mode) {
printf("%s:%d: [%d] (%d)", printf("%s:%d: [%d] (%d)",
str_data[3] == TELQUAL_IS ? ">>>IS" : ">>>REPLY", str_data[3] == TELQUAL_IS ? ">>>IS" : ">>>REPLY",
@@ -215,7 +215,7 @@ kerberos5_send(char *name, Authenticator *ap)
} }
return 0; return 0;
} }
if ((ap->way & AUTH_HOW_MASK) == AUTH_HOW_MUTUAL) if ((ap->way & AUTH_HOW_MASK) == AUTH_HOW_MUTUAL)
ap_opts = AP_OPTS_MUTUAL_REQUIRED; ap_opts = AP_OPTS_MUTUAL_REQUIRED;
else else
@@ -418,13 +418,13 @@ kerberos5_is(Authenticator *ap, unsigned char *data, int cnt)
free (errbuf); free (errbuf);
return; return;
} }
{ {
char ap_msg[2]; char ap_msg[2];
ap_msg[0] = ap->type; ap_msg[0] = ap->type;
ap_msg[1] = ap->way; ap_msg[1] = ap->way;
ret = krb5_verify_authenticator_checksum(context, ret = krb5_verify_authenticator_checksum(context,
auth_context, auth_context,
ap_msg, ap_msg,
@@ -536,7 +536,7 @@ kerberos5_is(Authenticator *ap, unsigned char *data, int cnt)
} }
auth_finished(ap, AUTH_USER); auth_finished(ap, AUTH_USER);
krb5_free_keyblock(context, key_block); krb5_free_keyblock(context, key_block);
break; break;
case KRB_FORWARD: { case KRB_FORWARD: {
struct passwd *pwd; struct passwd *pwd;
@@ -628,7 +628,7 @@ kerberos5_reply(Authenticator *ap, unsigned char *data, int cnt)
krb5_error_code ret; krb5_error_code ret;
Session_Key skey; Session_Key skey;
krb5_keyblock *keyblock; krb5_keyblock *keyblock;
if ((ap->way & AUTH_HOW_MASK) == AUTH_HOW_MUTUAL && if ((ap->way & AUTH_HOW_MASK) == AUTH_HOW_MUTUAL &&
!mutual_complete) { !mutual_complete) {
printf("[ Kerberos V5 accepted you, but didn't provide mutual authentication! ]\r\n"); printf("[ Kerberos V5 accepted you, but didn't provide mutual authentication! ]\r\n");
@@ -639,7 +639,7 @@ kerberos5_reply(Authenticator *ap, unsigned char *data, int cnt)
printf("[ Kerberos V5 accepts you as ``%.*s'' ]\r\n", cnt, data); printf("[ Kerberos V5 accepts you as ``%.*s'' ]\r\n", cnt, data);
else else
printf("[ Kerberos V5 accepts you ]\r\n"); printf("[ Kerberos V5 accepts you ]\r\n");
ret = krb5_auth_con_getlocalsubkey (context, ret = krb5_auth_con_getlocalsubkey (context,
auth_context, auth_context,
&keyblock); &keyblock);
@@ -653,7 +653,7 @@ kerberos5_reply(Authenticator *ap, unsigned char *data, int cnt)
auth_send_retry(); auth_send_retry();
return; return;
} }
skey.type = SK_DES; skey.type = SK_DES;
skey.length = 8; skey.length = 8;
skey.data = keyblock->keyvalue.data; skey.data = keyblock->keyvalue.data;
@@ -670,7 +670,7 @@ kerberos5_reply(Authenticator *ap, unsigned char *data, int cnt)
krb5_ap_rep_enc_part *reply; krb5_ap_rep_enc_part *reply;
krb5_data inbuf; krb5_data inbuf;
krb5_error_code ret; krb5_error_code ret;
inbuf.length = cnt; inbuf.length = cnt;
inbuf.data = (char *)data; inbuf.data = (char *)data;

View File

@@ -2181,7 +2181,7 @@ tn(int argc, char **argv)
addrstr, sizeof(addrstr), addrstr, sizeof(addrstr),
NULL, 0, NI_NUMERICHOST) != 0) NULL, 0, NI_NUMERICHOST) != 0)
strlcpy (addrstr, "unknown address", sizeof(addrstr)); strlcpy (addrstr, "unknown address", sizeof(addrstr));
printf("Trying %s...\r\n", addrstr); printf("Trying %s...\r\n", addrstr);
net = socket (a->ai_family, a->ai_socktype, a->ai_protocol); net = socket (a->ai_family, a->ai_socktype, a->ai_protocol);

View File

@@ -164,7 +164,7 @@ main(int argc, char **argv)
#ifdef KRB5 #ifdef KRB5
krb5_init(); krb5_init();
#endif #endif
tninit(); /* Clear out things */ tninit(); /* Clear out things */
TerminalSaveState(); TerminalSaveState();

View File

@@ -2130,7 +2130,7 @@ my_telnet(char *user)
printf("\nServer disconnected.\n"); printf("\nServer disconnected.\n");
Exit(1); Exit(1);
} }
} }
if (printed_encrypt) { if (printed_encrypt) {
printf("Encryption negotiated.\n"); printf("Encryption negotiated.\n");

View File

@@ -250,7 +250,7 @@ optionstatus(void)
static void __attribute__((format (printf, 3, 4))) static void __attribute__((format (printf, 3, 4)))
qprintf(int quote, FILE *f, const char *fmt, ...) qprintf(int quote, FILE *f, const char *fmt, ...)
{ {
va_list va; va_list va;
if (quote) if (quote)

View File

@@ -506,7 +506,7 @@ willoption(int option)
changeok++; changeok++;
break; break;
#endif #endif
default: default:
break; break;
} }

View File

@@ -391,7 +391,7 @@ int getpty(int *ptynum)
{ {
char *clone[] = { "/dev/ptc", "/dev/ptmx", "/dev/ptm", char *clone[] = { "/dev/ptc", "/dev/ptmx", "/dev/ptm",
"/dev/ptym/clone", 0 }; "/dev/ptym/clone", 0 };
char **q; char **q;
int p; int p;
for(q=clone; *q; q++){ for(q=clone; *q; q++){
@@ -415,7 +415,7 @@ int getpty(int *ptynum)
int p; int p;
char *cp, *p1, *p2; char *cp, *p1, *p2;
int i; int i;
#ifndef __hpux #ifndef __hpux
snprintf(line, sizeof(Xline), "/dev/ptyXX"); snprintf(line, sizeof(Xline), "/dev/ptyXX");
p1 = &line[8]; p1 = &line[8];
@@ -425,11 +425,11 @@ int getpty(int *ptynum)
p1 = &line[13]; p1 = &line[13];
p2 = &line[14]; p2 = &line[14];
#endif #endif
for (cp = "pqrstuvwxyzPQRST"; *cp; cp++) { for (cp = "pqrstuvwxyzPQRST"; *cp; cp++) {
struct stat stb; struct stat stb;
*p1 = *cp; *p1 = *cp;
*p2 = '0'; *p2 = '0';
/* /*
@@ -446,7 +446,7 @@ int getpty(int *ptynum)
#if SunOS == 40 #if SunOS == 40
int dummy; int dummy;
#endif #endif
#ifndef __hpux #ifndef __hpux
line[5] = 't'; line[5] = 't';
#else #else
@@ -474,7 +474,7 @@ int getpty(int *ptynum)
extern lowpty, highpty; extern lowpty, highpty;
struct stat sb; struct stat sb;
int p; int p;
for (*ptynum = lowpty; *ptynum <= highpty; (*ptynum)++) { for (*ptynum = lowpty; *ptynum <= highpty; (*ptynum)++) {
snprintf(myline, sizeof(myline), "/dev/pty/%03d", *ptynum); snprintf(myline, sizeof(myline), "/dev/pty/%03d", *ptynum);
p = open(myline, 2); p = open(myline, 2);
@@ -856,7 +856,7 @@ void getptyslave(void)
#ifdef STREAMSPTY #ifdef STREAMSPTY
ttyfd = t; ttyfd = t;
/* /*
* Not all systems have (or need) modules ttcompat and pckt so * Not all systems have (or need) modules ttcompat and pckt so
@@ -876,7 +876,7 @@ void getptyslave(void)
pushed (via autopush, for instance). pushed (via autopush, for instance).
*/ */
char *ttymodules[] = { "ttcompat", "ldterm", "ptem", NULL }; char *ttymodules[] = { "ttcompat", "ldterm", "ptem", NULL };
char *ptymodules[] = { "pckt", NULL }; char *ptymodules[] = { "pckt", NULL };
@@ -1289,11 +1289,11 @@ start_login(const char *host, int autologin, char *name)
struct utmpx utmpx; struct utmpx utmpx;
struct timeval tv; struct timeval tv;
char *clean_tty; char *clean_tty;
/* /*
* Create utmp entry for child * Create utmp entry for child
*/ */
clean_tty = clean_ttyname(line); clean_tty = clean_ttyname(line);
memset(&utmpx, 0, sizeof(utmpx)); memset(&utmpx, 0, sizeof(utmpx));
strncpy(utmpx.ut_user, ".telnet", sizeof(utmpx.ut_user)); strncpy(utmpx.ut_user, ".telnet", sizeof(utmpx.ut_user));
@@ -1302,9 +1302,9 @@ start_login(const char *host, int autologin, char *name)
strncpy(utmpx.ut_id, make_id(clean_tty), sizeof(utmpx.ut_id)); strncpy(utmpx.ut_id, make_id(clean_tty), sizeof(utmpx.ut_id));
#endif #endif
utmpx.ut_pid = pid; utmpx.ut_pid = pid;
utmpx.ut_type = LOGIN_PROCESS; utmpx.ut_type = LOGIN_PROCESS;
gettimeofday (&tv, NULL); gettimeofday (&tv, NULL);
utmpx.ut_tv.tv_sec = tv.tv_sec; utmpx.ut_tv.tv_sec = tv.tv_sec;
utmpx.ut_tv.tv_usec = tv.tv_usec; utmpx.ut_tv.tv_usec = tv.tv_usec;
@@ -1315,7 +1315,7 @@ start_login(const char *host, int autologin, char *name)
#endif #endif
scrub_env(); scrub_env();
/* /*
* -h : pass on name of host. * -h : pass on name of host.
* WARNING: -h is accepted by login if and only if * WARNING: -h is accepted by login if and only if
@@ -1444,7 +1444,7 @@ rmut(void)
#elif defined(__osf__) /* XXX */ #elif defined(__osf__) /* XXX */
utxp->ut_exit.ut_termination = 0; utxp->ut_exit.ut_termination = 0;
utxp->ut_exit.ut_exit = 0; utxp->ut_exit.ut_exit = 0;
#else #else
utxp->ut_exit.e_termination = 0; utxp->ut_exit.e_termination = 0;
utxp->ut_exit.e_exit = 0; utxp->ut_exit.e_exit = 0;
#endif #endif

View File

@@ -338,7 +338,7 @@ main(int argc, char **argv)
case 'L': case 'L':
new_login = optarg; new_login = optarg;
break; break;
default: default:
fprintf(stderr, "telnetd: %c: unknown option\n", ch); fprintf(stderr, "telnetd: %c: unknown option\n", ch);
/* FALLTHROUGH */ /* FALLTHROUGH */

View File

@@ -922,28 +922,28 @@ printsub(int direction, unsigned char *pointer, size_t length)
output_data("VAR "); output_data("VAR ");
quote = 0; quote = 0;
break; break;
case NEW_ENV_VALUE: case NEW_ENV_VALUE:
if (quote) if (quote)
output_data("\" "); output_data("\" ");
output_data("VALUE "); output_data("VALUE ");
quote = 0; quote = 0;
break; break;
case ENV_ESC: case ENV_ESC:
if (quote) if (quote)
output_data("\" "); output_data("\" ");
output_data("ESC "); output_data("ESC ");
quote = 0; quote = 0;
break; break;
case ENV_USERVAR: case ENV_USERVAR:
if (quote) if (quote)
output_data("\" "); output_data("\" ");
output_data("USERVAR "); output_data("USERVAR ");
quote = 0; quote = 0;
break; break;
default: default:
if (isprint(pointer[i]) && pointer[i] != '"') { if (isprint(pointer[i]) && pointer[i] != '"') {
if (!quote) { if (!quote) {

View File

@@ -124,7 +124,7 @@ proto (int sock, const char *hostname, const char *service)
if (str == NULL) if (str == NULL)
errx(1, "malloc - out of memory"); errx(1, "malloc - out of memory");
name_token.value = str; name_token.value = str;
maj_stat = gss_import_name (&min_stat, maj_stat = gss_import_name (&min_stat,
&name_token, &name_token,
GSS_C_NT_HOSTBASED_SERVICE, GSS_C_NT_HOSTBASED_SERVICE,

View File

@@ -216,7 +216,7 @@ http_query(const char *host, const char *page,
break; break;
else if (ret < 0) else if (ret < 0)
err (1, "read: %lu", (unsigned long)ret); err (1, "read: %lu", (unsigned long)ret);
in_buf[ret + in_len] = '\0'; in_buf[ret + in_len] = '\0';
if (state == HEADER || state == RESPONSE) { if (state == HEADER || state == RESPONSE) {
@@ -362,7 +362,7 @@ main(int argc, char **argv)
if (verbose_flag) if (verbose_flag)
printf("Negotiate found\n"); printf("Negotiate found\n");
if (server == GSS_C_NO_NAME) { if (server == GSS_C_NO_NAME) {
char *name; char *name;
asprintf(&name, "%s@%s", gss_service, host); asprintf(&name, "%s@%s", gss_service, host);
@@ -474,7 +474,7 @@ main(int argc, char **argv)
base64_encode(output_token.value, base64_encode(output_token.value,
output_token.length, output_token.length,
&neg_token); &neg_token);
asprintf(&headers[0], "Authorization: Negotiate %s", asprintf(&headers[0], "Authorization: Negotiate %s",
neg_token); neg_token);

View File

@@ -107,7 +107,7 @@ gss_print_errors (int min_stat)
GSS_C_NO_OID, GSS_C_NO_OID,
&msg_ctx, &msg_ctx,
&status_string); &status_string);
fprintf (stderr, "%.*s\n", fprintf (stderr, "%.*s\n",
(int)status_string.length, (int)status_string.length,
(char *)status_string.value); (char *)status_string.value);
gss_release_buffer (&new_stat, &status_string); gss_release_buffer (&new_stat, &status_string);

View File

@@ -121,7 +121,7 @@ proto (int sock, const char *service)
NULL, NULL,
NULL, NULL,
NULL); NULL);
if (status) if (status)
krb5_err(context, 1, status, "krb5_sendauth"); krb5_err(context, 1, status, "krb5_sendauth");

View File

@@ -998,7 +998,7 @@ main (int argc, char **argv)
struct xxx{ struct xxx{
Pixel bg; Pixel bg;
}res; }res;
XtResource Res[] = { XtResource Res[] = {
{ XtNbackground, XtCBackground, XtRPixel, sizeof(Pixel), { XtNbackground, XtCBackground, XtRPixel, sizeof(Pixel),
XtOffsetOf(struct xxx, bg), XtRString, "black" } XtOffsetOf(struct xxx, bg), XtRString, "black" }
@@ -1072,7 +1072,7 @@ main (int argc, char **argv)
GrabModeAsync, XtWindow(widget), GrabModeAsync, XtWindow(widget),
None, CurrentTime)) != 0) None, CurrentTime)) != 0)
errx(1, "Failed to grab pointer (%d)", i); errx(1, "Failed to grab pointer (%d)", i);
if((i = XGrabKeyboard(dpy, XtWindow(widget), True, GrabModeAsync, if((i = XGrabKeyboard(dpy, XtWindow(widget), True, GrabModeAsync,
GrabModeAsync, CurrentTime)) != 0) GrabModeAsync, CurrentTime)) != 0)
errx(1, "Failed to grab keyboard (%d)", i); errx(1, "Failed to grab keyboard (%d)", i);

View File

@@ -120,7 +120,7 @@ heim_dict_create(size_t size)
heim_release(dict); heim_release(dict);
return NULL; return NULL;
} }
dict->tab = calloc(dict->size, sizeof(dict->tab[0])); dict->tab = calloc(dict->size, sizeof(dict->tab[0]));
if (dict->tab == NULL) { if (dict->tab == NULL) {
dict->size = 0; dict->size = 0;

View File

@@ -369,7 +369,7 @@ void
heim_abortv(const char *fmt, va_list ap) heim_abortv(const char *fmt, va_list ap)
{ {
static char str[1024]; static char str[1024];
vsnprintf(str, sizeof(str), fmt, ap); vsnprintf(str, sizeof(str), fmt, ap);
syslog(LOG_ERR, "heim_abort: %s", str); syslog(LOG_ERR, "heim_abort: %s", str);
abort(); abort();

View File

@@ -139,9 +139,9 @@ heim_json2base(const void *data, size_t length)
out: out:
if (ret && o) { if (ret && o) {
heim_release(o); heim_release(o);
o = NULL; o = NULL;
} }
return o; return o;
} }

View File

@@ -67,13 +67,13 @@
#define HEIMDAL_RWLOCK rwlock_t #define HEIMDAL_RWLOCK rwlock_t
#define HEIMDAL_RWLOCK_INITIALIZER RWLOCK_INITIALIZER #define HEIMDAL_RWLOCK_INITIALIZER RWLOCK_INITIALIZER
#define HEIMDAL_RWLOCK_init(l) rwlock_init(l, NULL) #define HEIMDAL_RWLOCK_init(l) rwlock_init(l, NULL)
#define HEIMDAL_RWLOCK_rdlock(l) rwlock_rdlock(l) #define HEIMDAL_RWLOCK_rdlock(l) rwlock_rdlock(l)
#define HEIMDAL_RWLOCK_wrlock(l) rwlock_wrlock(l) #define HEIMDAL_RWLOCK_wrlock(l) rwlock_wrlock(l)
#define HEIMDAL_RWLOCK_tryrdlock(l) rwlock_tryrdlock(l) #define HEIMDAL_RWLOCK_tryrdlock(l) rwlock_tryrdlock(l)
#define HEIMDAL_RWLOCK_trywrlock(l) rwlock_trywrlock(l) #define HEIMDAL_RWLOCK_trywrlock(l) rwlock_trywrlock(l)
#define HEIMDAL_RWLOCK_unlock(l) rwlock_unlock(l) #define HEIMDAL_RWLOCK_unlock(l) rwlock_unlock(l)
#define HEIMDAL_RWLOCK_destroy(l) rwlock_destroy(l) #define HEIMDAL_RWLOCK_destroy(l) rwlock_destroy(l)
#define HEIMDAL_thread_key thread_key_t #define HEIMDAL_thread_key thread_key_t
#define HEIMDAL_key_create(k,d,r) do { r = thr_keycreate(k,d); } while(0) #define HEIMDAL_key_create(k,d,r) do { r = thr_keycreate(k,d); } while(0)
@@ -94,13 +94,13 @@
#define HEIMDAL_RWLOCK rwlock_t #define HEIMDAL_RWLOCK rwlock_t
#define HEIMDAL_RWLOCK_INITIALIZER RWLOCK_INITIALIZER #define HEIMDAL_RWLOCK_INITIALIZER RWLOCK_INITIALIZER
#define HEIMDAL_RWLOCK_init(l) pthread_rwlock_init(l, NULL) #define HEIMDAL_RWLOCK_init(l) pthread_rwlock_init(l, NULL)
#define HEIMDAL_RWLOCK_rdlock(l) pthread_rwlock_rdlock(l) #define HEIMDAL_RWLOCK_rdlock(l) pthread_rwlock_rdlock(l)
#define HEIMDAL_RWLOCK_wrlock(l) pthread_rwlock_wrlock(l) #define HEIMDAL_RWLOCK_wrlock(l) pthread_rwlock_wrlock(l)
#define HEIMDAL_RWLOCK_tryrdlock(l) pthread_rwlock_tryrdlock(l) #define HEIMDAL_RWLOCK_tryrdlock(l) pthread_rwlock_tryrdlock(l)
#define HEIMDAL_RWLOCK_trywrlock(l) pthread_rwlock_trywrlock(l) #define HEIMDAL_RWLOCK_trywrlock(l) pthread_rwlock_trywrlock(l)
#define HEIMDAL_RWLOCK_unlock(l) pthread_rwlock_unlock(l) #define HEIMDAL_RWLOCK_unlock(l) pthread_rwlock_unlock(l)
#define HEIMDAL_RWLOCK_destroy(l) pthread_rwlock_destroy(l) #define HEIMDAL_RWLOCK_destroy(l) pthread_rwlock_destroy(l)
#define HEIMDAL_thread_key pthread_key_t #define HEIMDAL_thread_key pthread_key_t
#define HEIMDAL_key_create(k,d,r) do { r = pthread_key_create(k,d); } while(0) #define HEIMDAL_key_create(k,d,r) do { r = pthread_key_create(k,d); } while(0)

View File

@@ -158,7 +158,7 @@ cpw_entry(struct passwd_options *opt, int argc, char **argv)
"--random-key, --random-password, --password, --key\n"); "--random-key, --random-password, --password, --key\n");
return 1; return 1;
} }
if (opt->key_string) { if (opt->key_string) {
const char *error; const char *error;

View File

@@ -171,23 +171,23 @@ format_field(kadm5_principal_ent_t princ, unsigned int field,
case KADM5_PRINC_EXPIRE_TIME: case KADM5_PRINC_EXPIRE_TIME:
time_t2str(princ->princ_expire_time, buf, buf_len, !condensed); time_t2str(princ->princ_expire_time, buf, buf_len, !condensed);
break; break;
case KADM5_PW_EXPIRATION: case KADM5_PW_EXPIRATION:
time_t2str(princ->pw_expiration, buf, buf_len, !condensed); time_t2str(princ->pw_expiration, buf, buf_len, !condensed);
break; break;
case KADM5_LAST_PWD_CHANGE: case KADM5_LAST_PWD_CHANGE:
time_t2str(princ->last_pwd_change, buf, buf_len, !condensed); time_t2str(princ->last_pwd_change, buf, buf_len, !condensed);
break; break;
case KADM5_MAX_LIFE: case KADM5_MAX_LIFE:
deltat2str(princ->max_life, buf, buf_len); deltat2str(princ->max_life, buf, buf_len);
break; break;
case KADM5_MAX_RLIFE: case KADM5_MAX_RLIFE:
deltat2str(princ->max_renewable_life, buf, buf_len); deltat2str(princ->max_renewable_life, buf, buf_len);
break; break;
case KADM5_MOD_TIME: case KADM5_MOD_TIME:
time_t2str(princ->mod_date, buf, buf_len, !condensed); time_t2str(princ->mod_date, buf, buf_len, !condensed);
break; break;
@@ -489,7 +489,7 @@ getit(struct get_options *opt, const char *name, int argc, char **argv)
ret = setup_columns(&data, DEFAULT_COLUMNS_SHORT); ret = setup_columns(&data, DEFAULT_COLUMNS_SHORT);
} else } else
ret = setup_columns(&data, opt->column_info_string); ret = setup_columns(&data, opt->column_info_string);
if(ret != 0) { if(ret != 0) {
if(data.table != NULL) if(data.table != NULL)
rtbl_destroy(data.table); rtbl_destroy(data.table);

View File

@@ -222,8 +222,8 @@ Possible attributes are:
.Li disallow-forwardable , .Li disallow-forwardable ,
.Li disallow-postdated .Li disallow-postdated
.Pp .Pp
Attributes may be negated with a "-", e.g., Attributes may be negated with a "-", e.g.,
.Pp .Pp
kadmin -l modify -a -disallow-proxiable user kadmin -l modify -a -disallow-proxiable user
.Ed .Ed
.Pp .Pp

View File

@@ -63,15 +63,15 @@ static struct getargs args[] = {
"key-file", 'k', arg_string, &keyfile, "key-file", 'k', arg_string, &keyfile,
"location of master key file", "file" "location of master key file", "file"
}, },
{ {
"realm", 'r', arg_string, &realm, "realm", 'r', arg_string, &realm,
"realm to use", "realm" "realm to use", "realm"
}, },
{ {
"admin-server", 'a', arg_string, &admin_server, "admin-server", 'a', arg_string, &admin_server,
"server to contact", "host" "server to contact", "host"
}, },
{ {
"server-port", 's', arg_integer, &server_port, "server-port", 's', arg_integer, &server_port,
"port to use", "port number" "port to use", "port number"
}, },
@@ -211,7 +211,7 @@ main(int argc, char **argv)
kadm5_setup_passwd_quality_check (context, kadm5_setup_passwd_quality_check (context,
check_library, check_function); check_library, check_function);
for (i = 0; i < policy_libraries.num_strings; i++) { for (i = 0; i < policy_libraries.num_strings; i++) {
ret = kadm5_add_passwd_quality_verifier(context, ret = kadm5_add_passwd_quality_verifier(context,
policy_libraries.strings[i]); policy_libraries.strings[i]);
@@ -221,7 +221,7 @@ main(int argc, char **argv)
ret = kadm5_add_passwd_quality_verifier(context, NULL); ret = kadm5_add_passwd_quality_verifier(context, NULL);
if (ret) if (ret)
krb5_err(context, 1, ret, "kadm5_add_passwd_quality_verifier"); krb5_err(context, 1, ret, "kadm5_add_passwd_quality_verifier");
ret = kadm5_s_init_with_password_ctx(context, ret = kadm5_s_init_with_password_ctx(context,
KADM5_ADMIN_SERVICE, KADM5_ADMIN_SERVICE,
NULL, NULL,

View File

@@ -1,34 +1,34 @@
.\" Copyright (c) 2002 - 2004 Kungliga Tekniska Högskolan .\" Copyright (c) 2002 - 2004 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden). .\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions
.\" are met: .\" are met:
.\" .\"
.\" 1. Redistributions of source code must retain the above copyright .\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer. .\" notice, this list of conditions and the following disclaimer.
.\" .\"
.\" 2. Redistributions in binary form must reproduce the above copyright .\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the .\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution. .\" documentation and/or other materials provided with the distribution.
.\" .\"
.\" 3. Neither the name of the Institute nor the names of its contributors .\" 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 .\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission. .\" 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$ .\" $Id$
.\" .\"
.Dd December 8, 2004 .Dd December 8, 2004

View File

@@ -162,7 +162,7 @@ main(int argc, char **argv)
if(debug_flag) { if(debug_flag) {
int debug_port; int debug_port;
if(port_str == NULL) if(port_str == NULL)
debug_port = krb5_getportbyname (context, "kerberos-adm", debug_port = krb5_getportbyname (context, "kerberos-adm",
"tcp", 749); "tcp", 749);

View File

@@ -205,7 +205,7 @@ parse_keys(hdb_entry *ent, char *str)
if (key->salt == NULL) if (key->salt == NULL)
krb5_errx (context, 1, "malloc: out of memory"); krb5_errx (context, 1, "malloc: out of memory");
key->salt->type = type; key->salt->type = type;
if (p_len) { if (p_len) {
if(*p == '\"') { if(*p == '\"') {
ret = krb5_data_copy(&key->salt->salt, p + 1, p_len - 2); 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); p = skip_next(p);
e.key = p; e.key = p;
p = skip_next(p); p = skip_next(p);
@@ -454,14 +454,14 @@ doit(const char *filename, int mergep)
krb5_free_error_message(context, msg); krb5_free_error_message(context, msg);
continue; continue;
} }
if (parse_keys(&ent.entry, e.key)) { if (parse_keys(&ent.entry, e.key)) {
fprintf (stderr, "%s:%d:error parsing keys (%s)\n", fprintf (stderr, "%s:%d:error parsing keys (%s)\n",
filename, line, e.key); filename, line, e.key);
hdb_free_entry (context, &ent); hdb_free_entry (context, &ent);
continue; continue;
} }
if (parse_event(&ent.entry.created_by, e.created) == -1) { if (parse_event(&ent.entry.created_by, e.created) == -1) {
fprintf (stderr, "%s:%d:error parsing created event (%s)\n", fprintf (stderr, "%s:%d:error parsing created event (%s)\n",
filename, line, e.created); filename, line, e.created);

View File

@@ -63,7 +63,7 @@ add_constrained_delegation(krb5_context contextp,
HDB_extension ext; HDB_extension ext;
krb5_data buf; krb5_data buf;
size_t size = 0; size_t size = 0;
memset(&ext, 0, sizeof(ext)); memset(&ext, 0, sizeof(ext));
ext.mandatory = FALSE; ext.mandatory = FALSE;
ext.data.element = choice_HDB_extension_data_allowed_to_delegate_to; 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, calloc(strings->num_strings,
sizeof(ext.data.u.allowed_to_delegate_to.val[0])); sizeof(ext.data.u.allowed_to_delegate_to.val[0]));
ext.data.u.allowed_to_delegate_to.len = strings->num_strings; ext.data.u.allowed_to_delegate_to.len = strings->num_strings;
for (i = 0; i < strings->num_strings; i++) { for (i = 0; i < strings->num_strings; i++) {
ret = krb5_parse_name(contextp, strings->strings[i], &p); ret = krb5_parse_name(contextp, strings->strings[i], &p);
if (ret) if (ret)
@@ -126,7 +126,7 @@ add_aliases(krb5_context contextp, kadm5_principal_ent_rec *princ,
calloc(strings->num_strings, calloc(strings->num_strings,
sizeof(ext.data.u.aliases.aliases.val[0])); sizeof(ext.data.u.aliases.aliases.val[0]));
ext.data.u.aliases.aliases.len = strings->num_strings; ext.data.u.aliases.aliases.len = strings->num_strings;
for (i = 0; i < strings->num_strings; i++) { for (i = 0; i < strings->num_strings; i++) {
ret = krb5_parse_name(contextp, strings->strings[i], &p); ret = krb5_parse_name(contextp, strings->strings[i], &p);
ret = copy_Principal(p, &ext.data.u.aliases.aliases.val[i]); 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, calloc(strings->num_strings,
sizeof(ext.data.u.pkinit_acl.val[0])); sizeof(ext.data.u.pkinit_acl.val[0]));
ext.data.u.pkinit_acl.len = strings->num_strings; ext.data.u.pkinit_acl.len = strings->num_strings;
for (i = 0; i < strings->num_strings; i++) { for (i = 0; i < strings->num_strings; i++) {
ext.data.u.pkinit_acl.val[i].subject = estrdup(strings->strings[i]); ext.data.u.pkinit_acl.val[i].subject = estrdup(strings->strings[i]);
} }

View File

@@ -109,47 +109,47 @@ parse_name(const unsigned char *p, size_t len,
const gss_OID oid, char **name) const gss_OID oid, char **name)
{ {
size_t l; size_t l;
if (len < 4) if (len < 4)
return 1; return 1;
/* TOK_ID */ /* TOK_ID */
if (memcmp(p, "\x04\x01", 2) != 0) if (memcmp(p, "\x04\x01", 2) != 0)
return 1; return 1;
len -= 2; len -= 2;
p += 2; p += 2;
/* MECH_LEN */ /* MECH_LEN */
l = (p[0] << 8) | p[1]; l = (p[0] << 8) | p[1];
len -= 2; len -= 2;
p += 2; p += 2;
if (l < 2 || len < l) if (l < 2 || len < l)
return 1; return 1;
/* oid wrapping */ /* oid wrapping */
if (p[0] != 6 || p[1] != l - 2) if (p[0] != 6 || p[1] != l - 2)
return 1; return 1;
p += 2; p += 2;
l -= 2; l -= 2;
len -= 2; len -= 2;
/* MECH */ /* MECH */
if (l != oid->length || memcmp(p, oid->elements, oid->length) != 0) if (l != oid->length || memcmp(p, oid->elements, oid->length) != 0)
return 1; return 1;
len -= l; len -= l;
p += l; p += l;
/* MECHNAME_LEN */ /* MECHNAME_LEN */
if (len < 4) if (len < 4)
return 1; return 1;
l = p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3]; l = p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3];
len -= 4; len -= 4;
p += 4; p += 4;
/* MECH NAME */ /* MECH NAME */
if (len != l) if (len != l)
return 1; return 1;
*name = malloc(l + 1); *name = malloc(l + 1);
INSIST(*name != NULL); INSIST(*name != NULL);
memcpy(*name, p, l); memcpy(*name, p, l);
@@ -184,7 +184,7 @@ gss_error(krb5_context contextp,
} }
static void static void
gss_print_errors (krb5_context contextp, gss_print_errors (krb5_context contextp,
OM_uint32 maj_stat, OM_uint32 min_stat) OM_uint32 maj_stat, OM_uint32 min_stat)
{ {
gss_error(contextp, GSS_C_NO_OID, GSS_C_GSS_CODE, maj_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)) if (tlen > sizeof(buf))
tlen = sizeof(buf); tlen = sizeof(buf);
slen = krb5_storage_read(sp, buf, tlen); slen = krb5_storage_read(sp, buf, tlen);
INSIST((size_t)slen == tlen); INSIST((size_t)slen == tlen);
slen = krb5_storage_write(msg, buf, tlen); slen = krb5_storage_write(msg, buf, tlen);
INSIST((size_t)slen == tlen); INSIST((size_t)slen == tlen);
len -= tlen; len -= tlen;
} }
return 0; return 0;
@@ -226,7 +226,7 @@ collect_framents(krb5_storage *sp, krb5_storage *msg)
ret = krb5_ret_uint32(sp, &len); ret = krb5_ret_uint32(sp, &len);
if (ret) if (ret)
return ret; return ret;
last_fragment = (len & LAST_FRAGMENT); last_fragment = (len & 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; c.length = strlen(str) + 1;
} else } else
krb5_data_zero(&c); krb5_data_zero(&c);
return store_data_xdr(sp, c); return store_data_xdr(sp, c);
} }
@@ -512,7 +512,7 @@ ret_principal_ent(krb5_context contextp,
} else { } else {
INSIST(ent->n_tl_data == 0); INSIST(ent->n_tl_data == 0);
} }
CHECK(krb5_ret_uint32(sp, &num)); CHECK(krb5_ret_uint32(sp, &num));
INSIST(num == (uint32_t)ent->n_key_data); INSIST(num == (uint32_t)ent->n_key_data);
@@ -637,7 +637,7 @@ proc_get_principal(kadm5_server_context *contextp,
static void static void
proc_chrand_principal_v2(kadm5_server_context *contextp, proc_chrand_principal_v2(kadm5_server_context *contextp,
krb5_storage *in, krb5_storage *in,
krb5_storage *out) krb5_storage *out)
{ {
krb5_error_code ret; krb5_error_code ret;
@@ -741,7 +741,7 @@ struct gctx {
}; };
static int static int
process_stream(krb5_context contextp, process_stream(krb5_context contextp,
unsigned char *buf, size_t ilen, unsigned char *buf, size_t ilen,
krb5_storage *sp) krb5_storage *sp)
{ {
@@ -798,11 +798,11 @@ process_stream(krb5_context contextp,
buf = tmp; buf = tmp;
} }
INSIST(ilen >= 4); INSIST(ilen >= 4);
_krb5_get_int(buf, &len, 4); _krb5_get_int(buf, &len, 4);
last_fragment = (len & LAST_FRAGMENT) != 0; last_fragment = (len & LAST_FRAGMENT) != 0;
len &= ~LAST_FRAGMENT; len &= ~LAST_FRAGMENT;
ilen -= 4; ilen -= 4;
buf += 4; buf += 4;
@@ -820,7 +820,7 @@ process_stream(krb5_context contextp,
} }
CHECK(read_data(sp, msg, len)); CHECK(read_data(sp, msg, len));
if (!last_fragment) { if (!last_fragment) {
ret = collect_framents(sp, msg); ret = collect_framents(sp, msg);
if (ret == HEIM_ERR_EOF) if (ret == HEIM_ERR_EOF)
@@ -880,7 +880,7 @@ process_stream(krb5_context contextp,
INSIST(gctx.done); INSIST(gctx.done);
INSIST(krb5_data_cmp(&gcred.handle, &gctx.handle) == 0); INSIST(krb5_data_cmp(&gcred.handle, &gctx.handle) == 0);
CHECK(ret_data_xdr(msg, &data)); CHECK(ret_data_xdr(msg, &data));
gin.value = data.data; gin.value = data.data;
@@ -904,7 +904,7 @@ process_stream(krb5_context contextp,
INSIST(seq > gctx.seq_num); INSIST(seq > gctx.seq_num);
gctx.seq_num = seq; gctx.seq_num = seq;
/* /*
* If contextp is setup, priv data have the seq_num stored * If contextp is setup, priv data have the seq_num stored
* first in the block, so add it here before users data is * first in the block, so add it here before users data is
* added. * added.
@@ -914,7 +914,7 @@ process_stream(krb5_context contextp,
if (chdr.proc >= sizeof(procs)/sizeof(procs[0])) { if (chdr.proc >= sizeof(procs)/sizeof(procs[0])) {
krb5_warnx(contextp, "proc number out of array"); krb5_warnx(contextp, "proc number out of array");
} else if (procs[chdr.proc].func == NULL) { } 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); procs[chdr.proc].name);
} else { } else {
krb5_warnx(contextp, "proc %s", procs[chdr.proc].name); krb5_warnx(contextp, "proc %s", procs[chdr.proc].name);
@@ -946,7 +946,7 @@ process_stream(krb5_context contextp,
gout.length = 0; gout.length = 0;
maj_stat = gss_accept_sec_context(&min_stat, maj_stat = gss_accept_sec_context(&min_stat,
&gctx.ctx, &gctx.ctx,
GSS_C_NO_CREDENTIAL, GSS_C_NO_CREDENTIAL,
&gin, &gin,
GSS_C_NO_CHANNEL_BINDINGS, GSS_C_NO_CHANNEL_BINDINGS,
@@ -966,13 +966,13 @@ process_stream(krb5_context contextp,
char *client; char *client;
gctx.done = 1; gctx.done = 1;
memset(&realm_params, 0, sizeof(realm_params)); memset(&realm_params, 0, sizeof(realm_params));
maj_stat = gss_export_name(&min_stat, src_name, &bufp); maj_stat = gss_export_name(&min_stat, src_name, &bufp);
INSIST(maj_stat == GSS_S_COMPLETE); 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_KRB5_MECHANISM, &client));
gss_release_buffer(&min_stat, &bufp); gss_release_buffer(&min_stat, &bufp);
@@ -992,7 +992,7 @@ process_stream(krb5_context contextp,
INSIST(gctx.ctx != GSS_C_NO_CONTEXT); INSIST(gctx.ctx != GSS_C_NO_CONTEXT);
CHECK(krb5_store_uint32(dreply, 0)); 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)); maj_stat, min_stat, 1, &gout));
if (gout.value) if (gout.value)
gss_release_buffer(&min_stat, &gout); gss_release_buffer(&min_stat, &gout);
@@ -1004,7 +1004,7 @@ process_stream(krb5_context contextp,
case RPG_DESTROY: case RPG_DESTROY:
krb5_errx(contextp, 1, "client destroyed gss contextp"); krb5_errx(contextp, 1, "client destroyed gss contextp");
default: default:
krb5_errx(contextp, 1, "client sent unknown gsscode %d", krb5_errx(contextp, 1, "client sent unknown gsscode %d",
(int)gcred.proc); (int)gcred.proc);
} }
@@ -1061,16 +1061,16 @@ process_stream(krb5_context contextp,
gin.value = data.data; gin.value = data.data;
gin.length = data.length; gin.length = data.length;
maj_stat = gss_wrap(&min_stat, gctx.ctx, 1, 0, maj_stat = gss_wrap(&min_stat, gctx.ctx, 1, 0,
&gin, &conf_state, &gout); &gin, &conf_state, &gout);
INSIST(maj_stat == GSS_S_COMPLETE); INSIST(maj_stat == GSS_S_COMPLETE);
INSIST(conf_state != 0); INSIST(conf_state != 0);
krb5_data_free(&data); krb5_data_free(&data);
data.data = gout.value; data.data = gout.value;
data.length = gout.length; data.length = gout.length;
store_data_xdr(reply, data); store_data_xdr(reply, data);
gss_release_buffer(&min_stat, &gout); 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); sp = krb5_storage_from_fd(sock);
INSIST(sp != NULL); INSIST(sp != NULL);
process_stream(contextp, buf, len, sp); process_stream(contextp, buf, len, sp);
return 0; return 0;

View File

@@ -115,7 +115,7 @@ stash(struct stash_options *opt, int argc, char **argv)
ret = ENOMEM; ret = ENOMEM;
goto out; goto out;
} }
if(unlink(new) < 0 && errno != ENOENT) { if(unlink(new) < 0 && errno != ENOENT) {
ret = errno; ret = errno;
goto out; goto out;

View File

@@ -67,7 +67,7 @@ kcm_ccache_acquire(krb5_context context,
ccache->name); ccache->name);
return KRB5_FCC_INTERNAL; return KRB5_FCC_INTERNAL;
} }
HEIMDAL_MUTEX_lock(&ccache->mutex); HEIMDAL_MUTEX_lock(&ccache->mutex);
/* Fake up an internal ccache */ /* Fake up an internal ccache */

View File

@@ -168,7 +168,7 @@ krb5_error_code kcm_debug_ccache(krb5_context context)
krb5_unparse_name(context, p->client, &cpn); krb5_unparse_name(context, p->client, &cpn);
if (p->server != NULL) if (p->server != NULL)
krb5_unparse_name(context, p->server, &spn); krb5_unparse_name(context, p->server, &spn);
kcm_log(7, "cache %08x: name %s refcnt %d flags %04x mode %04o " kcm_log(7, "cache %08x: name %s refcnt %d flags %04x mode %04o "
"uid %d gid %d client %s server %s ncreds %d", "uid %d gid %d client %s server %s ncreds %d",
p, p->name, p->refcnt, p->flags, p->mode, p->uid, p->gid, p, p->name, p->refcnt, p->flags, p->mode, p->uid, p->gid,

View File

@@ -114,7 +114,7 @@ kcm_ccache_new_client(krb5_context context,
if (bad && !CLIENT_IS_ROOT(client)) if (bad && !CLIENT_IS_ROOT(client))
return KRB5_CC_BADNAME; return KRB5_CC_BADNAME;
} }
ret = kcm_ccache_resolve(context, name, &ccache); ret = kcm_ccache_resolve(context, name, &ccache);
if (ret == 0) { if (ret == 0) {
if ((ccache->uid != client->uid || if ((ccache->uid != client->uid ||

View File

@@ -357,7 +357,7 @@ kcm_configure(int argc, char **argv)
ret = krb5_prepend_config_files_default(config_file, &files); ret = krb5_prepend_config_files_default(config_file, &files);
if (ret) if (ret)
krb5_err(kcm_context, 1, ret, "getting configuration files"); krb5_err(kcm_context, 1, ret, "getting configuration files");
ret = krb5_set_config_files(kcm_context, files); ret = krb5_set_config_files(kcm_context, files);
krb5_free_config_files(files); krb5_free_config_files(files);
if(ret) if(ret)

View File

@@ -74,7 +74,7 @@ kcm_service(void *ctx, const heim_idata *req,
request.data = buf + 2; request.data = buf + 2;
request.length = len - 2; request.length = len - 2;
/* buf is now pointing at opcode */ /* buf is now pointing at opcode */
ret = kcm_dispatch(kcm_context, &peercred, &request, &rep); ret = kcm_dispatch(kcm_context, &peercred, &request, &rep);

View File

@@ -1,33 +1,33 @@
.\" Copyright (c) 2005 Kungliga Tekniska Högskolan .\" Copyright (c) 2005 Kungliga Tekniska Högskolan
.\" (Royal Institute of Technology, Stockholm, Sweden). .\" (Royal Institute of Technology, Stockholm, Sweden).
.\" All rights reserved. .\" All rights reserved.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions
.\" are met: .\" are met:
.\" .\"
.\" 1. Redistributions of source code must retain the above copyright .\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer. .\" notice, this list of conditions and the following disclaimer.
.\" .\"
.\" 2. Redistributions in binary form must reproduce the above copyright .\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the .\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution. .\" documentation and/or other materials provided with the distribution.
.\" .\"
.\" 3. Neither the name of the Institute nor the names of its contributors .\" 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 .\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission. .\" without specific prior written permission.
.\" .\"
.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND .\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" 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 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.\" $Id$ .\" $Id$
.\" .\"
@@ -122,7 +122,7 @@ The
daemon can also keep a SYSTEM credential that server processes can daemon can also keep a SYSTEM credential that server processes can
use to access services. One example of usage might be an nss_ldap use to access services. One example of usage might be an nss_ldap
module that quickly needs to get credentials and doesn't want to renew module that quickly needs to get credentials and doesn't want to renew
the ticket itself. the ticket itself.
.Pp .Pp
Supported options: Supported options:
.Bl -tag -width Ds .Bl -tag -width Ds

View File

@@ -59,7 +59,7 @@ kcm_op_noop(krb5_context context,
{ {
KCM_LOG_REQUEST(context, client, opcode); KCM_LOG_REQUEST(context, client, opcode);
return 0; return 0;
} }
/* /*
@@ -108,7 +108,7 @@ kcm_op_get_name(krb5_context context,
/* /*
* Request: * Request:
* *
* Response: * Response:
* NameZ * NameZ
*/ */
@@ -139,9 +139,9 @@ kcm_op_gen_new(krb5_context context,
* Request: * Request:
* NameZ * NameZ
* Principal * Principal
* *
* Response: * Response:
* *
*/ */
static krb5_error_code static krb5_error_code
kcm_op_initialize(krb5_context context, kcm_op_initialize(krb5_context context,
@@ -205,9 +205,9 @@ kcm_op_initialize(krb5_context context,
/* /*
* Request: * Request:
* NameZ * NameZ
* *
* Response: * Response:
* *
*/ */
static krb5_error_code static krb5_error_code
kcm_op_destroy(krb5_context context, kcm_op_destroy(krb5_context context,
@@ -238,9 +238,9 @@ kcm_op_destroy(krb5_context context,
* Request: * Request:
* NameZ * NameZ
* Creds * Creds
* *
* Response: * Response:
* *
*/ */
static krb5_error_code static krb5_error_code
kcm_op_store(krb5_context context, kcm_op_store(krb5_context context,
@@ -298,7 +298,7 @@ kcm_op_store(krb5_context context,
* *
* Response: * Response:
* Creds * Creds
* *
*/ */
static krb5_error_code static krb5_error_code
kcm_op_retrieve(krb5_context context, kcm_op_retrieve(krb5_context context,
@@ -432,7 +432,7 @@ kcm_op_get_principal(krb5_context context,
* *
* Response: * Response:
* UUIDs * UUIDs
* *
*/ */
static krb5_error_code static krb5_error_code
kcm_op_get_cred_uuid_list(krb5_context context, kcm_op_get_cred_uuid_list(krb5_context context,
@@ -535,7 +535,7 @@ kcm_op_get_cred_by_uuid(krb5_context context,
* MatchCreds * MatchCreds
* *
* Response: * Response:
* *
*/ */
static krb5_error_code static krb5_error_code
kcm_op_remove_cred(krb5_context context, kcm_op_remove_cred(krb5_context context,
@@ -593,7 +593,7 @@ kcm_op_remove_cred(krb5_context context,
* Flags * Flags
* *
* Response: * Response:
* *
*/ */
static krb5_error_code static krb5_error_code
kcm_op_set_flags(krb5_context context, kcm_op_set_flags(krb5_context context,
@@ -640,7 +640,7 @@ kcm_op_set_flags(krb5_context context,
* GID * GID
* *
* Response: * Response:
* *
*/ */
static krb5_error_code static krb5_error_code
kcm_op_chown(krb5_context context, kcm_op_chown(krb5_context context,
@@ -694,7 +694,7 @@ kcm_op_chown(krb5_context context,
* Mode * Mode
* *
* Response: * Response:
* *
*/ */
static krb5_error_code static krb5_error_code
kcm_op_chmod(krb5_context context, kcm_op_chmod(krb5_context context,
@@ -1257,7 +1257,7 @@ find_ntlm_cred(const char *user, const char *domain, kcm_client *client)
struct kcm_ntlm_cred *c; struct kcm_ntlm_cred *c;
for (c = ntlm_head; c != NULL; c = c->next) for (c = ntlm_head; c != NULL; c = c->next)
if ((user[0] == '\0' || strcmp(user, c->user) == 0) && if ((user[0] == '\0' || strcmp(user, c->user) == 0) &&
(domain == NULL || strcmp(domain, c->domain) == 0) && (domain == NULL || strcmp(domain, c->domain) == 0) &&
kcm_is_same_session(client, c->uid, c->session)) kcm_is_same_session(client, c->uid, c->session))
return c; return c;
@@ -1448,7 +1448,7 @@ kcm_op_do_ntlm(krb5_context context,
memset(&type3, 0, sizeof(type3)); memset(&type3, 0, sizeof(type3));
sessionkey.data = NULL; sessionkey.data = NULL;
sessionkey.length = 0; sessionkey.length = 0;
ret = krb5_ret_stringz(request, &user); ret = krb5_ret_stringz(request, &user);
if (ret) if (ret)
goto error; goto error;
@@ -1489,22 +1489,22 @@ kcm_op_do_ntlm(krb5_context context,
type3.flags = type2.flags; type3.flags = type2.flags;
type3.targetname = type2.targetname; type3.targetname = type2.targetname;
type3.ws = rk_UNCONST("workstation"); type3.ws = rk_UNCONST("workstation");
/* /*
* NTLM Version 1 if no targetinfo buffer. * NTLM Version 1 if no targetinfo buffer.
*/ */
if (1 || type2.targetinfo.length == 0) { if (1 || type2.targetinfo.length == 0) {
struct ntlm_buf sessionkey; struct ntlm_buf sessionkey;
if (type2.flags & NTLM_NEG_NTLM2_SESSION) { if (type2.flags & NTLM_NEG_NTLM2_SESSION) {
unsigned char nonce[8]; unsigned char nonce[8];
if (RAND_bytes(nonce, sizeof(nonce)) != 1) { if (RAND_bytes(nonce, sizeof(nonce)) != 1) {
ret = EINVAL; ret = EINVAL;
goto error; goto error;
} }
ret = heim_ntlm_calculate_ntlm2_sess(nonce, ret = heim_ntlm_calculate_ntlm2_sess(nonce,
type2.challenge, type2.challenge,
c->nthash.data, c->nthash.data,
@@ -1515,11 +1515,11 @@ kcm_op_do_ntlm(krb5_context context,
c->nthash.length, c->nthash.length,
type2.challenge, type2.challenge,
&type3.ntlm); &type3.ntlm);
} }
if (ret) if (ret)
goto error; goto error;
ret = heim_ntlm_build_ntlm1_master(c->nthash.data, ret = heim_ntlm_build_ntlm1_master(c->nthash.data,
c->nthash.length, c->nthash.length,
&sessionkey, &sessionkey,
@@ -1541,14 +1541,14 @@ kcm_op_do_ntlm(krb5_context context,
goto error; goto error;
} }
flags |= NTLM_FLAG_SESSIONKEY; flags |= NTLM_FLAG_SESSIONKEY;
#if 0 #if 0
} else { } else {
struct ntlm_buf sessionkey; struct ntlm_buf sessionkey;
unsigned char ntlmv2[16]; unsigned char ntlmv2[16];
struct ntlm_targetinfo ti; struct ntlm_targetinfo ti;
/* verify infotarget */ /* verify infotarget */
ret = heim_ntlm_decode_targetinfo(&type2.targetinfo, 1, &ti); ret = heim_ntlm_decode_targetinfo(&type2.targetinfo, 1, &ti);
if(ret) { if(ret) {
_gss_ntlm_delete_sec_context(minor_status, _gss_ntlm_delete_sec_context(minor_status,
@@ -1556,14 +1556,14 @@ kcm_op_do_ntlm(krb5_context context,
*minor_status = ret; *minor_status = ret;
return GSS_S_FAILURE; return GSS_S_FAILURE;
} }
if (ti.domainname && strcmp(ti.domainname, name->domain) != 0) { if (ti.domainname && strcmp(ti.domainname, name->domain) != 0) {
_gss_ntlm_delete_sec_context(minor_status, _gss_ntlm_delete_sec_context(minor_status,
context_handle, NULL); context_handle, NULL);
*minor_status = EINVAL; *minor_status = EINVAL;
return GSS_S_FAILURE; return GSS_S_FAILURE;
} }
ret = heim_ntlm_calculate_ntlm2(ctx->client->key.data, ret = heim_ntlm_calculate_ntlm2(ctx->client->key.data,
ctx->client->key.length, ctx->client->key.length,
type3.username, type3.username,
@@ -1578,7 +1578,7 @@ kcm_op_do_ntlm(krb5_context context,
*minor_status = ret; *minor_status = ret;
return GSS_S_FAILURE; return GSS_S_FAILURE;
} }
ret = heim_ntlm_build_ntlm1_master(ntlmv2, sizeof(ntlmv2), ret = heim_ntlm_build_ntlm1_master(ntlmv2, sizeof(ntlmv2),
&sessionkey, &sessionkey,
&type3.sessionkey); &type3.sessionkey);
@@ -1589,10 +1589,10 @@ kcm_op_do_ntlm(krb5_context context,
*minor_status = ret; *minor_status = ret;
return GSS_S_FAILURE; return GSS_S_FAILURE;
} }
flags |= NTLM_FLAG_NTLM2_SESSION | flags |= NTLM_FLAG_NTLM2_SESSION |
NTLM_FLAG_SESSION; NTLM_FLAG_SESSION;
if (type3.flags & NTLM_NEG_KEYEX) if (type3.flags & NTLM_NEG_KEYEX)
flags |= NTLM_FLAG_KEYEX; flags |= NTLM_FLAG_KEYEX;
@@ -1607,7 +1607,7 @@ kcm_op_do_ntlm(krb5_context context,
} }
#endif #endif
} }
#if 0 #if 0
if (flags & NTLM_FLAG_NTLM2_SESSION) { if (flags & NTLM_FLAG_NTLM2_SESSION) {
_gss_ntlm_set_key(&ctx->u.v2.send, 0, (ctx->flags & NTLM_NEG_KEYEX), _gss_ntlm_set_key(&ctx->u.v2.send, 0, (ctx->flags & NTLM_NEG_KEYEX),
@@ -1630,7 +1630,7 @@ kcm_op_do_ntlm(krb5_context context,
ret = heim_ntlm_encode_type3(&type3, &ndata); ret = heim_ntlm_encode_type3(&type3, &ndata);
if (ret) if (ret)
goto error; goto error;
data.data = ndata.data; data.data = ndata.data;
data.length = ndata.length; data.length = ndata.length;
ret = krb5_store_data(response, data); ret = krb5_store_data(response, data);

View File

@@ -62,18 +62,18 @@ kcm_session_setup_handler(void)
for (;;) { for (;;) {
auditinfo_addr_t aio; auditinfo_addr_t aio;
int event; int event;
if (au_sdev_read_aia(h, &event, &aio) != 0) if (au_sdev_read_aia(h, &event, &aio) != 0)
continue; continue;
/* /*
* Ignore everything but END. This should relly be * Ignore everything but END. This should relly be
* CLOSE but since that is delayed until the credential * CLOSE but since that is delayed until the credential
* is reused, we can't do that * is reused, we can't do that
* */ * */
if (event != AUE_SESSION_END) if (event != AUE_SESSION_END)
continue; continue;
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
kcm_cache_remove_session(aio.ai_asid); kcm_cache_remove_session(aio.ai_asid);
}); });

View File

@@ -82,7 +82,7 @@ CFString2utf8(CFStringRef string)
str = malloc(size); str = malloc(size);
if (str == NULL) if (str == NULL)
return NULL; return NULL;
if (CFStringGetCString(string, str, size, kCFStringEncodingUTF8) == false) { if (CFStringGetCString(string, str, size, kCFStringEncodingUTF8) == false) {
free(str); free(str);
return NULL; return NULL;
@@ -99,12 +99,12 @@ retry_timer(void)
{ {
dispatch_source_t s; dispatch_source_t s;
dispatch_time_t t; dispatch_time_t t;
s = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, s = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER,
0, 0, g_queue); 0, 0, g_queue);
t = dispatch_time(DISPATCH_TIME_NOW, 5ull * NSEC_PER_SEC); t = dispatch_time(DISPATCH_TIME_NOW, 5ull * NSEC_PER_SEC);
dispatch_source_set_timer(s, t, 0, NSEC_PER_SEC); dispatch_source_set_timer(s, t, 0, NSEC_PER_SEC);
dispatch_source_set_event_handler(s, ^{ dispatch_source_set_event_handler(s, ^{
create_dns_sd(); create_dns_sd();
dispatch_release(s); dispatch_release(s);
}); });
@@ -132,7 +132,7 @@ create_dns_sd(void)
s = dispatch_source_create(DISPATCH_SOURCE_TYPE_READ, s = dispatch_source_create(DISPATCH_SOURCE_TYPE_READ,
DNSServiceRefSockFD(g_dnsRef), DNSServiceRefSockFD(g_dnsRef),
0, g_queue); 0, g_queue);
dispatch_source_set_event_handler(s, ^{ dispatch_source_set_event_handler(s, ^{
DNSServiceErrorType ret = DNSServiceProcessResult(g_dnsRef); DNSServiceErrorType ret = DNSServiceProcessResult(g_dnsRef);
/* on error tear down and set timer to recreate */ /* on error tear down and set timer to recreate */
@@ -148,7 +148,7 @@ create_dns_sd(void)
}); });
dispatch_resume(s); dispatch_resume(s);
/* Do the first update ourself */ /* Do the first update ourself */
update_all(g_store, NULL, NULL); update_all(g_store, NULL, NULL);
dispatch_resume(g_queue); dispatch_resume(g_queue);
@@ -205,8 +205,8 @@ domains_add(const void *key, const void *value, void *context)
static void static void
dnsCallback(DNSServiceRef sdRef __attribute__((unused)), dnsCallback(DNSServiceRef sdRef __attribute__((unused)),
DNSRecordRef RecordRef __attribute__((unused)), DNSRecordRef RecordRef __attribute__((unused)),
DNSServiceFlags flags __attribute__((unused)), DNSServiceFlags flags __attribute__((unused)),
DNSServiceErrorType errorCode __attribute__((unused)), DNSServiceErrorType errorCode __attribute__((unused)),
void *context __attribute__((unused))) void *context __attribute__((unused)))
{ {
@@ -369,11 +369,11 @@ update_dns(void)
asprintf(&name, "_kerberos.%s.%s", hostname, update->domain); asprintf(&name, "_kerberos.%s.%s", hostname, update->domain);
if (name == NULL) if (name == NULL)
errx(1, "malloc"); errx(1, "malloc");
if (update->recordRef) if (update->recordRef)
DNSServiceRemoveRecord(g_dnsRef, update->recordRef, 0); DNSServiceRemoveRecord(g_dnsRef, update->recordRef, 0);
error = DNSServiceRegisterRecord(g_dnsRef, error = DNSServiceRegisterRecord(g_dnsRef,
&update->recordRef, &update->recordRef,
kDNSServiceFlagsShared | kDNSServiceFlagsAllowRemoteQuery, kDNSServiceFlagsShared | kDNSServiceFlagsAllowRemoteQuery,
0, 0,
@@ -388,7 +388,7 @@ update_dns(void)
free(name); free(name);
free(dnsdata); free(dnsdata);
if (error) if (error)
errx(1, "failure to update entry for %s/%s", errx(1, "failure to update entry for %s/%s",
update->domain, update->realm); update->domain, update->realm);
} }
e = &(*e)->next; e = &(*e)->next;
@@ -487,7 +487,7 @@ destroy_dns_sd(void)
#ifdef REGISTER_SRV_RR #ifdef REGISTER_SRV_RR
unregister_srv_realms(); unregister_srv_realms();
#endif #endif
DNSServiceRefDeallocate(g_dnsRef); DNSServiceRefDeallocate(g_dnsRef);
g_dnsRef = NULL; g_dnsRef = NULL;
} }
@@ -512,7 +512,7 @@ register_notification(void)
errx(1, "CFArrayCreateMutable"); errx(1, "CFArrayCreateMutable");
CFArrayAppendValue(keys, computerNameKey); CFArrayAppendValue(keys, computerNameKey);
CFArrayAppendValue(keys, NetworkChangedKey_BackToMyMac); CFArrayAppendValue(keys, NetworkChangedKey_BackToMyMac);
if (SCDynamicStoreSetNotificationKeys(store, keys, NULL) == false) if (SCDynamicStoreSetNotificationKeys(store, keys, NULL) == false)
errx(1, "SCDynamicStoreSetNotificationKeys"); errx(1, "SCDynamicStoreSetNotificationKeys");
@@ -534,11 +534,11 @@ bonjour_announce(krb5_context context, krb5_kdc_configuration *config)
g_queue = dispatch_queue_create("com.apple.kdc_announce", NULL); g_queue = dispatch_queue_create("com.apple.kdc_announce", NULL);
if (!g_queue) if (!g_queue)
errx(1, "dispatch_queue_create"); errx(1, "dispatch_queue_create");
g_store = register_notification(); g_store = register_notification();
announce_config = config; announce_config = config;
announce_context = context; announce_context = context;
create_dns_sd(); create_dns_sd();
#endif #endif
} }

View File

@@ -180,7 +180,7 @@ configure(krb5_context context, int argc, char **argv)
ret = krb5_prepend_config_files_default(config_file, &files); ret = krb5_prepend_config_files_default(config_file, &files);
if (ret) if (ret)
krb5_err(context, 1, ret, "getting configuration files"); krb5_err(context, 1, ret, "getting configuration files");
ret = krb5_set_config_files(context, files); ret = krb5_set_config_files(context, files);
krb5_free_config_files(files); krb5_free_config_files(files);
if(ret) if(ret)
@@ -260,7 +260,7 @@ configure(krb5_context context, int argc, char **argv)
"kdc", "kdc",
"detach", NULL); "detach", NULL);
#endif /* SUPPORT_DETACH */ #endif /* SUPPORT_DETACH */
if(max_request_tcp == 0) if(max_request_tcp == 0)
max_request_tcp = 64 * 1024; max_request_tcp = 64 * 1024;
if(max_request_udp == 0) if(max_request_udp == 0)

View File

@@ -138,7 +138,7 @@ add_port_string (krb5_context context,
*/ */
static void static void
add_standard_ports (krb5_context context, add_standard_ports (krb5_context context,
krb5_kdc_configuration *config, krb5_kdc_configuration *config,
int family) int family)
{ {
@@ -162,7 +162,7 @@ add_standard_ports (krb5_context context,
*/ */
static void static void
parse_ports(krb5_context context, parse_ports(krb5_context context,
krb5_kdc_configuration *config, krb5_kdc_configuration *config,
const char *str) const char *str)
{ {
@@ -194,7 +194,7 @@ parse_ports(krb5_context context,
add_port_string(context, AF_INET, p, "tcp"); add_port_string(context, AF_INET, p, "tcp");
} }
} }
p = strtok_r(NULL, " \t", &pos); p = strtok_r(NULL, " \t", &pos);
} }
free (str_copy); free (str_copy);
@@ -377,7 +377,7 @@ descr_type(struct descr *d)
} }
static void static void
addr_to_string(krb5_context context, addr_to_string(krb5_context context,
struct sockaddr *addr, size_t addr_len, char *str, size_t len) struct sockaddr *addr, size_t addr_len, char *str, size_t len)
{ {
krb5_address a; krb5_address a;

View File

@@ -184,7 +184,7 @@ krb5_kdc_get_config(krb5_context context, krb5_kdc_configuration **config)
NULL); NULL);
c->pkinit_kdc_identity = c->pkinit_kdc_identity =
krb5_config_get_string(context, NULL, krb5_config_get_string(context, NULL,
"kdc", "pkinit_identity", NULL); "kdc", "pkinit_identity", NULL);
c->pkinit_kdc_anchors = c->pkinit_kdc_anchors =
@@ -196,7 +196,7 @@ krb5_kdc_get_config(krb5_context context, krb5_kdc_configuration **config)
c->pkinit_kdc_revoke = c->pkinit_kdc_revoke =
krb5_config_get_strings(context, NULL, krb5_config_get_strings(context, NULL,
"kdc", "pkinit_revoke", NULL); "kdc", "pkinit_revoke", NULL);
c->pkinit_kdc_ocsp_file = c->pkinit_kdc_ocsp_file =
krb5_config_get_string(context, NULL, krb5_config_get_string(context, NULL,
"kdc", "pkinit_kdc_ocsp", NULL); "kdc", "pkinit_kdc_ocsp", NULL);
c->pkinit_kdc_friendly_name = c->pkinit_kdc_friendly_name =
@@ -233,7 +233,7 @@ krb5_kdc_pkinit_config(krb5_context context, krb5_kdc_configuration *config)
if (config->pkinit_kdc_identity == NULL) { if (config->pkinit_kdc_identity == NULL) {
if (config->pkinit_kdc_friendly_name == NULL) if (config->pkinit_kdc_friendly_name == NULL)
config->pkinit_kdc_friendly_name = config->pkinit_kdc_friendly_name =
strdup("O=System Identity,CN=com.apple.kerberos.kdc"); strdup("O=System Identity,CN=com.apple.kerberos.kdc");
config->pkinit_kdc_identity = strdup("KEYCHAIN:"); config->pkinit_kdc_identity = strdup("KEYCHAIN:");
} }
@@ -245,7 +245,7 @@ krb5_kdc_pkinit_config(krb5_context context, krb5_kdc_configuration *config)
if (config->enable_pkinit) { if (config->enable_pkinit) {
if (config->pkinit_kdc_identity == NULL) if (config->pkinit_kdc_identity == NULL)
krb5_errx(context, 1, "pkinit enabled but no identity"); krb5_errx(context, 1, "pkinit enabled but no identity");
if (config->pkinit_kdc_anchors == NULL) if (config->pkinit_kdc_anchors == NULL)
krb5_errx(context, 1, "pkinit enabled but no X509 anchors"); krb5_errx(context, 1, "pkinit enabled but no X509 anchors");
@@ -259,4 +259,4 @@ krb5_kdc_pkinit_config(krb5_context context, krb5_kdc_configuration *config)
return 0; return 0;
#endif /* PKINIT */ #endif /* PKINIT */
} }

View File

@@ -67,7 +67,7 @@ ntlm_service(void *ctx, const heim_idata *req,
kdc_log(context, config, 1, "digest-request: uid=%d", kdc_log(context, config, 1, "digest-request: uid=%d",
(int)heim_ipc_cred_get_uid(cred)); (int)heim_ipc_cred_get_uid(cred));
if (heim_ipc_cred_get_uid(cred) != 0) { if (heim_ipc_cred_get_uid(cred) != 0) {
(*complete)(cctx, EPERM, NULL); (*complete)(cctx, EPERM, NULL);
return; return;
@@ -129,10 +129,10 @@ ntlm_service(void *ctx, const heim_idata *req,
if (ntq.ntChallengeResponce.length != 24) { if (ntq.ntChallengeResponce.length != 24) {
struct ntlm_buf infotarget, answer; struct ntlm_buf infotarget, answer;
answer.length = ntq.ntChallengeResponce.length; answer.length = ntq.ntChallengeResponce.length;
answer.data = ntq.ntChallengeResponce.data; answer.data = ntq.ntChallengeResponce.data;
ret = heim_ntlm_verify_ntlm2(key->key.keyvalue.data, ret = heim_ntlm_verify_ntlm2(key->key.keyvalue.data,
key->key.keyvalue.length, key->key.keyvalue.length,
ntq.loginUserName, ntq.loginUserName,
@@ -145,17 +145,17 @@ ntlm_service(void *ctx, const heim_idata *req,
if (ret) { if (ret) {
goto failed; goto failed;
} }
free(infotarget.data); free(infotarget.data);
/* XXX verify info target */ /* XXX verify info target */
} else { } else {
struct ntlm_buf answer; struct ntlm_buf answer;
if (ntq.flags & NTLM_NEG_NTLM2_SESSION) { if (ntq.flags & NTLM_NEG_NTLM2_SESSION) {
unsigned char sessionhash[MD5_DIGEST_LENGTH]; unsigned char sessionhash[MD5_DIGEST_LENGTH];
EVP_MD_CTX *md5ctx; EVP_MD_CTX *md5ctx;
/* the first first 8 bytes is the challenge, what is the other 16 bytes ? */ /* the first first 8 bytes is the challenge, what is the other 16 bytes ? */
if (ntq.lmChallengeResponce.length != 24) if (ntq.lmChallengeResponce.length != 24)
goto failed; goto failed;
@@ -168,13 +168,13 @@ ntlm_service(void *ctx, const heim_idata *req,
EVP_MD_CTX_destroy(md5ctx); EVP_MD_CTX_destroy(md5ctx);
memcpy(ntq.lmchallenge.data, sessionhash, ntq.lmchallenge.length); memcpy(ntq.lmchallenge.data, sessionhash, ntq.lmchallenge.length);
} }
ret = heim_ntlm_calculate_ntlm1(key->key.keyvalue.data, ret = heim_ntlm_calculate_ntlm1(key->key.keyvalue.data,
key->key.keyvalue.length, key->key.keyvalue.length,
ntq.lmchallenge.data, &answer); ntq.lmchallenge.data, &answer);
if (ret) if (ret)
goto failed; goto failed;
if (ntq.ntChallengeResponce.length != answer.length || if (ntq.ntChallengeResponce.length != answer.length ||
memcmp(ntq.ntChallengeResponce.data, answer.data, answer.length) != 0) { memcmp(ntq.ntChallengeResponce.data, answer.data, answer.length) != 0) {
free(answer.data); free(answer.data);
@@ -182,10 +182,10 @@ ntlm_service(void *ctx, const heim_idata *req,
goto failed; goto failed;
} }
free(answer.data); free(answer.data);
{ {
EVP_MD_CTX *ctxp; EVP_MD_CTX *ctxp;
ctxp = EVP_MD_CTX_create(); ctxp = EVP_MD_CTX_create();
EVP_DigestInit_ex(ctxp, EVP_md4(), NULL); EVP_DigestInit_ex(ctxp, EVP_md4(), NULL);
EVP_DigestUpdate(ctxp, key->key.keyvalue.data, key->key.keyvalue.length); EVP_DigestUpdate(ctxp, key->key.keyvalue.data, key->key.keyvalue.length);
@@ -201,7 +201,7 @@ ntlm_service(void *ctx, const heim_idata *req,
goto failed; goto failed;
if (rep.length != size) if (rep.length != size)
abort(); abort();
failed: failed:
kdc_log(context, config, 1, "digest-request: %d", ret); kdc_log(context, config, 1, "digest-request: %d", ret);
@@ -241,10 +241,10 @@ main(int argc, char **argv)
if (getarg(args, num_args, argc, argv, &optidx)) if (getarg(args, num_args, argc, argv, &optidx))
usage(1); usage(1);
if (help_flag) if (help_flag)
usage(0); usage(0);
if (version_flag) { if (version_flag) {
print_version(NULL); print_version(NULL);
exit(0); exit(0);

Some files were not shown because too many files have changed in this diff Show More