remove trailing whitespace

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2008-09-13 09:21:03 +00:00
parent e172367898
commit 6937d41a02
940 changed files with 23827 additions and 23827 deletions

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 1997-2005 Kungliga Tekniska Högskolan * Copyright (c) 1997-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.
*/ */
#include "ktutil_locl.h" #include "ktutil_locl.h"
@@ -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);
@@ -119,7 +119,7 @@ kt_add(struct add_options *opt, int argc, char **argv)
goto out; goto out;
} }
ret = krb5_keyblock_init(context, enctype, ret = krb5_keyblock_init(context, enctype,
data, len, &entry.keyblock); data, len, &entry.keyblock);
free(data); free(data);
} else if (!opt->salt_flag) { } else if (!opt->salt_flag) {
@@ -134,7 +134,7 @@ kt_add(struct add_options *opt, int argc, char **argv)
ret = krb5_string_to_key_data_salt(context, enctype, pw, salt, ret = krb5_string_to_key_data_salt(context, enctype, pw, salt,
&entry.keyblock); &entry.keyblock);
} else { } else {
ret = krb5_string_to_key(context, enctype, opt->password_string, ret = krb5_string_to_key(context, enctype, opt->password_string,
entry.principal, &entry.keyblock); entry.principal, &entry.keyblock);
} }
memset (opt->password_string, 0, strlen(opt->password_string)); memset (opt->password_string, 0, strlen(opt->password_string));

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 1997-2005 Kungliga Tekniska Högskolan * Copyright (c) 1997-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.
*/ */
#include "ktutil_locl.h" #include "ktutil_locl.h"
@@ -65,7 +65,7 @@ change_entry (krb5_keytab keytab,
return ENOMEM; return ENOMEM;
} }
conf.mask |= KADM5_CONFIG_REALM; conf.mask |= KADM5_CONFIG_REALM;
if (admin_server) { if (admin_server) {
conf.admin_server = strdup(admin_server); conf.admin_server = strdup(admin_server);
if (conf.admin_server == NULL) { if (conf.admin_server == NULL) {
@@ -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;
} }
@@ -140,7 +140,7 @@ kt_change (struct change_options *opt, int argc, char **argv)
int i, j, max; int i, j, max;
struct change_set *changeset; struct change_set *changeset;
int errors = 0; int errors = 0;
if((keytab = ktutil_open_keytab()) == NULL) if((keytab = ktutil_open_keytab()) == NULL)
return 1; return 1;
@@ -222,20 +222,20 @@ kt_change (struct change_options *opt, int argc, char **argv)
if (verbose_flag) { if (verbose_flag) {
char *client_name; char *client_name;
ret = krb5_unparse_name (context, changeset[i].principal, ret = krb5_unparse_name (context, changeset[i].principal,
&client_name); &client_name);
if (ret) { if (ret) {
krb5_warn (context, ret, "krb5_unparse_name"); krb5_warn (context, ret, "krb5_unparse_name");
} else { } else {
printf("Changing %s kvno %d\n", printf("Changing %s kvno %d\n",
client_name, changeset[i].kvno); client_name, changeset[i].kvno);
free(client_name); free(client_name);
} }
} }
ret = change_entry (keytab, ret = change_entry (keytab,
changeset[i].principal, changeset[i].kvno, changeset[i].principal, changeset[i].kvno,
opt->realm_string, opt->realm_string,
opt->admin_server_string, opt->admin_server_string,
opt->server_port_integer); opt->server_port_integer);
if (ret != 0) if (ret != 0)
errors = 1; errors = 1;

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 * 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.
*/ */
#include "ktutil_locl.h" #include "ktutil_locl.h"
@@ -90,9 +90,9 @@ kt_copy_int (const char *from, const char *to)
krb5_warn(context, ret, "krb5_enctype_to_string"); krb5_warn(context, ret, "krb5_enctype_to_string");
etype_str = NULL; /* XXX */ etype_str = NULL; /* XXX */
} }
ret = krb5_kt_get_entry(context, dst_keytab, ret = krb5_kt_get_entry(context, dst_keytab,
entry.principal, entry.principal,
entry.vno, entry.vno,
entry.keyblock.keytype, entry.keyblock.keytype,
&dummy); &dummy);
if(ret == 0) { if(ret == 0) {
@@ -101,7 +101,7 @@ kt_copy_int (const char *from, const char *to)
is weird, so complain about that */ is weird, so complain about that */
if(!compare_keyblock(&entry.keyblock, &dummy.keyblock)) { if(!compare_keyblock(&entry.keyblock, &dummy.keyblock)) {
krb5_warnx(context, "entry with different keyvalue " krb5_warnx(context, "entry with different keyvalue "
"already exists for %s, keytype %s, kvno %d", "already exists for %s, keytype %s, kvno %d",
name_str, etype_str, entry.vno); name_str, etype_str, entry.vno);
} }
krb5_kt_free_entry(context, &dummy); krb5_kt_free_entry(context, &dummy);
@@ -110,7 +110,7 @@ kt_copy_int (const char *from, const char *to)
free(etype_str); free(etype_str);
continue; continue;
} else if(ret != KRB5_KT_NOTFOUND) { } else if(ret != KRB5_KT_NOTFOUND) {
krb5_warn (context, ret, "%s: fetching %s/%s/%u", krb5_warn (context, ret, "%s: fetching %s/%s/%u",
to, name_str, etype_str, entry.vno); to, name_str, etype_str, entry.vno);
krb5_kt_free_entry (context, &entry); krb5_kt_free_entry (context, &entry);
free(name_str); free(name_str);
@@ -118,12 +118,12 @@ kt_copy_int (const char *from, const char *to)
break; break;
} }
if (verbose_flag) if (verbose_flag)
fprintf (stderr, "copying %s, keytype %s, kvno %d\n", name_str, fprintf (stderr, "copying %s, keytype %s, kvno %d\n", name_str,
etype_str, entry.vno); etype_str, entry.vno);
ret = krb5_kt_add_entry (context, dst_keytab, &entry); ret = krb5_kt_add_entry (context, dst_keytab, &entry);
krb5_kt_free_entry (context, &entry); krb5_kt_free_entry (context, &entry);
if (ret) { if (ret) {
krb5_warn (context, ret, "%s: adding %s/%s/%u", krb5_warn (context, ret, "%s: adding %s/%s/%u",
to, name_str, etype_str, entry.vno); to, name_str, etype_str, entry.vno);
free(name_str); free(name_str);
free(etype_str); free(etype_str);

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 * 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.
*/ */
#include "ktutil_locl.h" #include "ktutil_locl.h"
@@ -37,8 +37,8 @@ RCSID("$Id$");
static void* static void*
open_kadmin_connection(char *principal, open_kadmin_connection(char *principal,
const char *realm, const char *realm,
char *admin_server, char *admin_server,
int server_port) int server_port)
{ {
static kadm5_config_params conf; static kadm5_config_params conf;
@@ -54,7 +54,7 @@ open_kadmin_connection(char *principal,
} }
conf.mask |= KADM5_CONFIG_REALM; conf.mask |= KADM5_CONFIG_REALM;
} }
if (admin_server) { if (admin_server) {
conf.admin_server = admin_server; conf.admin_server = admin_server;
conf.mask |= KADM5_CONFIG_ADMIN_SERVER; conf.mask |= KADM5_CONFIG_ADMIN_SERVER;
@@ -68,11 +68,11 @@ open_kadmin_connection(char *principal,
/* should get realm from each principal, instead of doing /* should get realm from each principal, instead of doing
everything with the same (local) realm */ everything with the same (local) realm */
ret = kadm5_init_with_password_ctx(context, ret = kadm5_init_with_password_ctx(context,
principal, principal,
NULL, NULL,
KADM5_ADMIN_SERVICE, KADM5_ADMIN_SERVICE,
&conf, 0, 0, &conf, 0, 0,
&kadm_handle); &kadm_handle);
free(conf.realm); free(conf.realm);
if(ret) { if(ret) {
@@ -92,7 +92,7 @@ kt_get(struct get_options *opt, int argc, char **argv)
size_t netypes = 0; size_t netypes = 0;
int i, j; int i, j;
unsigned int failed = 0; unsigned int failed = 0;
if((keytab = ktutil_open_keytab()) == NULL) if((keytab = ktutil_open_keytab()) == NULL)
return 1; return 1;
@@ -108,8 +108,8 @@ kt_get(struct get_options *opt, int argc, char **argv)
} }
netypes = opt->enctypes_strings.num_strings; netypes = opt->enctypes_strings.num_strings;
for(i = 0; i < netypes; i++) { for(i = 0; i < netypes; i++) {
ret = krb5_string_to_enctype(context, ret = krb5_string_to_enctype(context,
opt->enctypes_strings.strings[i], opt->enctypes_strings.strings[i],
&etypes[i]); &etypes[i]);
if(ret) { if(ret) {
krb5_warnx(context, "unrecognized enctype: %s", krb5_warnx(context, "unrecognized enctype: %s",
@@ -119,7 +119,7 @@ kt_get(struct get_options *opt, int argc, char **argv)
} }
} }
for(i = 0; i < argc; i++){ for(i = 0; i < argc; i++){
krb5_principal princ_ent; krb5_principal princ_ent;
kadm5_principal_ent_rec princ; kadm5_principal_ent_rec princ;
@@ -149,9 +149,9 @@ kt_get(struct get_options *opt, int argc, char **argv)
r = opt->realm_string; r = opt->realm_string;
else else
r = krb5_principal_get_realm(context, princ_ent); r = krb5_principal_get_realm(context, princ_ent);
kadm_handle = open_kadmin_connection(opt->principal_string, kadm_handle = open_kadmin_connection(opt->principal_string,
r, r,
opt->admin_server_string, opt->admin_server_string,
opt->server_port_integer); opt->server_port_integer);
if(kadm_handle == NULL) if(kadm_handle == NULL)
break; break;
@@ -174,7 +174,7 @@ kt_get(struct get_options *opt, int argc, char **argv)
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) {
krb5_warn(context, ret, "kadm5_get_principal(%s)", argv[i]); krb5_warn(context, ret, "kadm5_get_principal(%s)", argv[i]);

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 * 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.
*/ */
#include "ktutil_locl.h" #include "ktutil_locl.h"
@@ -39,33 +39,33 @@ RCSID("$Id$");
static int help_flag; static int help_flag;
static int version_flag; static int version_flag;
int verbose_flag; int verbose_flag;
char *keytab_string; char *keytab_string;
static char keytab_buf[256]; static char keytab_buf[256];
static struct getargs args[] = { static struct getargs args[] = {
{ {
"version", "version",
0, 0,
arg_flag, arg_flag,
&version_flag, &version_flag,
NULL, NULL,
NULL
},
{
"help",
'h',
arg_flag,
&help_flag,
NULL,
NULL NULL
}, },
{ {
"keytab", "help",
'k', 'h',
arg_string, arg_flag,
&keytab_string, &help_flag,
"keytab", NULL,
"keytab to operate on" NULL
},
{
"keytab",
'k',
arg_string,
&keytab_string,
"keytab",
"keytab to operate on"
}, },
{ {
"verbose", "verbose",

View File

@@ -1,37 +1,37 @@
/* /*
* 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 * 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$
*/ */
@@ -66,7 +66,7 @@
extern krb5_context context; extern krb5_context context;
extern int verbose_flag; extern int verbose_flag;
extern char *keytab_string; extern char *keytab_string;
krb5_keytab ktutil_open_keytab(void); krb5_keytab ktutil_open_keytab(void);

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 * 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.
*/ */
#include "ktutil_locl.h" #include "ktutil_locl.h"
@@ -51,7 +51,7 @@ do_list(struct list_options *opt, const char *keytab_str)
char buf[1024]; char buf[1024];
keytab_str += 4; keytab_str += 4;
ret = 0; ret = 0;
while (strsep_copy((const char**)&keytab_str, ",", while (strsep_copy((const char**)&keytab_str, ",",
buf, sizeof(buf)) != -1) { buf, sizeof(buf)) != -1) {
if(flag) if(flag)
printf("\n"); printf("\n");
@@ -93,7 +93,7 @@ do_list(struct list_options *opt, const char *keytab_str)
snprintf(buf, sizeof(buf), "%d", entry.vno); snprintf(buf, sizeof(buf), "%d", entry.vno);
rtbl_add_column_entry_by_id(table, 0, buf); rtbl_add_column_entry_by_id(table, 0, buf);
ret = krb5_enctype_to_string(context, ret = krb5_enctype_to_string(context,
entry.keyblock.keytype, &s); entry.keyblock.keytype, &s);
if (ret != 0) { if (ret != 0) {
snprintf(buf, sizeof(buf), "unknown (%d)", entry.keyblock.keytype); snprintf(buf, sizeof(buf), "unknown (%d)", entry.keyblock.keytype);
@@ -107,7 +107,7 @@ do_list(struct list_options *opt, const char *keytab_str)
rtbl_add_column_entry_by_id(table, 2, buf); rtbl_add_column_entry_by_id(table, 2, buf);
if (opt->timestamp_flag) { if (opt->timestamp_flag) {
krb5_format_time(context, entry.timestamp, buf, krb5_format_time(context, entry.timestamp, buf,
sizeof(buf), FALSE); sizeof(buf), FALSE);
rtbl_add_column_entry_by_id(table, 3, buf); rtbl_add_column_entry_by_id(table, 3, buf);
} }
@@ -120,7 +120,7 @@ do_list(struct list_options *opt, const char *keytab_str)
goto out; goto out;
} }
for(i = 0; i < entry.keyblock.keyvalue.length; i++) for(i = 0; i < entry.keyblock.keyvalue.length; i++)
snprintf(s + 2 * i, 3, "%02x", snprintf(s + 2 * i, 3, "%02x",
((unsigned char*)entry.keyblock.keyvalue.data)[i]); ((unsigned char*)entry.keyblock.keyvalue.data)[i]);
rtbl_add_column_entry_by_id(table, 4, s); rtbl_add_column_entry_by_id(table, 4, s);
free(s); free(s);

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 * 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.
*/ */
#include "ktutil_locl.h" #include "ktutil_locl.h"

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 * 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.
*/ */
#include "ktutil_locl.h" #include "ktutil_locl.h"
@@ -66,7 +66,7 @@ kt_remove(struct remove_options *opt, int argc, char **argv)
} }
} }
if (!principal && !enctype && !opt->kvno_integer) { if (!principal && !enctype && !opt->kvno_integer) {
krb5_warnx(context, krb5_warnx(context,
"You must give at least one of " "You must give at least one of "
"principal, enctype or kvno."); "principal, enctype or kvno.");
ret = EINVAL; ret = EINVAL;

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 * 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.
*/ */
#include "ktutil_locl.h" #include "ktutil_locl.h"

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 1997-2003 Kungliga Tekniska Högskolan * Copyright (c) 1997-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 * 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.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
@@ -237,7 +237,7 @@ main(int argc, char **argv)
int ret = 0; int ret = 0;
int failed = 0; int failed = 0;
struct cell_list *p; struct cell_list *p;
setprogname(argv[0]); setprogname(argv[0]);
if(getarg(args, num_args, argc, argv, &optind)) if(getarg(args, num_args, argc, argv, &optind))
@@ -306,7 +306,7 @@ main(int argc, char **argv)
afslog_file(argv[i]); afslog_file(argv[i]);
else else
afslog_cell(argv[i], 1); afslog_cell(argv[i], 1);
} }
if(num == 0) { if(num == 0) {
if(do_afslog(NULL)) if(do_afslog(NULL))
failed++; failed++;

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995 - 2005 Kungliga Tekniska Högskolan * Copyright (c) 1995 - 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
@@ -141,11 +141,11 @@ main(int argc, char **argv)
if (name == NULL) if (name == NULL)
krb5_errx(context, 1, "Failed getting default " krb5_errx(context, 1, "Failed getting default "
"credential cache type"); "credential cache type");
typename_arg = strdup(name); typename_arg = strdup(name);
if (typename_arg == NULL) if (typename_arg == NULL)
errx(1, "strdup"); errx(1, "strdup");
s = strchr(typename_arg, ':'); s = strchr(typename_arg, ':');
if (s) if (s)
*s = '\0'; *s = '\0';
@@ -155,7 +155,7 @@ main(int argc, char **argv)
if (type == NULL) if (type == NULL)
krb5_err(context, 1, ret, "Failed getting ops for %s " krb5_err(context, 1, ret, "Failed getting ops for %s "
"credential cache", typename_arg); "credential cache", typename_arg);
ret = krb5_cc_gen_new(context, type, &id); ret = krb5_cc_gen_new(context, type, &id);
if (ret) if (ret)
krb5_err(context, 1, ret, "Failed generating credential cache"); krb5_err(context, 1, ret, "Failed generating credential cache");
@@ -190,7 +190,7 @@ main(int argc, char **argv)
if (args == NULL) if (args == NULL)
errx (1, "Out of memory allocating %lu bytes", errx (1, "Out of memory allocating %lu bytes",
(unsigned long)((argc + 10)*sizeof(char *))); (unsigned long)((argc + 10)*sizeof(char *)));
if(*argv == NULL) { if(*argv == NULL) {
path = getenv("SHELL"); path = getenv("SHELL");
if(path == NULL){ if(path == NULL){
@@ -202,7 +202,7 @@ main(int argc, char **argv)
} }
if (path == NULL) if (path == NULL)
errx (1, "Out of memory copying path"); errx (1, "Out of memory copying path");
p=strrchr(path, '/'); p=strrchr(path, '/');
if(p) if(p)
args[i] = strdup(p+1); args[i] = strdup(p+1);
@@ -211,7 +211,7 @@ main(int argc, char **argv)
if (args[i++] == NULL) if (args[i++] == NULL)
errx (1, "Out of memory copying arguments"); errx (1, "Out of memory copying arguments");
while(*argv) while(*argv)
args[i++] = *argv++; args[i++] = *argv++;

View File

@@ -1,16 +1,16 @@
/* /*
* dpagaix.c * dpagaix.c
* On AIX we need to get the kernel extentions * On AIX we need to get the kernel extentions
* with the DFS kafs_syscall in it. * with the DFS kafs_syscall in it.
* We might be running on a system * We might be running on a system
* where DFS is not active. * where DFS is not active.
* So we use this dummy routine which * So we use this dummy routine which
* might not load to do the dirty work * might not load to do the dirty work
* *
* DCE does this with the /usr/lib/drivers/dfsloadobj * DCE does this with the /usr/lib/drivers/dfsloadobj
* *
*/ */
int dpagaix(parm1, parm2, parm3, parm4, parm5, parm6) int dpagaix(parm1, parm2, parm3, parm4, parm5, parm6)
int parm1; int parm1;
int parm2; int parm2;

View File

@@ -1,5 +1,5 @@
/* dummy K5 routines which are needed to get this to /* dummy K5 routines which are needed to get this to
* compile without having access ti the DCE versions * compile without having access ti the DCE versions
* of the header files. * of the header files.
* Thiis is very crude, and OSF needs to expose the K5 * Thiis is very crude, and OSF needs to expose the K5
* API. * API.
@@ -9,7 +9,7 @@
/* Transarc obfascates these routines */ /* Transarc obfascates these routines */
#ifdef DCE_1_1 #ifdef DCE_1_1
#define krb5_init_ets _dce_PkjKqOaklP #define krb5_init_ets _dce_PkjKqOaklP
#define krb5_copy_creds _dce_LuFxPiITzD #define krb5_copy_creds _dce_LuFxPiITzD
#define krb5_unparse_name _dce_LWHtAuNgRV #define krb5_unparse_name _dce_LWHtAuNgRV
#define krb5_get_default_realm _dce_vDruhprWGh #define krb5_get_default_realm _dce_vDruhprWGh
@@ -37,17 +37,17 @@
#endif #endif
/* Define the bare minimum k5 structures which are needed /* Define the bare minimum k5 structures which are needed
* by this program. Since the krb5 includes are not supplied * by this program. Since the krb5 includes are not supplied
* with DCE, these were based on the MIT Kerberos 5 beta 3 * with DCE, these were based on the MIT Kerberos 5 beta 3
* which should match the DCE as of 1.0.3 at least. * which should match the DCE as of 1.0.3 at least.
* The tricky one is the krb5_creds, since one is allocated * The tricky one is the krb5_creds, since one is allocated
* by this program, and it needs access to the client principal * by this program, and it needs access to the client principal
* in it. * in it.
* Note that there are no function prototypes, so there is no * Note that there are no function prototypes, so there is no
* compile time checking. * compile time checking.
* DEE 07/11/95 * DEE 07/11/95
*/ */
#define NPROTOTYPE(x) () #define NPROTOTYPE(x) ()
typedef int krb5_int32; /* assuming all DCE systems are 32 bit */ typedef int krb5_int32; /* assuming all DCE systems are 32 bit */
typedef short krb5short; /* assuming short is 16 bit */ typedef short krb5short; /* assuming short is 16 bit */
typedef krb5_int32 krb5_error_code; typedef krb5_int32 krb5_error_code;
@@ -126,8 +126,8 @@ typedef struct _krb5_creds {
krb5_pointer **authdata; krb5_pointer **authdata;
} krb5_creds; } krb5_creds;
typedef krb5_pointer krb5_principal; typedef krb5_pointer krb5_principal;
#define KRB5_CC_END 336760974 #define KRB5_CC_END 336760974
#define KRB5_TC_OPENCLOSE 0x00000001 #define KRB5_TC_OPENCLOSE 0x00000001

View File

@@ -1,45 +1,45 @@
/* /*
* (c) Copyright 1995 HEWLETT-PACKARD COMPANY * (c) Copyright 1995 HEWLETT-PACKARD COMPANY
* *
* To anyone who acknowledges that this file is provided * To anyone who acknowledges that this file is provided
* "AS IS" without any express or implied warranty: * "AS IS" without any express or implied warranty:
* permission to use, copy, modify, and distribute this * permission to use, copy, modify, and distribute this
* file for any purpose is hereby granted without fee, * file for any purpose is hereby granted without fee,
* provided that the above copyright notice and this * provided that the above copyright notice and this
* notice appears in all copies, and that the name of * notice appears in all copies, and that the name of
* Hewlett-Packard Company not be used in advertising or * Hewlett-Packard Company not be used in advertising or
* publicity pertaining to distribution of the software * publicity pertaining to distribution of the software
* without specific, written prior permission. Hewlett- * without specific, written prior permission. Hewlett-
* Packard Company makes no representations about the * Packard Company makes no representations about the
* suitability of this software for any purpose. * suitability of this software for any purpose.
* *
*/ */
/* /*
* k5dcecon - Program to convert a K5 TGT to a DCE context, * k5dcecon - Program to convert a K5 TGT to a DCE context,
* for use with DFS and its PAG. * for use with DFS and its PAG.
* *
* The program is designed to be called as a sub process, * The program is designed to be called as a sub process,
* and return via stdout the name of the cache which implies * and return via stdout the name of the cache which implies
* the PAG which should be used. This program itself does not * the PAG which should be used. This program itself does not
* use the cache or PAG itself, so the PAG in the kernel for * use the cache or PAG itself, so the PAG in the kernel for
* this program may not be set. * this program may not be set.
* *
* The calling program can then use the name of the cache * The calling program can then use the name of the cache
* to set the KRB5CCNAME and PAG for itself and its children. * to set the KRB5CCNAME and PAG for itself and its children.
* *
* If no ticket was passed, an attemplt to join an existing * If no ticket was passed, an attemplt to join an existing
* PAG will be made. * PAG will be made.
* *
* If a forwarded K5 TGT is passed in, either a new DCE * If a forwarded K5 TGT is passed in, either a new DCE
* context will be created, or an existing one will be updated. * context will be created, or an existing one will be updated.
* If the same ticket was already used to create an existing * If the same ticket was already used to create an existing
* context, it will be joined instead. * context, it will be joined instead.
* *
* Parts of this program are based on k5dceauth,c which was * Parts of this program are based on k5dceauth,c which was
* given to me by HP and by the k5dcelogin.c which I developed. * given to me by HP and by the k5dcelogin.c which I developed.
* A slightly different version of k5dcelogin.c, was added to * A slightly different version of k5dcelogin.c, was added to
* DCE 1.2.2 * DCE 1.2.2
* *
* D. E. Engert 6/17/97 ANL * D. E. Engert 6/17/97 ANL
*/ */
@@ -89,9 +89,9 @@ static time_t now;
#ifdef _AIX #ifdef _AIX
/*---------------------------------------------*/ /*---------------------------------------------*/
/* AIX with DCE 1.1 does not have the com_err in the libdce.a /* AIX with DCE 1.1 does not have the com_err in the libdce.a
* do a half hearted job of substituting for it. * do a half hearted job of substituting for it.
*/ */
void com_err(char *p1, int code, ...) void com_err(char *p1, int code, ...)
{ {
int lst; int lst;
dce_error_string_t err_string; dce_error_string_t err_string;
@@ -112,17 +112,17 @@ void krb5_init_ets()
/* find a cache to use for our new pag */ /* find a cache to use for our new pag */
/* Since there is no simple way to determine which /* Since there is no simple way to determine which
* caches are associated with a pag, we will have * caches are associated with a pag, we will have
* do look around and see what makes most sense on * do look around and see what makes most sense on
* different systems. * different systems.
* on a Solaris system, and in the DCE source, * on a Solaris system, and in the DCE source,
* the pags always start with a 41. * the pags always start with a 41.
* this is not true on the IBM, where there does not * this is not true on the IBM, where there does not
* appear to be any pattern. * appear to be any pattern.
* *
* But since we are always certifing our creds when * But since we are always certifing our creds when
* they are received, we can us that fact, and look * they are received, we can us that fact, and look
* at the first word of the associated data file * at the first word of the associated data file
* to see that it has a "5". If not don't use. * to see that it has a "5". If not don't use.
*/ */
int k5dcesession(luid, pname, tgt, ppag, tflags) int k5dcesession(luid, pname, tgt, ppag, tflags)
@@ -139,13 +139,13 @@ int k5dcesession(luid, pname, tgt, ppag, tflags)
int better = 0; int better = 0;
krb5_creds *xtgt; krb5_creds *xtgt;
char prev_name[17] = ""; char prev_name[17] = "";
krb5_timestamp prev_endtime; krb5_timestamp prev_endtime;
off_t prev_size; off_t prev_size;
u_long prev_pag = 0; u_long prev_pag = 0;
char ccname[64] = "FILE:/opt/dcelocal/var/security/creds/"; char ccname[64] = "FILE:/opt/dcelocal/var/security/creds/";
error_status_t st; error_status_t st;
sec_login_handle_t lcontext = 0; sec_login_handle_t lcontext = 0;
dce_error_string_t err_string; dce_error_string_t err_string;
@@ -160,7 +160,7 @@ int k5dcesession(luid, pname, tgt, ppag, tflags)
while ( (direntp = readdir( dirp )) != NULL ) { while ( (direntp = readdir( dirp )) != NULL ) {
/* /*
* (but root has the ffffffff which we are not interested in) * (but root has the ffffffff which we are not interested in)
*/ */
if (!strncmp(direntp->d_name,"dcecred_",8) if (!strncmp(direntp->d_name,"dcecred_",8)
@@ -171,25 +171,25 @@ int k5dcesession(luid, pname, tgt, ppag, tflags)
strcpy(ccname+38,direntp->d_name); strcpy(ccname+38,direntp->d_name);
if (!k5dcematch(luid, pname, ccname, &size, &xtgt)) { if (!k5dcematch(luid, pname, ccname, &size, &xtgt)) {
/* it's one of our caches, see if it is better /* it's one of our caches, see if it is better
* i.e. the endtime is farther, and if the endtimes * i.e. the endtime is farther, and if the endtimes
* are the same, take the larger, as he who has the * are the same, take the larger, as he who has the
* most tickets wins. * most tickets wins.
* it must also had the same set of flags at least * it must also had the same set of flags at least
* i.e. if the forwarded TGT is forwardable, this one must * i.e. if the forwarded TGT is forwardable, this one must
* be as well. * be as well.
*/ */
DEEDEBUG2("Cache:%s",direntp->d_name); DEEDEBUG2("Cache:%s",direntp->d_name);
DEEDEBUG2(" size:%d",size); DEEDEBUG2(" size:%d",size);
DEEDEBUG2(" flags:%8.8x",xtgt->ticket_flags); DEEDEBUG2(" flags:%8.8x",xtgt->ticket_flags);
DEEDEBUG2(" %s",ctime((time_t *)&xtgt->times.endtime)); DEEDEBUG2(" %s",ctime((time_t *)&xtgt->times.endtime));
if ((xtgt->ticket_flags & tflags) == tflags ) { if ((xtgt->ticket_flags & tflags) == tflags ) {
if (prev_name[0]) { if (prev_name[0]) {
if (xtgt->times.endtime > prev_endtime) { if (xtgt->times.endtime > prev_endtime) {
better = 1; better = 1;
} else if ((xtgt->times.endtime = prev_endtime) } else if ((xtgt->times.endtime = prev_endtime)
&& (size > prev_size)){ && (size > prev_size)){
better = 1; better = 1;
} }
@@ -207,12 +207,12 @@ int k5dcesession(luid, pname, tgt, ppag, tflags)
better = 0; better = 0;
} }
} }
} }
} }
} }
(void)closedir( dirp ); (void)closedir( dirp );
if (!prev_name[0]) if (!prev_name[0])
return 1; /* failed to find one */ return 1; /* failed to find one */
DEEDEBUG2("Best: %s\n",prev_name); DEEDEBUG2("Best: %s\n",prev_name);
@@ -222,7 +222,7 @@ int k5dcesession(luid, pname, tgt, ppag, tflags)
strcpy(ccname+38,prev_name); strcpy(ccname+38,prev_name);
setenv("KRB5CCNAME",ccname,1); setenv("KRB5CCNAME",ccname,1);
return(0); return(0);
} }
@@ -230,7 +230,7 @@ int k5dcesession(luid, pname, tgt, ppag, tflags)
/*----------------------------------------------*/ /*----------------------------------------------*/
/* see if this cache is for this this principal */ /* see if this cache is for this this principal */
int k5dcematch(luid, pname, ccname, sizep, tgt) int k5dcematch(luid, pname, ccname, sizep, tgt)
uid_t luid; uid_t luid;
char *pname; char *pname;
char *ccname; char *ccname;
@@ -255,18 +255,18 @@ int k5dcematch(luid, pname, ccname, sizep, tgt)
if (stat(ccdata, &stbuf)) if (stat(ccdata, &stbuf))
return(1); return(1);
if (stbuf.st_uid != luid) if (stbuf.st_uid != luid)
return(1); return(1);
if ((fd = open(ccdata,O_RDONLY)) == -1) if ((fd = open(ccdata,O_RDONLY)) == -1)
return(1); return(1);
if ((read(fd,&status,4)) != 4) { if ((read(fd,&status,4)) != 4) {
close(fd); close(fd);
return(1); return(1);
} }
/* DEEDEBUG2(".data file status = %d\n", status); */ /* DEEDEBUG2(".data file status = %d\n", status); */
if (status != 5) if (status != 5)
@@ -306,13 +306,13 @@ int k5dcegettgt(pcache, ccname, pname, tgt)
char *sname, *realm, *tgtname = NULL; char *sname, *realm, *tgtname = NULL;
/* Since DCE does not expose much of the Kerberos interface, /* Since DCE does not expose much of the Kerberos interface,
* we will have to use what we can. This means setting the * we will have to use what we can. This means setting the
* KRB5CCNAME for each file we want to test * KRB5CCNAME for each file we want to test
* We will also not worry about freeing extra cache structures * We will also not worry about freeing extra cache structures
* as this this routine is also not exposed, and this should not * as this this routine is also not exposed, and this should not
* effect this module. * effect this module.
* We should also free the creds contents, but that is not exposed * We should also free the creds contents, but that is not exposed
* either. * either.
*/ */
setenv("KRB5CCNAME",ccname,1); setenv("KRB5CCNAME",ccname,1);
@@ -327,7 +327,7 @@ int k5dcegettgt(pcache, ccname, pname, tgt)
DEEDEBUG("Got cache\n"); DEEDEBUG("Got cache\n");
flags = 0; flags = 0;
if (code = krb5_cc_set_flags(*pcache, flags)) { if (code = krb5_cc_set_flags(*pcache, flags)) {
com_err(progname, code,"While setting flags"); com_err(progname, code,"While setting flags");
goto return2; goto return2;
} }
DEEDEBUG("Set flags\n"); DEEDEBUG("Set flags\n");
@@ -361,7 +361,7 @@ int k5dcegettgt(pcache, ccname, pname, tgt)
strcat(tgtname,realm); strcat(tgtname,realm);
strcat(tgtname,"@"); strcat(tgtname,"@");
strcat(tgtname,realm); strcat(tgtname,realm);
DEEDEBUG2("Getting tgt %s\n", tgtname); DEEDEBUG2("Getting tgt %s\n", tgtname);
if (code = krb5_cc_start_seq_get(*pcache, &cur)) { if (code = krb5_cc_start_seq_get(*pcache, &cur)) {
com_err(progname, code, "while starting to retrieve tickets"); com_err(progname, code, "while starting to retrieve tickets");
@@ -384,19 +384,19 @@ int k5dcegettgt(pcache, ccname, pname, tgt)
} }
found = 0; found = 0;
break; break;
} }
/* we should do a krb5_free_cred_contents(creds); */ /* we should do a krb5_free_cred_contents(creds); */
} }
if (code = krb5_cc_end_seq_get(*pcache, &cur)) { if (code = krb5_cc_end_seq_get(*pcache, &cur)) {
com_err(progname, code, "while finishing retrieval"); com_err(progname, code, "while finishing retrieval");
goto return2; goto return2;
} }
return1: return1:
flags = KRB5_TC_OPENCLOSE; flags = KRB5_TC_OPENCLOSE;
krb5_cc_set_flags(*pcache, flags); /* force a close */ krb5_cc_set_flags(*pcache, flags); /* force a close */
return2: return2:
if (tgtname) if (tgtname)
free(tgtname); free(tgtname);
@@ -442,7 +442,7 @@ int k5dcecon(luid, luser, pname)
return(1); return(1);
} }
DEEDEBUG2("flags=%x\n",ftgt->ticket_flags); DEEDEBUG2("flags=%x\n",ftgt->ticket_flags);
if (!(ftgt->ticket_flags & TKT_FLG_FORWARDABLE)){ if (!(ftgt->ticket_flags & TKT_FLG_FORWARDABLE)){
fprintf(stderr,"Ticket not forwardable\n"); fprintf(stderr,"Ticket not forwardable\n");
@@ -450,21 +450,21 @@ int k5dcecon(luid, luser, pname)
} }
setenv("KRB5CCNAME","",1); setenv("KRB5CCNAME","",1);
#define TKT_ACCEPTABLE (TKT_FLG_FORWARDABLE | TKT_FLG_PROXIABLE \ #define TKT_ACCEPTABLE (TKT_FLG_FORWARDABLE | TKT_FLG_PROXIABLE \
| TKT_FLG_MAY_POSTDATE | TKT_FLG_RENEWABLE | TKT_FLG_HW_AUTH \ | TKT_FLG_MAY_POSTDATE | TKT_FLG_RENEWABLE | TKT_FLG_HW_AUTH \
| TKT_FLG_PRE_AUTH) | TKT_FLG_PRE_AUTH)
if (!k5dcesession(luid, pname, &tgt, &pag, if (!k5dcesession(luid, pname, &tgt, &pag,
(ftgt->ticket_flags & TKT_ACCEPTABLE))) { (ftgt->ticket_flags & TKT_ACCEPTABLE))) {
if (ftgt->times.endtime > tgt->times.endtime) { if (ftgt->times.endtime > tgt->times.endtime) {
DEEDEBUG("Updating existing cache\n"); DEEDEBUG("Updating existing cache\n");
return(k5dceupdate(&ftgt, pag)); return(k5dceupdate(&ftgt, pag));
} else { } else {
DEEDEBUG("Using existing cache\n"); DEEDEBUG("Using existing cache\n");
return(0); /* use the original one */ return(0); /* use the original one */
} }
} }
/* see if the tgts match up */ /* see if the tgts match up */
if ((code = k5dcecreate(luid, luser, pname, &ftgt))) { if ((code = k5dcecreate(luid, luser, pname, &ftgt))) {
@@ -473,7 +473,7 @@ int k5dcecon(luid, luser, pname)
/* /*
* Destroy the Kerberos5 cred cache file. * Destroy the Kerberos5 cred cache file.
* but dont care aout the return code. * but dont care aout the return code.
*/ */
DEEDEBUG("Destroying the old cache\n"); DEEDEBUG("Destroying the old cache\n");
@@ -488,11 +488,11 @@ int k5dcecon(luid, luser, pname)
/* k5dceupdate - update the cache with a new TGT */ /* k5dceupdate - update the cache with a new TGT */
/* Assumed that the KRB5CCNAME has been set */ /* Assumed that the KRB5CCNAME has been set */
int k5dceupdate(krbtgt, pag) int k5dceupdate(krbtgt, pag)
krb5_creds **krbtgt; krb5_creds **krbtgt;
int pag; int pag;
{ {
krb5_ccache ccache; krb5_ccache ccache;
int code; int code;
@@ -504,7 +504,7 @@ int k5dceupdate(krbtgt, pag)
if (code = ccache->ops->init(ccache,(*krbtgt)->client)) { if (code = ccache->ops->init(ccache,(*krbtgt)->client)) {
com_err(progname, code, "while reinitilizing cache"); com_err(progname, code, "while reinitilizing cache");
return(3); return(3);
} }
/* krb5_cc_store_cred */ /* krb5_cc_store_cred */
if (code = ccache->ops->store(ccache, *krbtgt)) { if (code = ccache->ops->store(ccache, *krbtgt)) {
@@ -524,7 +524,7 @@ int k5dcecreate(luid, luser, pname, krbtgt)
char *pname; char *pname;
krb5_creds **krbtgt; krb5_creds **krbtgt;
{ {
char *cp; char *cp;
char *urealm; char *urealm;
char *username; char *username;
@@ -542,7 +542,7 @@ int k5dcecreate(luid, luser, pname, krbtgt)
uid = getuid(); uid = getuid();
DEEDEBUG2("uid=%d\n",uid); DEEDEBUG2("uid=%d\n",uid);
/* if run as root, change to user, so as to have the /* if run as root, change to user, so as to have the
* cache created for the local user even if cross-cell * cache created for the local user even if cross-cell
* If run as a user, let standard file protection work. * If run as a user, let standard file protection work.
@@ -551,7 +551,7 @@ int k5dcecreate(luid, luser, pname, krbtgt)
if (uid == 0) { if (uid == 0) {
if (seteuid(luid) < 0) if (seteuid(luid) < 0)
goto abort; goto abort;
} }
cp = strchr(pname,'@'); cp = strchr(pname,'@');
*cp = '\0'; *cp = '\0';
@@ -587,7 +587,7 @@ int k5dcecreate(luid, luser, pname, krbtgt)
* Setup a DCE login context * Setup a DCE login context
*/ */
if (sec_login_setup_identity((unsigned_char_p_t)username, if (sec_login_setup_identity((unsigned_char_p_t)username,
(sec_login_external_tgt|sec_login_proxy_cred), (sec_login_external_tgt|sec_login_proxy_cred),
&lcontext, &st)) { &lcontext, &st)) {
/* /*
@@ -598,7 +598,7 @@ int k5dcecreate(luid, luser, pname, krbtgt)
if (st) { if (st) {
dce_error_inq_text(st, err_string, &lst); dce_error_inq_text(st, err_string, &lst);
fprintf(stderr, fprintf(stderr,
"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;
} }
@@ -630,12 +630,12 @@ int k5dcecreate(luid, luser, pname, krbtgt)
} }
if (auth_src == sec_login_auth_src_local) { if (auth_src == sec_login_auth_src_local) {
fprintf(stderr, fprintf(stderr,
"Credentials obtained from local registry for %s\n", "Credentials obtained from local registry for %s\n",
username); username);
} }
if (auth_src == sec_login_auth_src_overridden) { if (auth_src == sec_login_auth_src_overridden) {
fprintf(stderr, "Validated %s from local override entry, no network credentials obtained\n", username); fprintf(stderr, "Validated %s from local override entry, no network credentials obtained\n", username);
goto abort; goto abort;
} }
/* /*
@@ -645,14 +645,14 @@ int k5dcecreate(luid, luser, pname, krbtgt)
sec_login_set_context(lcontext, &st); sec_login_set_context(lcontext, &st);
if (st) { if (st) {
dce_error_inq_text(st, err_string, &lst); dce_error_inq_text(st, err_string, &lst);
fprintf(stderr, fprintf(stderr,
"Unable to set context for %s because %s\n", "Unable to set context for %s because %s\n",
username, err_string); username, err_string);
goto abort; goto abort;
} }
/* /*
* Now free up the local context and leave the * Now free up the local context and leave the
* network context with its pag * network context with its pag
*/ */
#if 0 #if 0
@@ -670,14 +670,14 @@ int k5dcecreate(luid, luser, pname, krbtgt)
DEEDEBUG2("validate failed %d\n",st); DEEDEBUG2("validate failed %d\n",st);
dce_error_inq_text(st, err_string, &lst); dce_error_inq_text(st, err_string, &lst);
fprintf(stderr, fprintf(stderr,
"Unable to validate %s because %s\n", username, "Unable to validate %s because %s\n", username,
err_string); err_string);
goto abort; goto abort;
} }
} }
else { else {
dce_error_inq_text(st, err_string, &lst); dce_error_inq_text(st, err_string, &lst);
fprintf(stderr, fprintf(stderr,
"Unable to setup login entry for %s because %s\n", "Unable to setup login entry for %s because %s\n",
username, err_string); username, err_string);
goto abort; goto abort;
@@ -691,7 +691,7 @@ int k5dcecreate(luid, luser, pname, krbtgt)
if (uid == 0) { if (uid == 0) {
seteuid(0); seteuid(0);
} }
DEEDEBUG("completed\n"); DEEDEBUG("completed\n");
return(0); return(0);
@@ -699,7 +699,7 @@ int k5dcecreate(luid, luser, pname, krbtgt)
abort: abort:
if (uid == 0) { if (uid == 0) {
seteuid(0); seteuid(0);
} }
DEEDEBUG("Aborting\n"); DEEDEBUG("Aborting\n");
return(2); return(2);
@@ -744,14 +744,14 @@ main(argc, argv)
DEEDEBUG2("Optarg = %s\n", optarg); DEEDEBUG2("Optarg = %s\n", optarg);
break; break;
case 'p': /* principal name */ case 'p': /* principal name */
pname = optarg; pname = optarg;
DEEDEBUG2("Optarg = %s\n", optarg); DEEDEBUG2("Optarg = %s\n", optarg);
break; break;
case 'f': /* convert a forwarded TGT to a context */ case 'f': /* convert a forwarded TGT to a context */
fflag++; fflag++;
break; break;
case 's': /* old test parameter, ignore it */ case 's': /* old test parameter, ignore it */
break; break;
} }
} }
@@ -759,7 +759,7 @@ main(argc, argv)
krb5_init_ets(); krb5_init_ets();
time(&now); /* set time to check expired tickets */ time(&now); /* set time to check expired tickets */
/* if lusername == NULL, Then user is passed as the USER= variable */ /* if lusername == NULL, Then user is passed as the USER= variable */
if (!lusername) { if (!lusername) {
lusername = getenv("USER"); lusername = getenv("USER");
@@ -776,12 +776,12 @@ main(argc, argv)
luid = pw->pw_uid; luid = pw->pw_uid;
if (fflag) { if (fflag) {
status = k5dcecon(luid, lusername, pname); status = k5dcecon(luid, lusername, pname);
} else { } else {
status = k5dcesession(luid, pname, &tgt, NULL, 0); status = k5dcesession(luid, pname, &tgt, NULL, 0);
} }
if (!status) { if (!status) {
printf("%s",getenv("KRB5CCNAME")); /* return via stdout to caller */ printf("%s",getenv("KRB5CCNAME")); /* return via stdout to caller */
DEEDEBUG2("KRB5CCNAME=%s\n",getenv("KRB5CCNAME")); DEEDEBUG2("KRB5CCNAME=%s\n",getenv("KRB5CCNAME"));

View File

@@ -1,11 +1,11 @@
/* Test the k5dcepag routine by setting a pag, and /* Test the k5dcepag routine by setting a pag, and
* and execing a shell under this pag. * and execing a shell under this pag.
* *
* This allows you to join a PAG which was created * This allows you to join a PAG which was created
* earlier by some other means. * earlier by some other means.
* for example k5dcecon * for example k5dcecon
* *
* Must be run as root for testing only. * Must be run as root for testing only.
* *
*/ */
@@ -84,12 +84,12 @@ int krb5_dfs_newpag(new_pag)
handler_init (sa2, mysig); handler_init (sa2, mysig);
handler_swap (SIGSYS, sa1, osa1); handler_swap (SIGSYS, sa1, osa1);
handler_swap (SIGSEGV, sa2, osa2); handler_swap (SIGSEGV, sa2, osa2);
if (sigsetjmp(setpag_buf, 1) == 0) { if (sigsetjmp(setpag_buf, 1) == 0) {
#if defined(_AIX) #if defined(_AIX)
int (*dpagaix)(int, int, int, int, int, int); int (*dpagaix)(int, int, int, int, int, int);
if (dpagaix = load(DPAGAIX, 0, 0)) if (dpagaix = load(DPAGAIX, 0, 0))
pag = (*dpagaix)(AFSCALL_SETPAG, new_pag, 0, 0, 0, 0); pag = (*dpagaix)(AFSCALL_SETPAG, new_pag, 0, 0, 0, 0);
#else #else
pag = syscall(AFS_SYSCALL,AFSCALL_SETPAG, new_pag, 0, 0, 0, 0); pag = syscall(AFS_SYSCALL,AFSCALL_SETPAG, new_pag, 0, 0, 0, 0);
@@ -118,7 +118,7 @@ main(argc, argv)
unsigned int newpag = 0; unsigned int newpag = 0;
char ccname[256]; char ccname[256];
int nflag = 0; int nflag = 0;
while((rv = getopt(argc,argv,"n:")) != -1) { while((rv = getopt(argc,argv,"n:")) != -1) {
switch(rv) { switch(rv) {
case 'n': case 'n':
@@ -138,7 +138,7 @@ main(argc, argv)
fprintf (stderr,"PAG returned = %8.8x\n",pag); fprintf (stderr,"PAG returned = %8.8x\n",pag);
if ((pag != 0) && (pag != -1)) { if ((pag != 0) && (pag != -1)) {
sprintf (ccname, sprintf (ccname,
"FILE:/opt/dcelocal/var/security/creds/dcecred_%8.8x", "FILE:/opt/dcelocal/var/security/creds/dcecred_%8.8x",
pag); pag);
esetenv("KRB5CCNAME",ccname,1); esetenv("KRB5CCNAME",ccname,1);
execl("/bin/csh", "csh", NULL); execl("/bin/csh", "csh", NULL);

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995-2000 Kungliga Tekniska Högskolan * Copyright (c) 1995-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 * 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

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan * Copyright (c) 1995, 1996, 1997, 1998, 1999 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

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan * Copyright (c) 1995, 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 * 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
@@ -61,7 +61,7 @@ set_buffer_size(int fd, int read)
} }
#endif /* HAVE_GETSOCKOPT */ #endif /* HAVE_GETSOCKOPT */
while(size >= 131072 && while(size >= 131072 &&
setsockopt(fd, SOL_SOCKET, optname, (void *)&size, sizeof(size)) < 0) setsockopt(fd, SOL_SOCKET, optname, (void *)&size, sizeof(size)) < 0)
size /= 2; size /= 2;
#endif #endif

View File

@@ -189,7 +189,7 @@ setpeer(int argc, char **argv)
unix_proxy = 0; unix_proxy = 0;
else else
unix_server = 0; unix_server = 0;
if (overbose && if (overbose &&
!strncmp(reply_string, "215 TOPS20", 10)) !strncmp(reply_string, "215 TOPS20", 10))
printf( printf(
"Remember to set tenex mode when transfering binary files from this machine.\n"); "Remember to set tenex mode when transfering binary files from this machine.\n");
@@ -682,15 +682,15 @@ getit(int argc, char **argv, int restartit, char *filemode)
tm->tm_year += 1900; tm->tm_year += 1900;
if ((tm->tm_year > yy) || if ((tm->tm_year > yy) ||
(tm->tm_year == yy && (tm->tm_year == yy &&
tm->tm_mon > mo) || tm->tm_mon > mo) ||
(tm->tm_mon == mo && (tm->tm_mon == mo &&
tm->tm_mday > day) || tm->tm_mday > day) ||
(tm->tm_mday == day && (tm->tm_mday == day &&
tm->tm_hour > hour) || tm->tm_hour > hour) ||
(tm->tm_hour == hour && (tm->tm_hour == hour &&
tm->tm_min > min) || tm->tm_min > min) ||
(tm->tm_min == min && (tm->tm_min == min &&
tm->tm_sec > sec)) tm->tm_sec > sec))
return (1); return (1);
} }
@@ -868,7 +868,7 @@ status(int argc, char **argv)
sec_status(); sec_status();
printf("Mode: %s; Type: %s; Form: %s; Structure: %s\n", printf("Mode: %s; Type: %s; Form: %s; Structure: %s\n",
modename, typename, formname, structname); modename, typename, formname, structname);
printf("Verbose: %s; Bell: %s; Prompting: %s; Globbing: %s\n", printf("Verbose: %s; Bell: %s; Prompting: %s; Globbing: %s\n",
onoff(verbose), onoff(bell), onoff(interactive), onoff(verbose), onoff(bell), onoff(interactive),
onoff(doglob)); onoff(doglob));
printf("Store unique: %s; Receive unique: %s\n", onoff(sunique), printf("Store unique: %s; Receive unique: %s\n", onoff(sunique),
@@ -1171,7 +1171,7 @@ ls(int argc, char **argv)
return; return;
} }
if (strcmp(argv[2], "-") && *argv[2] != '|') if (strcmp(argv[2], "-") && *argv[2] != '|')
if (!globulize(&argv[2]) || !confirm("output to local-file:", if (!globulize(&argv[2]) || !confirm("output to local-file:",
argv[2])) { argv[2])) {
code = -1; code = -1;
return; return;
@@ -1237,7 +1237,7 @@ shell(int argc, char **argv)
{ {
pid_t pid; pid_t pid;
RETSIGTYPE (*old1)(int), (*old2)(int); RETSIGTYPE (*old1)(int), (*old2)(int);
char shellnam[40], *shellpath, *namep; char shellnam[40], *shellpath, *namep;
int waitstatus; int waitstatus;
old1 = signal (SIGINT, SIG_IGN); old1 = signal (SIGINT, SIG_IGN);
@@ -1833,7 +1833,7 @@ domap(char *name)
break; break;
case '[': case '[':
LOOP: LOOP:
if (*++cp2 == '$' && isdigit((unsigned char)*(cp2+1))) { if (*++cp2 == '$' && isdigit((unsigned char)*(cp2+1))) {
if (*++cp2 == '0') { if (*++cp2 == '0') {
char *cp3 = name; char *cp3 = name;
@@ -1852,7 +1852,7 @@ LOOP:
} }
} }
else { else {
while (*cp2 && *cp2 != ',' && while (*cp2 && *cp2 != ',' &&
*cp2 != ']') { *cp2 != ']') {
if (*cp2 == '\\') { if (*cp2 == '\\') {
cp2++; cp2++;
@@ -2137,7 +2137,7 @@ klist(int argc, char **argv)
code = -1; code = -1;
return; return;
} }
ret = command("SITE KLIST"); ret = command("SITE KLIST");
code = (ret == COMPLETE); code = (ret == COMPLETE);
} }

View File

@@ -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;
@@ -202,16 +202,16 @@ login (char *host)
} }
strlcpy(username, userstr, sizeof(username)); strlcpy(username, userstr, sizeof(username));
n = command("USER %s", userstr); n = command("USER %s", userstr);
if (n == COMPLETE) if (n == COMPLETE)
n = command("PASS dummy"); /* DK: Compatibility with gssftp daemon */ n = command("PASS dummy"); /* DK: Compatibility with gssftp daemon */
else if(n == CONTINUE) { else if(n == CONTINUE) {
if (pass == NULL) { if (pass == NULL) {
char prompt[128]; char prompt[128];
if(myname && if(myname &&
(!strcmp(userstr, "ftp") || !strcmp(userstr, "anonymous"))) { (!strcmp(userstr, "ftp") || !strcmp(userstr, "anonymous"))) {
snprintf(defaultpass, sizeof(defaultpass), snprintf(defaultpass, sizeof(defaultpass),
"%s@%s", myname, mydomain); "%s@%s", myname, mydomain);
snprintf(prompt, sizeof(prompt), snprintf(prompt, sizeof(prompt),
"Password (%s): ", defaultpass); "Password (%s): ", defaultpass);
} else if (sec_complete) { } else if (sec_complete) {
pass = myname; pass = myname;
@@ -417,7 +417,7 @@ getreply (int expecteof)
continue; continue;
default: default:
if(p < buf + sizeof(buf) - 1) if(p < buf + sizeof(buf) - 1)
*p++ = c; *p++ = c;
else if(long_warn == 0) { else if(long_warn == 0) {
fprintf(stderr, "WARNING: incredibly long line received\n"); fprintf(stderr, "WARNING: incredibly long line received\n");
long_warn = 1; long_warn = 1;
@@ -1338,7 +1338,7 @@ noport:
verbose = -1; verbose = -1;
result = command ("EPRT |%d|%s|%d|", result = command ("EPRT |%d|%s|%d|",
inet_af, addr_str, inet_af, addr_str,
ntohs(socket_get_port (data_addr))); ntohs(socket_get_port (data_addr)));
verbose = overbose; verbose = overbose;
@@ -1353,7 +1353,7 @@ noport:
goto bad; goto bad;
} }
result = command("PORT %d,%d,%d,%d,%d,%d", result = command("PORT %d,%d,%d,%d,%d,%d",
(a >> 24) & 0xff, (a >> 24) & 0xff,
(a >> 16) & 0xff, (a >> 16) & 0xff,
(a >> 8) & 0xff, (a >> 8) & 0xff,
@@ -1392,7 +1392,7 @@ bad:
int int
initconn (void) initconn (void)
{ {
if (passivemode) if (passivemode)
return passive_mode (); return passive_mode ();
else else
return active_mode (); return active_mode ();

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan * Copyright (c) 1995 - 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 * 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

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 1998 - 2005 Kungliga Tekniska Högskolan * Copyright (c) 1998 - 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.
*/ */
#ifdef FTP_SERVER #ifdef FTP_SERVER
@@ -265,7 +265,7 @@ gss_adat(void *app_data, void *buf, size_t len)
GSS_C_NO_OID, GSS_C_NO_OID,
&msg_ctx, &msg_ctx,
&status_string); &status_string);
syslog(LOG_ERR, "gss_accept_sec_context: %s", syslog(LOG_ERR, "gss_accept_sec_context: %s",
(char*)status_string.value); (char*)status_string.value);
gss_release_buffer(&new_stat, &status_string); gss_release_buffer(&new_stat, &status_string);
reply(431, "Security resource unavailable"); reply(431, "Security resource unavailable");
@@ -324,14 +324,14 @@ 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,
GSS_C_NO_OID, GSS_C_NO_OID,
&msg_ctx, &msg_ctx,
&status_string); &status_string);
printf("Error importing name %s: %s\n", printf("Error importing name %s: %s\n",
(char *)name.value, (char *)name.value,
(char *)status_string.value); (char *)status_string.value);
free(name.value); free(name.value);
@@ -345,7 +345,7 @@ import_name(const char *kname, const char *host, gss_name_t *target_name)
static int static int
gss_auth(void *app_data, char *host) gss_auth(void *app_data, char *host)
{ {
OM_uint32 maj_stat, min_stat; OM_uint32 maj_stat, min_stat;
gss_name_t target_name; gss_name_t target_name;
gss_buffer_desc input, output_token; gss_buffer_desc input, output_token;
@@ -357,8 +357,8 @@ 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;
@@ -417,7 +417,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);
@@ -427,7 +427,7 @@ gss_auth(void *app_data, char *host)
GSS_C_NO_OID, GSS_C_NO_OID,
&msg_ctx, &msg_ctx,
&status_string); &status_string);
printf("Error initializing security context: %s\n", printf("Error initializing security context: %s\n",
(char*)status_string.value); (char*)status_string.value);
gss_release_buffer(&new_stat, &status_string); gss_release_buffer(&new_stat, &status_string);
return AUTH_CONTINUE; return AUTH_CONTINUE;
@@ -507,7 +507,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

@@ -2,22 +2,22 @@
* Copyright (c) 1995-1999 Kungliga Tekniska Högskolan * Copyright (c) 1995-1999 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
@@ -92,7 +92,7 @@ kauth(int argc, char **argv)
} }
tkt.length = tmp; tkt.length = tmp;
tktcopy.length = tkt.length; tktcopy.length = tkt.length;
p = strstr(reply_string, "P="); p = strstr(reply_string, "P=");
if(!p){ if(!p){
printf("Bad reply from server.\n"); printf("Bad reply from server.\n");
@@ -104,14 +104,14 @@ kauth(int argc, char **argv)
name = p + 2; name = p + 2;
for(; *p && *p != ' ' && *p != '\r' && *p != '\n'; p++); for(; *p && *p != ' ' && *p != '\r' && *p != '\n'; p++);
*p = 0; *p = 0;
snprintf(buf, sizeof(buf), "Password for %s:", name); snprintf(buf, sizeof(buf), "Password for %s:", name);
if (des_read_pw_string (passwd, sizeof(passwd)-1, buf, 0)) if (des_read_pw_string (passwd, sizeof(passwd)-1, buf, 0))
*passwd = '\0'; *passwd = '\0';
des_string_to_key (passwd, &key); des_string_to_key (passwd, &key);
des_key_sched(&key, schedule); des_key_sched(&key, schedule);
des_pcbc_encrypt((des_cblock*)tkt.dat, (des_cblock*)tktcopy.dat, des_pcbc_encrypt((des_cblock*)tkt.dat, (des_cblock*)tktcopy.dat,
tkt.length, tkt.length,
schedule, &key, DES_DECRYPT); schedule, &key, DES_DECRYPT);

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan * Copyright (c) 1995, 1996, 1997, 1998, 1999 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
@@ -72,13 +72,13 @@ krb4_decode(void *app_data, void *buf, int len, int level)
MSG_DAT m; MSG_DAT m;
int e; int e;
struct krb4_data *d = app_data; struct krb4_data *d = app_data;
if(level == prot_safe) if(level == prot_safe)
e = krb_rd_safe(buf, len, &d->key, e = krb_rd_safe(buf, len, &d->key,
(struct sockaddr_in *)REMOTE_ADDR, (struct sockaddr_in *)REMOTE_ADDR,
(struct sockaddr_in *)LOCAL_ADDR, &m); (struct sockaddr_in *)LOCAL_ADDR, &m);
else else
e = krb_rd_priv(buf, len, d->schedule, &d->key, e = krb_rd_priv(buf, len, d->schedule, &d->key,
(struct sockaddr_in *)REMOTE_ADDR, (struct sockaddr_in *)REMOTE_ADDR,
(struct sockaddr_in *)LOCAL_ADDR, &m); (struct sockaddr_in *)LOCAL_ADDR, &m);
if(e){ if(e){
@@ -101,11 +101,11 @@ krb4_encode(void *app_data, void *from, int length, int level, void **to)
struct krb4_data *d = app_data; struct krb4_data *d = app_data;
*to = malloc(length + 31); *to = malloc(length + 31);
if(level == prot_safe) if(level == prot_safe)
return krb_mk_safe(from, *to, length, &d->key, return krb_mk_safe(from, *to, length, &d->key,
(struct sockaddr_in *)LOCAL_ADDR, (struct sockaddr_in *)LOCAL_ADDR,
(struct sockaddr_in *)REMOTE_ADDR); (struct sockaddr_in *)REMOTE_ADDR);
else if(level == prot_private) else if(level == prot_private)
return krb_mk_priv(from, *to, length, d->schedule, &d->key, return krb_mk_priv(from, *to, length, d->schedule, &d->key,
(struct sockaddr_in *)LOCAL_ADDR, (struct sockaddr_in *)LOCAL_ADDR,
(struct sockaddr_in *)REMOTE_ADDR); (struct sockaddr_in *)REMOTE_ADDR);
else else
@@ -132,11 +132,11 @@ krb4_adat(void *app_data, void *buf, size_t len)
tkt.length = len; tkt.length = len;
k_getsockinst(0, inst, sizeof(inst)); k_getsockinst(0, inst, sizeof(inst));
kerror = krb_rd_req(&tkt, "ftp", inst, kerror = krb_rd_req(&tkt, "ftp", inst,
his_addr_sin->sin_addr.s_addr, &auth_dat, ""); his_addr_sin->sin_addr.s_addr, &auth_dat, "");
if(kerror == RD_AP_UNDEC){ if(kerror == RD_AP_UNDEC){
k_getsockinst(0, inst, sizeof(inst)); k_getsockinst(0, inst, sizeof(inst));
kerror = krb_rd_req(&tkt, "rcmd", inst, kerror = krb_rd_req(&tkt, "rcmd", inst,
his_addr_sin->sin_addr.s_addr, &auth_dat, ""); his_addr_sin->sin_addr.s_addr, &auth_dat, "");
} }
@@ -144,7 +144,7 @@ krb4_adat(void *app_data, void *buf, size_t len)
reply(535, "Error reading request: %s.", krb_get_err_text(kerror)); reply(535, "Error reading request: %s.", krb_get_err_text(kerror));
return -1; return -1;
} }
memcpy(d->key, auth_dat.session, sizeof(d->key)); memcpy(d->key, auth_dat.session, sizeof(d->key));
des_set_key(&d->key, d->schedule); des_set_key(&d->key, d->schedule);
@@ -208,7 +208,7 @@ krb4_init(void *app_data)
} }
static int static int
mk_auth(struct krb4_data *d, KTEXT adat, mk_auth(struct krb4_data *d, KTEXT adat,
char *service, char *host, int checksum) char *service, char *host, int checksum)
{ {
int ret; int ret;
@@ -268,7 +268,7 @@ krb4_auth(void *app_data, char *host)
printf("Using NAT IP address (%s) for kerberos 4\n", printf("Using NAT IP address (%s) for kerberos 4\n",
inet_ntoa(natAddr)); inet_ntoa(natAddr));
localaddr->sin_addr = natAddr; localaddr->sin_addr = natAddr;
/* /*
* This not the best place to do this, but it * This not the best place to do this, but it
* is here we know that (probably) NAT is in * is here we know that (probably) NAT is in
@@ -309,11 +309,11 @@ krb4_auth(void *app_data, char *host)
return AUTH_ERROR; return AUTH_ERROR;
} }
adat.length = len; adat.length = len;
ret = krb_rd_safe(adat.dat, adat.length, &d->key, ret = krb_rd_safe(adat.dat, adat.length, &d->key,
(struct sockaddr_in *)hisctladdr, (struct sockaddr_in *)hisctladdr,
(struct sockaddr_in *)myctladdr, &msg_data); (struct sockaddr_in *)myctladdr, &msg_data);
if(ret){ if(ret){
printf("Error reading reply from server: %s.\n", printf("Error reading reply from server: %s.\n",
krb_get_err_text(ret)); krb_get_err_text(ret));
return AUTH_ERROR; return AUTH_ERROR;
} }

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);

View File

@@ -59,7 +59,7 @@ static struct toktab {
{ "account", ACCOUNT }, { "account", ACCOUNT },
{ "machine", MACH }, { "machine", MACH },
{ "macdef", MACDEF }, { "macdef", MACDEF },
{ "prot", PROT }, { "prot", PROT },
{ NULL, 0 } { NULL, 0 }
}; };
@@ -137,7 +137,7 @@ next:
continue; continue;
/* /*
* Allow match either for user's input host name * Allow match either for user's input host name
* or official hostname. Also allow match of * or official hostname. Also allow match of
* incompletely-specified host in local domain. * incompletely-specified host in local domain.
*/ */
if (strcasecmp(host, tokval) == 0) if (strcasecmp(host, tokval) == 0)
@@ -163,7 +163,7 @@ next:
case LOGIN: case LOGIN:
if (token()) { if (token()) {
if (*aname == 0) { if (*aname == 0) {
*aname = strdup(tokval); *aname = strdup(tokval);
} else { } else {
if (strcmp(*aname, tokval)) if (strcmp(*aname, tokval))
@@ -199,7 +199,7 @@ next:
fclose(cfile); fclose(cfile);
return (0); return (0);
} }
while ((c=getc(cfile)) != EOF && while ((c=getc(cfile)) != EOF &&
(c == ' ' || c == '\t')); (c == ' ' || c == '\t'));
if (c == EOF || c == '\n') { if (c == EOF || c == '\n') {
printf("Missing macdef name argument.\n"); printf("Missing macdef name argument.\n");

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1998-2002, 2005 Kungliga Tekniska Högskolan * Copyright (c) 1998-2002, 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
@@ -74,7 +74,7 @@ level_to_name(enum protection_level level)
} }
#ifndef FTP_SERVER /* not used in server */ #ifndef FTP_SERVER /* not used in server */
static enum protection_level static enum protection_level
name_to_level(const char *name) name_to_level(const char *name)
{ {
int i; int i;
@@ -229,12 +229,12 @@ sec_read(int fd, void *dataptr, int length)
in_buffer.eof_flag = 0; in_buffer.eof_flag = 0;
return 0; return 0;
} }
len = buffer_read(&in_buffer, dataptr, length); len = buffer_read(&in_buffer, dataptr, length);
length -= len; length -= len;
rx += len; rx += len;
dataptr = (char*)dataptr + len; dataptr = (char*)dataptr + len;
while(length){ while(length){
int ret; int ret;
@@ -286,7 +286,7 @@ sec_write(int fd, char *dataptr, int length)
{ {
int len = buffer_size; int len = buffer_size;
int tx = 0; int tx = 0;
if(data_prot == prot_clear) if(data_prot == prot_clear)
return write(fd, dataptr, length); return write(fd, dataptr, length);
@@ -337,7 +337,7 @@ sec_putc(int c, FILE *F)
char ch = c; char ch = c;
if(data_prot == prot_clear) if(data_prot == prot_clear)
return putc(c, F); return putc(c, F);
buffer_write(&out_buffer, &ch, 1); buffer_write(&out_buffer, &ch, 1);
if(c == '\n' || out_buffer.index >= 1024 /* XXX */) { if(c == '\n' || out_buffer.index >= 1024 /* XXX */) {
sec_write(fileno(F), out_buffer.data, out_buffer.index); sec_write(fileno(F), out_buffer.data, out_buffer.index);
@@ -352,14 +352,14 @@ sec_read_msg(char *s, int level)
int len; int len;
char *buf; char *buf;
int return_code; int return_code;
buf = malloc(strlen(s)); buf = malloc(strlen(s));
len = base64_decode(s + 4, buf); /* XXX */ len = base64_decode(s + 4, buf); /* XXX */
len = (*mech->decode)(app_data, buf, len, level); len = (*mech->decode)(app_data, buf, len, level);
if(len < 0) if(len < 0)
return -1; return -1;
buf[len] = '\0'; buf[len] = '\0';
if(buf[3] == '-') if(buf[3] == '-')
@@ -381,7 +381,7 @@ sec_vfprintf(FILE *f, const char *fmt, va_list ap)
int len; int len;
if(!sec_complete) if(!sec_complete)
return vfprintf(f, fmt, ap); return vfprintf(f, fmt, ap);
if (vasprintf(&buf, fmt, ap) == -1) { if (vasprintf(&buf, fmt, ap) == -1) {
printf("Failed to allocate command.\n"); printf("Failed to allocate command.\n");
return -1; return -1;
@@ -520,10 +520,10 @@ prot(char *pl)
reply(504, "Unrecognized protection level."); reply(504, "Unrecognized protection level.");
return; return;
} }
if(sec_complete){ if(sec_complete){
if((*mech->check_prot)(app_data, p)){ if((*mech->check_prot)(app_data, p)){
reply(536, "%s does not support %s protection.", reply(536, "%s does not support %s protection.",
mech->name, level_to_name(p)); mech->name, level_to_name(p));
}else{ }else{
data_prot = (enum protection_level)p; data_prot = (enum protection_level)p;
@@ -628,7 +628,7 @@ sec_status(void)
printf("Using %s command channel.\n", level_to_name(command_prot)); printf("Using %s command channel.\n", level_to_name(command_prot));
printf("Using %s data channel.\n", level_to_name(data_prot)); printf("Using %s data channel.\n", level_to_name(data_prot));
if(buffer_size > 0) if(buffer_size > 0)
printf("Protection buffer size: %lu.\n", printf("Protection buffer size: %lu.\n",
(unsigned long)buffer_size); (unsigned long)buffer_size);
}else{ }else{
printf("Not using any security mechanism.\n"); printf("Not using any security mechanism.\n");
@@ -669,7 +669,7 @@ sec_prot_internal(int level)
printf("Failed to set protection level.\n"); printf("Failed to set protection level.\n");
return -1; return -1;
} }
data_prot = (enum protection_level)level; data_prot = (enum protection_level)level;
return 0; return 0;
} }
@@ -708,17 +708,17 @@ sec_prot(int argc, char **argv)
return; return;
} }
level = name_to_level(argv[argc - 1]); level = name_to_level(argv[argc - 1]);
if(level == -1) if(level == -1)
goto usage; goto usage;
if((*mech->check_prot)(app_data, level)) { if((*mech->check_prot)(app_data, level)) {
printf("%s does not implement %s protection.\n", printf("%s does not implement %s protection.\n",
mech->name, level_to_name(level)); mech->name, level_to_name(level));
code = -1; code = -1;
return; return;
} }
if(argc == 2 || strncasecmp(argv[1], "data", strlen(argv[1])) == 0) { if(argc == 2 || strncasecmp(argv[1], "data", strlen(argv[1])) == 0) {
if(sec_prot_internal(level) < 0){ if(sec_prot_internal(level) < 0){
code = -1; code = -1;
@@ -759,9 +759,9 @@ sec_prot_command(int argc, char **argv)
level = name_to_level(argv[1]); level = name_to_level(argv[1]);
if(level == -1) if(level == -1)
goto usage; goto usage;
if((*mech->check_prot)(app_data, level)) { if((*mech->check_prot)(app_data, level)) {
printf("%s does not implement %s protection.\n", printf("%s does not implement %s protection.\n",
mech->name, level_to_name(level)); mech->name, level_to_name(level));
code = -1; code = -1;
return; return;
@@ -808,7 +808,7 @@ sec_login(char *host)
verbose = -1; /* shut up all messages this will produce (they verbose = -1; /* shut up all messages this will produce (they
are usually not very user friendly) */ are usually not very user friendly) */
for(m = mechs; *m && (*m)->name; m++) { for(m = mechs; *m && (*m)->name; m++) {
void *tmp; void *tmp;
@@ -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;
@@ -852,13 +852,13 @@ sec_login(char *host)
sec_complete = 1; sec_complete = 1;
if(doencrypt) { if(doencrypt) {
command_prot = prot_private; command_prot = prot_private;
request_data_prot = prot_private; request_data_prot = prot_private;
} else { } else {
command_prot = prot_safe; command_prot = prot_safe;
} }
break; break;
} }
verbose = old_verbose; verbose = old_verbose;
return *m == NULL; return *m == NULL;
} }

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 1998 - 2005 Kungliga Tekniska Högskolan * Copyright (c) 1998 - 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$ */
@@ -36,11 +36,11 @@
#ifndef __security_h__ #ifndef __security_h__
#define __security_h__ #define __security_h__
enum protection_level { enum protection_level {
prot_clear, prot_clear,
prot_safe, prot_safe,
prot_confidential, prot_confidential,
prot_private prot_private
}; };
struct sec_client_mech { struct sec_client_mech {
@@ -137,4 +137,4 @@ enum protection_level set_command_prot(enum protection_level);
#endif #endif
#endif /* __security_h__ */ #endif /* __security_h__ */

View File

@@ -754,7 +754,7 @@ host_port
sin4->sin_family = AF_INET; sin4->sin_family = AF_INET;
sin4->sin_port = htons($9 * 256 + $11); sin4->sin_port = htons($9 * 256 + $11);
sin4->sin_addr.s_addr = sin4->sin_addr.s_addr =
htonl(($1 << 24) | ($3 << 16) | ($5 << 8) | $7); htonl(($1 << 24) | ($3 << 16) | ($5 << 8) | $7);
} }
; ;

View File

@@ -190,7 +190,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;
} }
/* /*
@@ -225,7 +225,7 @@ struct getargs args[] = {
{ "builtin-ls", 'B', arg_flag, &use_builtin_ls, "use built-in ls to list files" }, { "builtin-ls", 'B', arg_flag, &use_builtin_ls, "use built-in ls to list files" },
{ "good-chars", 0, arg_string, &good_chars, "allowed anonymous upload filename chars" }, { "good-chars", 0, arg_string, &good_chars, "allowed anonymous upload filename chars" },
{ "insecure-oob", 'I', arg_negative_flag, &allow_insecure_oob, "don't allow insecure OOB ABOR/STAT" }, { "insecure-oob", 'I', arg_negative_flag, &allow_insecure_oob, "don't allow insecure OOB ABOR/STAT" },
#ifdef KRB5 #ifdef KRB5
{ "gss-bindings", 0, arg_flag, &ftp_do_gss_bindings, "Require GSS-API bindings", NULL}, { "gss-bindings", 0, arg_flag, &ftp_do_gss_bindings, "Require GSS-API bindings", NULL},
#endif #endif
{ "version", 0, arg_flag, &version_flag }, { "version", 0, arg_flag, &version_flag },
@@ -297,7 +297,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)
@@ -328,7 +328,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;
@@ -528,7 +528,7 @@ user(char *name)
guest = 0; guest = 0;
if (strcmp(name, "ftp") == 0 || strcmp(name, "anonymous") == 0) { if (strcmp(name, "ftp") == 0 || strcmp(name, "anonymous") == 0) {
if ((auth_level & AUTH_FTP) == 0 || if ((auth_level & AUTH_FTP) == 0 ||
checkaccess("ftp") || checkaccess("ftp") ||
checkaccess("anonymous")) checkaccess("anonymous"))
reply(530, "User %s access denied.", name); reply(530, "User %s access denied.", name);
else if ((pw = sgetpwnam("ftp")) != NULL) { else if ((pw = sgetpwnam("ftp")) != NULL) {
@@ -661,7 +661,7 @@ checkuser(char *fname, char *name)
/* /*
* Determine whether a user has access, based on information in * Determine whether a user has access, based on information in
* _PATH_FTPUSERS. The users are listed one per line, with `allow' * _PATH_FTPUSERS. The users are listed one per line, with `allow'
* or `deny' after the username. If anything other than `allow', or * or `deny' after the username. If anything other than `allow', or
* just nothing, is given after the username, `deny' is assumed. * just nothing, is given after the username, `deny' is assumed.
@@ -689,9 +689,9 @@ checkaccess(char *name)
int allowed = ALLOWED; int allowed = ALLOWED;
char *user, *perm, line[BUFSIZ]; char *user, *perm, line[BUFSIZ];
char *foo; char *foo;
fd = fopen(_PATH_FTPUSERS, "r"); fd = fopen(_PATH_FTPUSERS, "r");
if(fd == NULL) if(fd == NULL)
return allowed; return allowed;
@@ -799,7 +799,7 @@ int do_login(int code, char *passwd)
sizeof(data_addr)); sizeof(data_addr));
syslog(LOG_INFO, "ANONYMOUS FTP LOGIN FROM %s(%s), %s", syslog(LOG_INFO, "ANONYMOUS FTP LOGIN FROM %s(%s), %s",
remotehost, remotehost,
data_addr, data_addr,
passwd); passwd);
} }
@@ -850,11 +850,11 @@ end_login(void)
static int static int
krb5_verify(struct passwd *pwd, char *passwd) krb5_verify(struct passwd *pwd, char *passwd)
{ {
krb5_context context; krb5_context context;
krb5_ccache id; krb5_ccache id;
krb5_principal princ; krb5_principal princ;
krb5_error_code ret; krb5_error_code ret;
ret = krb5_init_context(&context); ret = krb5_init_context(&context);
if(ret) if(ret)
return ret; return ret;
@@ -882,7 +882,7 @@ krb5_verify(struct passwd *pwd, char *passwd)
} }
krb5_cc_destroy(context, id); krb5_cc_destroy(context, id);
krb5_free_context (context); krb5_free_context (context);
if(ret) if(ret)
return ret; return ret;
return 0; return 0;
} }
@@ -922,8 +922,8 @@ pass(char *passwd)
char realm[REALM_SZ]; char realm[REALM_SZ];
if((rval = krb_get_lrealm(realm, 1)) == KSUCCESS) if((rval = krb_get_lrealm(realm, 1)) == KSUCCESS)
rval = krb_verify_user(pw->pw_name, rval = krb_verify_user(pw->pw_name,
"", realm, "", realm,
passwd, passwd,
KRB_VERIFY_SECURE, NULL); KRB_VERIFY_SECURE, NULL);
if (rval == KSUCCESS ) { if (rval == KSUCCESS ) {
chown (tkt_string(), pw->pw_uid, pw->pw_gid); chown (tkt_string(), pw->pw_uid, pw->pw_gid);
@@ -1106,7 +1106,7 @@ done:
/* filename sanity check */ /* filename sanity check */
int int
filename_check(char *filename) filename_check(char *filename)
{ {
char *p; char *p;
@@ -1127,7 +1127,7 @@ filename_check(char *filename)
lreply(553, "\"%s\" is not an acceptable filename.", filename); lreply(553, "\"%s\" is not an acceptable filename.", filename);
lreply(553, "The filename must start with an alphanumeric " lreply(553, "The filename must start with an alphanumeric "
"character and must only"); "character and must only");
reply(553, "consist of alphanumeric characters or any of the following: %s", reply(553, "consist of alphanumeric characters or any of the following: %s",
good_chars); good_chars);
return 1; return 1;
} }
@@ -1252,7 +1252,7 @@ bad:
} }
static int static int
accept_with_timeout(int socket, accept_with_timeout(int socket,
struct sockaddr *address, struct sockaddr *address,
socklen_t *address_len, socklen_t *address_len,
struct timeval *timeout) struct timeval *timeout)
@@ -1305,7 +1305,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));
} }
@@ -1323,7 +1323,7 @@ dataconn(const char *name, off_t size, const char *mode)
if (usedefault) if (usedefault)
data_dest = his_addr; data_dest = his_addr;
usedefault = 1; usedefault = 1;
/* /*
* Default to using the same socket type as the ctrl address, * Default to using the same socket type as the ctrl address,
* unless we know the type of the data address. * unless we know the type of the data address.
*/ */
@@ -1411,7 +1411,7 @@ send_data(FILE *instr, FILE *outstr)
struct stat st; struct stat st;
char *chunk; char *chunk;
int in = fileno(instr); int in = fileno(instr);
if(fstat(in, &st) == 0 && S_ISREG(st.st_mode) if(fstat(in, &st) == 0 && S_ISREG(st.st_mode)
&& st.st_size > 0) { && st.st_size > 0) {
/* /*
* mmap zero bytes has potential of loosing, don't do it. * mmap zero bytes has potential of loosing, don't do it.
@@ -1505,7 +1505,7 @@ receive_data(FILE *instr, FILE *outstr)
perror_reply(451, "Local resource failure: malloc"); perror_reply(451, "Local resource failure: malloc");
return -1; return -1;
} }
switch (type) { switch (type) {
case TYPE_I: case TYPE_I:
@@ -1534,7 +1534,7 @@ receive_data(FILE *instr, FILE *outstr)
char *p, *q; char *p, *q;
int cr_flag = 0; int cr_flag = 0;
while ((cnt = sec_read(fileno(instr), while ((cnt = sec_read(fileno(instr),
buf + cr_flag, buf + cr_flag,
bufsize - cr_flag)) > 0){ bufsize - cr_flag)) > 0){
if (urgflag && handleoobcmd()) if (urgflag && handleoobcmd())
return (-1); return (-1);
@@ -1831,7 +1831,7 @@ pwd(void)
char *ret; char *ret;
/* SunOS has a broken getcwd that does popen(pwd) (!!!), this /* SunOS has a broken getcwd that does popen(pwd) (!!!), this
* failes miserably when running chroot * failes miserably when running chroot
*/ */
ret = getcwd(path, sizeof(path)); ret = getcwd(path, sizeof(path));
if (ret == NULL) if (ret == NULL)
@@ -2017,8 +2017,8 @@ pasv(void)
socket_set_address_and_port (pasv_addr, socket_set_address_and_port (pasv_addr,
socket_get_address (ctrl_addr), socket_get_address (ctrl_addr),
0); 0);
socket_set_portrange(pdata, restricted_data_ports, socket_set_portrange(pdata, restricted_data_ports,
pasv_addr->sa_family); pasv_addr->sa_family);
if (seteuid(0) < 0) if (seteuid(0) < 0)
fatal("Failed to seteuid"); fatal("Failed to seteuid");
if (bind(pdata, pasv_addr, socket_sockaddr_size (pasv_addr)) < 0) { if (bind(pdata, pasv_addr, socket_sockaddr_size (pasv_addr)) < 0) {
@@ -2064,8 +2064,8 @@ epsv(char *proto)
socket_set_address_and_port (pasv_addr, socket_set_address_and_port (pasv_addr,
socket_get_address (ctrl_addr), socket_get_address (ctrl_addr),
0); 0);
socket_set_portrange(pdata, restricted_data_ports, socket_set_portrange(pdata, restricted_data_ports,
pasv_addr->sa_family); pasv_addr->sa_family);
if (seteuid(0) < 0) if (seteuid(0) < 0)
fatal("Failed to seteuid"); fatal("Failed to seteuid");
if (bind(pdata, pasv_addr, socket_sockaddr_size (pasv_addr)) < 0) { if (bind(pdata, pasv_addr, socket_sockaddr_size (pasv_addr)) < 0) {
@@ -2353,7 +2353,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

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan * Copyright (c) 1998 - 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 * 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$ */
@@ -152,7 +152,7 @@
#if defined(KRB4) || defined(KRB5) #if defined(KRB4) || defined(KRB5)
#include <kafs.h> #include <kafs.h>
#endif #endif
#ifdef OTP #ifdef OTP
#include <otp.h> #include <otp.h>
#endif #endif

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 1998 - 2001 Kungliga Tekniska Högskolan * Copyright (c) 1998 - 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 * 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.
*/ */
#include "ftpd_locl.h" #include "ftpd_locl.h"
@@ -37,8 +37,8 @@
RCSID("$Id$"); RCSID("$Id$");
/* XXX a bit too much of krb5 dependency here... /* XXX a bit too much of krb5 dependency here...
What is the correct way to do this? What is the correct way to do this?
*/ */
struct gss_krb5_data { struct gss_krb5_data {
@@ -88,7 +88,7 @@ gss_userok(void *app_data, char *username)
free(kdata); free(kdata);
return 1; return 1;
} }
ret = 0; ret = 0;
krb5_free_principal(kdata->context, client); krb5_free_principal(kdata->context, client);
return ret; return ret;
@@ -105,20 +105,20 @@ gss_session(void *app_data, char *username)
ret = 0; ret = 0;
kdata = (struct gss_krb5_data *)(data->mech_data); kdata = (struct gss_krb5_data *)(data->mech_data);
/* more of krb-depend stuff :-( */ /* more of krb-depend stuff :-( */
/* gss_add_cred() ? */ /* gss_add_cred() ? */
if (data->delegated_cred_handle != GSS_C_NO_CREDENTIAL) { if (data->delegated_cred_handle != GSS_C_NO_CREDENTIAL) {
krb5_ccache ccache = NULL; krb5_ccache ccache = NULL;
const char* ticketfile; const char* ticketfile;
struct passwd *kpw; struct passwd *kpw;
ret = krb5_cc_gen_new(kdata->context, &krb5_fcc_ops, &ccache); ret = krb5_cc_gen_new(kdata->context, &krb5_fcc_ops, &ccache);
if (ret) if (ret)
goto fail; goto fail;
ticketfile = krb5_cc_get_name(kdata->context, ccache); ticketfile = krb5_cc_get_name(kdata->context, ccache);
ret = gss_krb5_copy_ccache(&minor_status, ret = gss_krb5_copy_ccache(&minor_status,
data->delegated_cred_handle, data->delegated_cred_handle,
ccache); ccache);
@@ -126,11 +126,11 @@ gss_session(void *app_data, char *username)
ret = 0; ret = 0;
goto fail; goto fail;
} }
do_destroy_tickets = 1; do_destroy_tickets = 1;
kpw = getpwnam(username); kpw = getpwnam(username);
if (kpw == NULL) { if (kpw == NULL) {
unlink(ticketfile); unlink(ticketfile);
ret = 1; ret = 1;
@@ -138,16 +138,16 @@ gss_session(void *app_data, char *username)
} }
chown (ticketfile, kpw->pw_uid, kpw->pw_gid); chown (ticketfile, kpw->pw_uid, kpw->pw_gid);
if (asprintf(&k5ccname, "FILE:%s", ticketfile) != -1) { if (asprintf(&k5ccname, "FILE:%s", ticketfile) != -1) {
esetenv ("KRB5CCNAME", k5ccname, 1); esetenv ("KRB5CCNAME", k5ccname, 1);
} }
afslog(NULL, 1); afslog(NULL, 1);
fail: fail:
if (ccache) if (ccache)
krb5_cc_close(kdata->context, ccache); krb5_cc_close(kdata->context, ccache);
} }
gss_release_cred(&minor_status, &data->delegated_cred_handle); gss_release_cred(&minor_status, &data->delegated_cred_handle);
krb5_free_context(kdata->context); krb5_free_context(kdata->context);
free(kdata); free(kdata);

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995 - 1999, 2003 Kungliga Tekniska Högskolan * Copyright (c) 1995 - 1999, 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 * 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
@@ -54,7 +54,7 @@ static int
save_tkt(const char *user, save_tkt(const char *user,
const char *instance, const char *instance,
const char *realm, const char *realm,
const void *arg, const void *arg,
key_proc_t key_proc, key_proc_t key_proc,
KTEXT *cipp) KTEXT *cipp)
{ {
@@ -74,7 +74,7 @@ store_ticket(KTEXT cip)
int left = cip->length; int left = cip->length;
int len; int len;
int kerror; int kerror;
ptr = (char *) cip->dat; ptr = (char *) cip->dat;
/* extract session key */ /* extract session key */
@@ -85,7 +85,7 @@ store_ticket(KTEXT cip)
len = strnlen(ptr, left); len = strnlen(ptr, left);
if (len == left) if (len == left)
return(INTK_BADPW); return(INTK_BADPW);
/* extract server's name */ /* extract server's name */
strlcpy(sp.name, ptr, sizeof(sp.name)); strlcpy(sp.name, ptr, sizeof(sp.name));
ptr += len + 1; ptr += len + 1;
@@ -94,7 +94,7 @@ store_ticket(KTEXT cip)
len = strnlen(ptr, left); len = strnlen(ptr, left);
if (len == left) if (len == left)
return(INTK_BADPW); return(INTK_BADPW);
/* extract server's instance */ /* extract server's instance */
strlcpy(sp.instance, ptr, sizeof(sp.instance)); strlcpy(sp.instance, ptr, sizeof(sp.instance));
ptr += len + 1; ptr += len + 1;
@@ -103,7 +103,7 @@ store_ticket(KTEXT cip)
len = strnlen(ptr, left); len = strnlen(ptr, left);
if (len == left) if (len == left)
return(INTK_BADPW); return(INTK_BADPW);
/* extract server's realm */ /* extract server's realm */
strlcpy(sp.realm, ptr, sizeof(sp.realm)); strlcpy(sp.realm, ptr, sizeof(sp.realm));
ptr += len + 1; ptr += len + 1;
@@ -118,7 +118,7 @@ store_ticket(KTEXT cip)
tkt.length = (unsigned char) ptr[2]; tkt.length = (unsigned char) ptr[2];
ptr += 3; ptr += 3;
left -= 3; left -= 3;
if (tkt.length > left) if (tkt.length > left)
return(INTK_BADPW); return(INTK_BADPW);
@@ -135,7 +135,7 @@ store_ticket(KTEXT cip)
* happen is that we might receive a replayed ticket, which could * happen is that we might receive a replayed ticket, which could
* at most be useless. * at most be useless.
*/ */
#if 0 #if 0
/* check KDC time stamp */ /* check KDC time stamp */
{ {
@@ -145,7 +145,7 @@ store_ticket(KTEXT cip)
if (swap_bytes) swap_u_long(kdc_time); if (swap_bytes) swap_u_long(kdc_time);
ptr += 4; ptr += 4;
if (abs((int)(local_time - kdc_time)) > CLOCK_SKEW) { if (abs((int)(local_time - kdc_time)) > CLOCK_SKEW) {
return(RD_AP_TIME); /* XXX should probably be better return(RD_AP_TIME); /* XXX should probably be better
code */ code */
@@ -164,8 +164,8 @@ store_ticket(KTEXT cip)
return(INTK_ERR); return(INTK_ERR);
} }
kerror = tf_save_cred(sp.name, sp.instance, sp.realm, session, kerror = tf_save_cred(sp.name, sp.instance, sp.realm, session,
lifetime, kvno, &tkt, local_time); lifetime, kvno, &tkt, local_time);
tf_close(); tf_close();
@@ -177,7 +177,7 @@ kauth(char *principal, char *ticket)
{ {
char *p; char *p;
int ret; int ret;
if(get_command_prot() != prot_private) { if(get_command_prot() != prot_private) {
reply(500, "Request denied (bad protection level)"); reply(500, "Request denied (bad protection level)");
return; return;
@@ -209,7 +209,7 @@ kauth(char *principal, char *ticket)
reply(200, "Tickets will be destroyed on exit."); reply(200, "Tickets will be destroyed on exit.");
return; return;
} }
ret = krb_get_in_tkt (pr.name, ret = krb_get_in_tkt (pr.name,
pr.instance, pr.instance,
pr.realm, pr.realm,
@@ -261,7 +261,7 @@ dest_cc(void)
krb5_context context; krb5_context context;
krb5_error_code ret; krb5_error_code ret;
krb5_ccache id; krb5_ccache id;
ret = krb5_init_context(&context); ret = krb5_init_context(&context);
if (ret == 0) { if (ret == 0) {
if (k5ccname) if (k5ccname)

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995 - 2005 Kungliga Tekniska Högskolan * Copyright (c) 1995 - 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
@@ -48,7 +48,7 @@ print_cred(krb5_context context, krb5_creds *cred)
krb5_format_time(context, cred->times.starttime, t1, sizeof(t1), 1); krb5_format_time(context, cred->times.starttime, t1, sizeof(t1), 1);
else else
krb5_format_time(context, cred->times.authtime, t1, sizeof(t1), 1); krb5_format_time(context, cred->times.authtime, t1, sizeof(t1), 1);
if(cred->times.endtime > sec) if(cred->times.endtime > sec)
krb5_format_time(context, cred->times.endtime, t2, sizeof(t2), 1); krb5_format_time(context, cred->times.endtime, t2, sizeof(t2), 1);
else else
@@ -81,7 +81,7 @@ print_tickets (krb5_context context,
return 500; return 500;
} }
lreply(200, "%17s: %s:%s", lreply(200, "%17s: %s:%s",
"Credentials cache", "Credentials cache",
krb5_cc_get_type(context, ccache), krb5_cc_get_type(context, ccache),
krb5_cc_get_name(context, ccache)); krb5_cc_get_name(context, ccache));
@@ -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

@@ -2,22 +2,22 @@
* Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan * Copyright (c) 1995 - 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 * 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
@@ -178,5 +178,5 @@ ftpd_logwtmp(char *line, char *name, char *host)
ftpd_logwtmp_asl(line, name, host); ftpd_logwtmp_asl(line, name, host);
#else #else
ftpd_logwtmp_wtmp(line, name, host); ftpd_logwtmp_wtmp(line, name, host);
#endif #endif
} }

View File

@@ -1,18 +1,18 @@
/* /*
* Copyright (c) 1999 - 2002 Kungliga Tekniska Högskolan * Copyright (c) 1999 - 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 KTH nor the names of its contributors may be * 3. Neither the name of KTH nor the names of its contributors may be
* used to endorse or promote products derived from this software without * used to endorse or promote products derived from this software without
@@ -152,10 +152,10 @@ make_fileinfo(FILE *out, const char *filename, struct fileinfo *file, int flags)
char buf[128]; char buf[128];
int file_type = 0; int file_type = 0;
struct stat *st = &file->st; struct stat *st = &file->st;
file->inode = st->st_ino; file->inode = st->st_ino;
file->bsize = block_convert(st->st_blocks); file->bsize = block_convert(st->st_blocks);
if(S_ISDIR(st->st_mode)) { if(S_ISDIR(st->st_mode)) {
file->mode[0] = 'd'; file->mode[0] = 'd';
file_type = '/'; file_type = '/';
@@ -187,10 +187,10 @@ make_fileinfo(FILE *out, const char *filename, struct fileinfo *file, int flags)
file_type = '%'; file_type = '%';
} }
#endif #endif
else else
file->mode[0] = '?'; file->mode[0] = '?';
{ {
char *x[] = { "---", "--x", "-w-", "-wx", char *x[] = { "---", "--x", "-w-", "-wx",
"r--", "r-x", "rw-", "rwx" }; "r--", "r-x", "rw-", "rwx" };
strcpy(file->mode + 1, x[(st->st_mode & S_IRWXU) >> 6]); strcpy(file->mode + 1, x[(st->st_mode & S_IRWXU) >> 6]);
strcpy(file->mode + 4, x[(st->st_mode & S_IRWXG) >> 3]); strcpy(file->mode + 4, x[(st->st_mode & S_IRWXG) >> 3]);
@@ -241,7 +241,7 @@ make_fileinfo(FILE *out, const char *filename, struct fileinfo *file, int flags)
return -1; return -1;
} }
} }
if(S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)) { if(S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)) {
#if defined(major) && defined(minor) #if defined(major) && defined(minor)
if (asprintf(&file->major, "%u", (unsigned)major(st->st_rdev)) == -1) if (asprintf(&file->major, "%u", (unsigned)major(st->st_rdev)) == -1)
@@ -414,7 +414,7 @@ lstat_file (const char *file, struct stat *sb)
{ {
#ifdef KRB4 #ifdef KRB4
if (do_the_afs_dance && if (do_the_afs_dance &&
k_hasafs() k_hasafs()
&& strcmp(file, ".") && strcmp(file, ".")
&& strcmp(file, "..") && strcmp(file, "..")
&& strcmp(file, "/")) && strcmp(file, "/"))
@@ -431,7 +431,7 @@ lstat_file (const char *file, struct stat *sb)
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;
} }
@@ -473,7 +473,7 @@ lstat_file (const char *file, struct stat *sb)
return lstat (file, sb); return lstat (file, sb);
} }
/* /*
* wow this was a mountpoint, lets cook the struct stat * wow this was a mountpoint, lets cook the struct stat
* use . as a prototype * use . as a prototype
*/ */
@@ -551,15 +551,15 @@ list_files(FILE *out, const char **files, int n_files, int flags)
} }
switch(SORT_MODE(flags)) { switch(SORT_MODE(flags)) {
case LS_SORT_NAME: case LS_SORT_NAME:
qsort(fi, n_files, sizeof(*fi), qsort(fi, n_files, sizeof(*fi),
(int (*)(const void*, const void*))compare_filename); (int (*)(const void*, const void*))compare_filename);
break; break;
case LS_SORT_MTIME: case LS_SORT_MTIME:
qsort(fi, n_files, sizeof(*fi), qsort(fi, n_files, sizeof(*fi),
(int (*)(const void*, const void*))compare_mtime); (int (*)(const void*, const void*))compare_mtime);
break; break;
case LS_SORT_SIZE: case LS_SORT_SIZE:
qsort(fi, n_files, sizeof(*fi), qsort(fi, n_files, sizeof(*fi),
(int (*)(const void*, const void*))compare_size); (int (*)(const void*, const void*))compare_size);
break; break;
} }
@@ -633,7 +633,7 @@ list_files(FILE *out, const char **files, int n_files, int flags)
max_major, max_major,
max_minor, max_minor,
max_date); max_date);
} else if(DISP_MODE(flags) == LS_DISP_COLUMN || } else if(DISP_MODE(flags) == LS_DISP_COLUMN ||
DISP_MODE(flags) == LS_DISP_CROSS) { DISP_MODE(flags) == LS_DISP_CROSS) {
int max_len = 0; int max_len = 0;
int size_len = 0; int size_len = 0;
@@ -660,14 +660,14 @@ list_files(FILE *out, const char **files, int n_files, int flags)
max_len = 80 / columns; max_len = 80 / columns;
} }
if(flags & LS_SIZE) if(flags & LS_SIZE)
sec_fprintf2(out, "total %lu\r\n", sec_fprintf2(out, "total %lu\r\n",
(unsigned long)total_blocks); (unsigned long)total_blocks);
if(DISP_MODE(flags) == LS_DISP_CROSS) { if(DISP_MODE(flags) == LS_DISP_CROSS) {
for(i = 0, j = 0; i < n_files; i++) { for(i = 0, j = 0; i < n_files; i++) {
if(fi[i].filename == NULL) if(fi[i].filename == NULL)
continue; continue;
if(flags & LS_SIZE) if(flags & LS_SIZE)
sec_fprintf2(out, "%*u %-*s", size_len, fi[i].bsize, sec_fprintf2(out, "%*u %-*s", size_len, fi[i].bsize,
max_len, fi[i].filename); max_len, fi[i].filename);
else else
sec_fprintf2(out, "%-*s", max_len, fi[i].filename); sec_fprintf2(out, "%-*s", max_len, fi[i].filename);
@@ -687,7 +687,7 @@ list_files(FILE *out, const char **files, int n_files, int flags)
while(j < n_files && fi[j].filename == NULL) while(j < n_files && fi[j].filename == NULL)
j++; j++;
if(flags & LS_SIZE) if(flags & LS_SIZE)
sec_fprintf2(out, "%*u %-*s", size_len, fi[j].bsize, sec_fprintf2(out, "%*u %-*s", size_len, fi[j].bsize,
max_len, fi[j].filename); max_len, fi[j].filename);
else else
sec_fprintf2(out, "%-*s", max_len, fi[j].filename); sec_fprintf2(out, "%-*s", max_len, fi[j].filename);
@@ -710,7 +710,7 @@ list_files(FILE *out, const char **files, int n_files, int flags)
const char *p = strrchr(files[i], '/'); const char *p = strrchr(files[i], '/');
if(p == NULL) if(p == NULL)
p = files[i]; p = files[i];
else else
p++; p++;
if(!(flags & LS_DIR_FLAG) || !IS_DOT_DOTDOT(p)) { if(!(flags & LS_DIR_FLAG) || !IS_DOT_DOTDOT(p)) {
if((flags & LS_SHOW_DIRNAME)) { if((flags & LS_SHOW_DIRNAME)) {

View File

@@ -65,7 +65,7 @@ RCSID("$Id$");
#include "extern.h" #include "extern.h"
/* /*
* Special version of popen which avoids call to shell. This ensures * Special version of popen which avoids call to shell. This ensures
* no one may create a pipe to a hidden program as a side effect of a * no one may create a pipe to a hidden program as a side effect of a
* list or dir command. * list or dir command.
@@ -148,8 +148,8 @@ ftpd_popen(char *program, char *type, int do_stderr, int no_glob)
; ;
memset(&gl, 0, sizeof(gl)); memset(&gl, 0, sizeof(gl));
if (no_glob || if (no_glob ||
glob(argv[argc], flags, NULL, &gl) || glob(argv[argc], flags, NULL, &gl) ||
gl.gl_pathc == 0) gl.gl_pathc == 0)
gargv[gargc++] = strdup(argv[argc]); gargv[gargc++] = strdup(argv[argc]);
else else

View File

@@ -1,18 +1,18 @@
/* /*
* Copyright (c) 2006 Kungliga Tekniska Högskolan * Copyright (c) 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 KTH nor the names of its contributors may be * 3. Neither the name of KTH nor the names of its contributors may be
* used to endorse or promote products derived from this software without * used to endorse or promote products derived from this software without
@@ -62,8 +62,8 @@ add_list(char ****list, size_t *listlen, char **str, size_t len)
} }
static void static void
permute(char ****list, size_t *listlen, permute(char ****list, size_t *listlen,
char **str, const int start, const int len) char **str, const int start, const int len)
{ {
int i, j; int i, j;

View File

@@ -1,18 +1,18 @@
/* /*
* Copyright (c) 2006 Kungliga Tekniska Högskolan * Copyright (c) 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 KTH nor the names of its contributors may be * 3. Neither the name of KTH nor the names of its contributors may be
* used to endorse or promote products derived from this software without * used to endorse or promote products derived from this software without
@@ -37,7 +37,7 @@
#include <config.h> #include <config.h>
#endif #endif
/* /*
* pthread support is disable because the pthread * pthread support is disable because the pthread
* test have no "application pthread libflags" variable, * test have no "application pthread libflags" variable,
* when this is fixed pthread support can be enabled again. * when this is fixed pthread support can be enabled again.

View File

@@ -1,18 +1,18 @@
/* /*
* Copyright (c) 2006 Kungliga Tekniska Högskolan * Copyright (c) 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 KTH nor the names of its contributors may be * 3. Neither the name of KTH nor the names of its contributors may be
* used to endorse or promote products derived from this software without * used to endorse or promote products derived from this software without
@@ -61,9 +61,9 @@ static struct client **clients;
static int num_clients; static int num_clients;
static int static int
init_sec_context(struct client *client, init_sec_context(struct client *client,
int32_t *hContext, int32_t *hCred, int32_t *hContext, int32_t *hCred,
int32_t flags, int32_t flags,
const char *targetname, const char *targetname,
const krb5_data *itoken, krb5_data *otoken) const krb5_data *itoken, krb5_data *otoken)
{ {
@@ -82,7 +82,7 @@ init_sec_context(struct client *client,
} }
static int static int
accept_sec_context(struct client *client, accept_sec_context(struct client *client,
int32_t *hContext, int32_t *hContext,
int32_t flags, int32_t flags,
const krb5_data *itoken, const krb5_data *itoken,
@@ -103,7 +103,7 @@ accept_sec_context(struct client *client,
} }
static int static int
acquire_cred(struct client *client, acquire_cred(struct client *client,
const char *username, const char *username,
const char *password, const char *password,
int32_t flags, int32_t flags,
@@ -120,7 +120,7 @@ acquire_cred(struct client *client,
} }
static int static int
toast_resource(struct client *client, toast_resource(struct client *client,
int32_t hCred) int32_t hCred)
{ {
int32_t val; int32_t val;
@@ -138,7 +138,7 @@ goodbye(struct client *client)
} }
static int static int
get_targetname(struct client *client, get_targetname(struct client *client,
char **target) char **target)
{ {
put32(client, eGetTargetName); put32(client, eGetTargetName);
@@ -162,7 +162,7 @@ encrypt_token(struct client *client, int32_t hContext, int32_t flags,
} }
static int32_t static int32_t
decrypt_token(struct client *client, int32_t hContext, int flags, decrypt_token(struct client *client, int32_t hContext, int flags,
krb5_data *in, krb5_data *out) krb5_data *in, krb5_data *out)
{ {
int32_t val; int32_t val;
@@ -192,7 +192,7 @@ get_mic(struct client *client, int32_t hContext,
} }
static int32_t static int32_t
verify_mic(struct client *client, int32_t hContext, verify_mic(struct client *client, int32_t hContext,
krb5_data *in, krb5_data *mic) krb5_data *in, krb5_data *mic)
{ {
int32_t val; int32_t val;
@@ -208,7 +208,7 @@ verify_mic(struct client *client, int32_t hContext,
static int32_t static int32_t
get_version_capa(struct client *client, get_version_capa(struct client *client,
int32_t *version, int32_t *capa, int32_t *version, int32_t *capa,
char **version_str) char **version_str)
{ {
@@ -220,7 +220,7 @@ get_version_capa(struct client *client,
} }
static int32_t static int32_t
get_moniker(struct client *client, get_moniker(struct client *client,
char **moniker) char **moniker)
{ {
put32(client, eGetMoniker); put32(client, eGetMoniker);
@@ -310,7 +310,7 @@ build_context(struct client *ipeer, struct client *apeer,
case GSMERR_CONTINUE_NEEDED: case GSMERR_CONTINUE_NEEDED:
break; break;
default: default:
warnx("iPeer %s failed with %d (step %d)", warnx("iPeer %s failed with %d (step %d)",
ipeer->name, (int)val, step); ipeer->name, (int)val, step);
goto out; goto out;
} }
@@ -369,13 +369,13 @@ 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)
{ {
krb5_data msg, mic; krb5_data msg, mic;
int32_t val; int32_t val;
msg.data = "foo"; msg.data = "foo";
msg.length = 3; msg.length = 3;
@@ -392,12 +392,12 @@ test_mic(struct client *c1, int32_t hc1, struct client *c2, int32_t hc2)
} }
static int32_t static int32_t
test_wrap(struct client *c1, int32_t hc1, struct client *c2, int32_t hc2, test_wrap(struct client *c1, int32_t hc1, struct client *c2, int32_t hc2,
int conf) int conf)
{ {
krb5_data msg, wrapped, out; krb5_data msg, wrapped, out;
int32_t val; int32_t val;
msg.data = "foo"; msg.data = "foo";
msg.length = 3; msg.length = 3;
@@ -476,9 +476,9 @@ log_function(void *ptr)
goto out; goto out;
if (krb5_ret_string(c->logsock, &string)) if (krb5_ret_string(c->logsock, &string))
goto out; goto out;
printf("%s:%lu: %s\n", printf("%s:%lu: %s\n",
file, (unsigned long)line, string); file, (unsigned long)line, string);
fprintf(logfile, "%s:%lu: %s\n", fprintf(logfile, "%s:%lu: %s\n",
file, (unsigned long)line, string); file, (unsigned long)line, string);
fflush(logfile); fflush(logfile);
free(file); free(file);
@@ -510,7 +510,7 @@ connect_client(const char *slave)
*port++ = 0; *port++ = 0;
c->name = estrdup(slave); c->name = estrdup(slave);
memset(&hints, 0, sizeof(hints)); memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_UNSPEC; hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_STREAM; hints.ai_socktype = SOCK_STREAM;
@@ -584,7 +584,7 @@ connect_client(const char *slave)
clients = erealloc(clients, (num_clients + 1) * sizeof(*clients)); clients = erealloc(clients, (num_clients + 1) * sizeof(*clients));
clients[num_clients] = c; clients[num_clients] = c;
num_clients++; num_clients++;
@@ -703,7 +703,7 @@ main(int argc, char **argv)
val = acquire_cred(clients[i], user, password, 1, &hCred); val = acquire_cred(clients[i], user, password, 1, &hCred);
if (val != GSMERR_OK) { if (val != GSMERR_OK) {
warnx("Failed to acquire_cred on host %s: %d", warnx("Failed to acquire_cred on host %s: %d",
clients[i]->moniker, (int)val); clients[i]->moniker, (int)val);
failed = 1; failed = 1;
} else } else
@@ -713,7 +713,7 @@ main(int argc, char **argv)
if (failed) if (failed)
goto out; goto out;
/* /*
* First test if all slaves can build context to them-self. * First test if all slaves can build context to them-self.
*/ */
@@ -732,8 +732,8 @@ main(int argc, char **argv)
val = acquire_cred(c, user, password, 1, &hCred); val = acquire_cred(c, 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);
val = build_context(c, c, val = build_context(c, c,
GSS_C_REPLAY_FLAG|GSS_C_SEQUENCE_FLAG| GSS_C_REPLAY_FLAG|GSS_C_SEQUENCE_FLAG|
GSS_C_INTEG_FLAG|GSS_C_CONF_FLAG| GSS_C_INTEG_FLAG|GSS_C_CONF_FLAG|
GSS_C_DELEG_FLAG|GSS_C_MUTUAL_FLAG, GSS_C_DELEG_FLAG|GSS_C_MUTUAL_FLAG,
@@ -792,7 +792,7 @@ main(int argc, char **argv)
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;
@@ -809,11 +809,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); val = test_token(client, clientC, server, serverC);
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) {
@@ -827,11 +827,11 @@ main(int argc, char **argv)
if (hCred) if (hCred)
toast_resource(client, hCred); toast_resource(client, hCred);
} }
/* /*
* Close all connections to clients * Close all connections to clients
*/ */
out: out:
printf("sending goodbye and waiting for log sockets\n"); printf("sending goodbye and waiting for log sockets\n");
for (i = 0; i < num_clients; i++) { for (i = 0; i < num_clients; i++) {

View File

@@ -1,18 +1,18 @@
/* /*
* Copyright (c) 2006 Kungliga Tekniska Högskolan * Copyright (c) 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 KTH nor the names of its contributors may be * 3. Neither the name of KTH nor the names of its contributors may be
* used to endorse or promote products derived from this software without * used to endorse or promote products derived from this software without
@@ -151,7 +151,7 @@ find_handle(struct handle *h, int32_t idx, enum handle_type type)
{ {
if (idx == 0) if (idx == 0)
return NULL; return NULL;
while (h) { while (h) {
if (h->idx == idx) { if (h->idx == idx) {
if (type == h->type) if (type == h->type)
@@ -160,7 +160,7 @@ find_handle(struct handle *h, int32_t idx, enum handle_type type)
} }
h = h->next; h = h->next;
} }
return NULL; return NULL;
} }
@@ -237,7 +237,7 @@ acquire_cred(struct client *c,
ret = krb5_cc_initialize (context, id, cred.client); ret = krb5_cc_initialize (context, id, cred.client);
if (ret) if (ret)
krb5_err (context, 1, ret, "krb5_cc_initialize"); krb5_err (context, 1, ret, "krb5_cc_initialize");
ret = krb5_cc_store_cred (context, id, &cred); ret = krb5_cc_store_cred (context, id, &cred);
if (ret) if (ret)
krb5_err (context, 1, ret, "krb5_cc_store_cred"); krb5_err (context, 1, ret, "krb5_cc_store_cred");
@@ -370,7 +370,7 @@ HandleOP(InitContext)
gss_target_name, gss_target_name,
oid, oid,
flags & 0x7f, flags & 0x7f,
0, 0,
NULL, NULL,
input_token_ptr, input_token_ptr,
NULL, NULL,
@@ -382,7 +382,7 @@ HandleOP(InitContext)
del_handle(&c->handles, hContext); del_handle(&c->handles, hContext);
new_context_id = 0; new_context_id = 0;
logmessage(c, __FILE__, __LINE__, 0, logmessage(c, __FILE__, __LINE__, 0,
"gss_init_sec_context returns code: %d/%d", "gss_init_sec_context returns code: %d/%d",
maj_stat, min_stat); maj_stat, min_stat);
} else { } else {
if (input_token.length == 0) if (input_token.length == 0)
@@ -461,7 +461,7 @@ HandleOP(AcceptContext)
if (hContext != 0) if (hContext != 0)
del_handle(&c->handles, hContext); del_handle(&c->handles, hContext);
logmessage(c, __FILE__, __LINE__, 0, logmessage(c, __FILE__, __LINE__, 0,
"gss_accept_sec_context returns code: %d/%d", "gss_accept_sec_context returns code: %d/%d",
maj_stat, min_stat); maj_stat, min_stat);
new_context_id = 0; new_context_id = 0;
} else { } else {
@@ -484,8 +484,8 @@ 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);
put32(c, new_context_id); put32(c, new_context_id);
@@ -534,11 +534,11 @@ HandleOP(AcquireCreds)
gsm_error = convert_krb5_to_gsm(ret); gsm_error = convert_krb5_to_gsm(ret);
goto out; goto out;
} }
ret = krb5_get_init_creds_opt_alloc (context, &opt); ret = krb5_get_init_creds_opt_alloc (context, &opt);
if (ret) if (ret)
krb5_err(context, 1, ret, "krb5_get_init_creds_opt_alloc"); krb5_err(context, 1, ret, "krb5_get_init_creds_opt_alloc");
krb5_get_init_creds_opt_set_pa_password(context, opt, password, NULL); krb5_get_init_creds_opt_set_pa_password(context, opt, password, NULL);
gsm_error = acquire_cred(c, principal, opt, &handle); gsm_error = acquire_cred(c, principal, opt, &handle);
@@ -580,22 +580,22 @@ HandleOP(Sign)
input_token.length = token.length; input_token.length = token.length;
input_token.value = token.data; input_token.value = token.data;
maj_stat = gss_get_mic(&min_stat, ctx, 0, &input_token, maj_stat = gss_get_mic(&min_stat, ctx, 0, &input_token,
&output_token); &output_token);
if (maj_stat != GSS_S_COMPLETE) if (maj_stat != GSS_S_COMPLETE)
errx(1, "gss_get_mic failed"); errx(1, "gss_get_mic failed");
krb5_data_free(&token); krb5_data_free(&token);
token.data = output_token.value; token.data = output_token.value;
token.length = output_token.length; token.length = output_token.length;
put32(c, 0); /* XXX fix gsm_error */ put32(c, 0); /* XXX fix gsm_error */
putdata(c, token); putdata(c, token);
gss_release_buffer(&min_stat, &output_token); gss_release_buffer(&min_stat, &output_token);
return 0; return 0;
} }
@@ -621,7 +621,7 @@ HandleOP(Verify)
msg_token.length = msg.length; msg_token.length = msg.length;
msg_token.value = msg.data; msg_token.value = msg.data;
retdata(c, mic); retdata(c, mic);
mic_token.length = mic.length; mic_token.length = mic.length;
@@ -631,12 +631,12 @@ HandleOP(Verify)
&mic_token, &qop); &mic_token, &qop);
if (maj_stat != GSS_S_COMPLETE) if (maj_stat != GSS_S_COMPLETE)
errx(1, "gss_verify_mic failed"); errx(1, "gss_verify_mic failed");
krb5_data_free(&mic); krb5_data_free(&mic);
krb5_data_free(&msg); krb5_data_free(&msg);
put32(c, 0); /* XXX fix gsm_error */ put32(c, 0); /* XXX fix gsm_error */
return 0; return 0;
} }
@@ -653,7 +653,7 @@ HandleOP(GetVersionAndCapabilities)
{ {
struct utsname ut; struct utsname ut;
if (uname(&ut) == 0) { if (uname(&ut) == 0) {
snprintf(name, sizeof(name), "%s-%s-%s", snprintf(name, sizeof(name), "%s-%s-%s",
ut.sysname, ut.version, ut.machine); ut.sysname, ut.version, ut.machine);
} }
} }
@@ -663,7 +663,7 @@ HandleOP(GetVersionAndCapabilities)
put32(c, GSSMAGGOTPROTOCOL); put32(c, GSSMAGGOTPROTOCOL);
put32(c, cap); put32(c, cap);
putstring(c, str); putstring(c, str);
free(str); free(str);
return 0; return 0;
@@ -711,12 +711,12 @@ HandleOP(SetLoggingSocket)
krb5_store_int32(c->logging, eLogSetMoniker); krb5_store_int32(c->logging, eLogSetMoniker);
store_string(c->logging, c->moniker); store_string(c->logging, c->moniker);
logmessage(c, __FILE__, __LINE__, 0, "logging turned on"); logmessage(c, __FILE__, __LINE__, 0, "logging turned on");
return 0; return 0;
} }
static int static int
HandleOP(ChangePassword) HandleOP(ChangePassword)
@@ -751,22 +751,22 @@ HandleOP(Wrap)
input_token.length = token.length; input_token.length = token.length;
input_token.value = token.data; input_token.value = token.data;
maj_stat = gss_wrap(&min_stat, ctx, flags, 0, &input_token, maj_stat = gss_wrap(&min_stat, ctx, flags, 0, &input_token,
&conf_state, &output_token); &conf_state, &output_token);
if (maj_stat != GSS_S_COMPLETE) if (maj_stat != GSS_S_COMPLETE)
errx(1, "gss_wrap failed"); errx(1, "gss_wrap failed");
krb5_data_free(&token); krb5_data_free(&token);
token.data = output_token.value; token.data = output_token.value;
token.length = output_token.length; token.length = output_token.length;
put32(c, 0); /* XXX fix gsm_error */ put32(c, 0); /* XXX fix gsm_error */
putdata(c, token); putdata(c, token);
gss_release_buffer(&min_stat, &output_token); gss_release_buffer(&min_stat, &output_token);
return 0; return 0;
} }
@@ -793,10 +793,10 @@ HandleOP(Unwrap)
input_token.length = token.length; input_token.length = token.length;
input_token.value = token.data; input_token.value = token.data;
maj_stat = gss_unwrap(&min_stat, ctx, &input_token, maj_stat = gss_unwrap(&min_stat, ctx, &input_token,
&output_token, &conf_state, &qop_state); &output_token, &conf_state, &qop_state);
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);
@@ -938,15 +938,15 @@ 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);
} }
c->sock = krb5_storage_from_fd(fd); c->sock = krb5_storage_from_fd(fd);
if (c->sock == NULL) if (c->sock == NULL)
errx(1, "krb5_storage_from_fd"); errx(1, "krb5_storage_from_fd");
close(fd); close(fd);
return c; return c;
@@ -987,7 +987,7 @@ handleServer(void *ptr)
} }
logmessage(c, __FILE__, __LINE__, 0, logmessage(c, __FILE__, __LINE__, 0,
"---> Got op %s from server %s", "---> Got op %s from server %s",
handler->name, c->servername); handler->name, c->servername);
if ((handler->func)(handler->op, c)) if ((handler->func)(handler->op, c))
@@ -1076,7 +1076,7 @@ main(int argc, char **argv)
fprintf(logfile, "connected\n"); fprintf(logfile, "connected\n");
{ {
struct client *c; struct client *c;
c = create_client(0, port, moniker_str); c = create_client(0, port, moniker_str);
/* close(0); */ /* close(0); */

View File

@@ -1,18 +1,18 @@
/* /*
* Copyright (c) 2006 Kungliga Tekniska Högskolan * Copyright (c) 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 KTH nor the names of its contributors may be * 3. Neither the name of KTH nor the names of its contributors may be
* used to endorse or promote products derived from this software without * used to endorse or promote products derived from this software without
@@ -63,9 +63,9 @@ enum gssMaggotErrorCodes {
* int32: message OP (enum gssMaggotProtocol) * int32: message OP (enum gssMaggotProtocol)
* ... * ...
* *
* return: -- on error * return: -- on error
* int32: not support (GSMERR_NOT_SUPPORTED) * int32: not support (GSMERR_NOT_SUPPORTED)
* *
* return: -- on existing message OP * return: -- on existing message OP
* int32: support (GSMERR_OK) -- only sent for extensions * int32: support (GSMERR_OK) -- only sent for extensions
* ... * ...
@@ -75,28 +75,28 @@ enum gssMaggotErrorCodes {
enum gssMaggotOp { enum gssMaggotOp {
eGetVersionInfo = 0, eGetVersionInfo = 0,
/* /*
* input: * input:
* none * none
* return: * return:
* int32: last version handled * int32: last version handled
*/ */
eGoodBye, eGoodBye,
/* /*
* input: * input:
* none * none
* return: * return:
* close socket * close socket
*/ */
eInitContext, eInitContext,
/* /*
* input: * input:
* int32: hContext * int32: hContext
* int32: hCred * int32: hCred
* int32: Flags * int32: Flags
* the lowest 0x7f flags maps directly to GSS-API flags * the lowest 0x7f flags maps directly to GSS-API flags
* DELEGATE 0x001 * DELEGATE 0x001
* MUTUAL_AUTH 0x002 * MUTUAL_AUTH 0x002
* REPLAY_DETECT 0x004 * REPLAY_DETECT 0x004
* SEQUENCE_DETECT 0x008 * SEQUENCE_DETECT 0x008
* CONFIDENTIALITY 0x010 * CONFIDENTIALITY 0x010
@@ -115,7 +115,7 @@ enum gssMaggotOp {
* length-encoded: output token * length-encoded: output token
*/ */
eAcceptContext, eAcceptContext,
/* /*
* input: * input:
* int32: hContext * int32: hContext
* int32: Flags -- unused ? * int32: Flags -- unused ?
@@ -229,7 +229,7 @@ enum gssMaggotOp {
* return1: * return1:
* int16: log port number * int16: log port number
* int32: master log prototocol version (0) * int32: master log prototocol version (0)
* *
* wait for master to connect on the master log socket * wait for master to connect on the master log socket
* *
* return2: * return2:

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 1997 - 2000, 2002 Kungliga Tekniska Högskolan * Copyright (c) 1997 - 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 * 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.
*/ */
#include "kf_locl.h" #include "kf_locl.h"
@@ -72,16 +72,16 @@ client_setup(krb5_context *context, int *argc, char **argv)
int status; int status;
setprogname (argv[0]); setprogname (argv[0]);
status = krb5_init_context (context); status = krb5_init_context (context);
if (status) if (status)
errx(1, "krb5_init_context failed: %d", status); errx(1, "krb5_init_context failed: %d", status);
forwardable = krb5_config_get_bool (*context, NULL, forwardable = krb5_config_get_bool (*context, NULL,
"libdefaults", "libdefaults",
"forwardable", "forwardable",
NULL); NULL);
if (getarg (args, num_args, *argc, argv, &optind)) if (getarg (args, num_args, *argc, argv, &optind))
usage(1, args, num_args); usage(1, args, num_args);
@@ -91,7 +91,7 @@ client_setup(krb5_context *context, int *argc, char **argv)
print_version(NULL); print_version(NULL);
exit(0); exit(0);
} }
if(port_str) { if(port_str) {
struct servent *s = roken_getservbyname(port_str, "tcp"); struct servent *s = roken_getservbyname(port_str, "tcp");
if(s) if(s)
@@ -108,7 +108,7 @@ client_setup(krb5_context *context, int *argc, char **argv)
if (port == 0) if (port == 0)
port = krb5_getportbyname (*context, KF_PORT_NAME, "tcp", KF_PORT_NUM); port = krb5_getportbyname (*context, KF_PORT_NAME, "tcp", KF_PORT_NUM);
if(*argc - optind < 1) if(*argc - optind < 1)
usage(1, args, num_args); usage(1, args, num_args);
*argc = optind; *argc = optind;
@@ -211,7 +211,7 @@ proto (int sock, const char *hostname, const char *service,
} }
creds.client = principal; creds.client = principal;
status = krb5_make_principal (context, status = krb5_make_principal (context,
&creds.server, &creds.server,
principal->realm, principal->realm,
@@ -248,7 +248,7 @@ proto (int sock, const char *hostname, const char *service,
krb5_warn (context, status, "krb5_mk_priv"); krb5_warn (context, status, "krb5_mk_priv");
return 1; return 1;
} }
krb5_data_free (&data); krb5_data_free (&data);
status = krb5_read_priv_message(context, auth_context, &sock, &data); status = krb5_read_priv_message(context, auth_context, &sock, &data);
@@ -270,7 +270,7 @@ proto (int sock, const char *hostname, const char *service,
} }
static int static int
doit (const char *hostname, int port, const char *service, doit (const char *hostname, int port, const char *service,
char *message, size_t len) char *message, size_t len)
{ {
struct addrinfo *ai, *a; struct addrinfo *ai, *a;
@@ -313,7 +313,7 @@ main(int argc, char **argv)
{ {
int argcc,port,i; int argcc,port,i;
int ret=0; int ret=0;
argcc = argc; argcc = argc;
port = client_setup(&context, &argcc, argv); port = client_setup(&context, &argcc, argv);

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 1997 - 1999, 2002 Kungliga Tekniska Högskolan * Copyright (c) 1997 - 1999, 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 * 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$ */

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan * Copyright (c) 1997 - 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 * 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.
*/ */
#include "kf_locl.h" #include "kf_locl.h"
@@ -76,7 +76,7 @@ server_setup(krb5_context *context, int argc, char **argv)
print_version(NULL); print_version(NULL);
exit(0); exit(0);
} }
if(port_str){ if(port_str){
struct servent *s = roken_getservbyname(port_str, "tcp"); struct servent *s = roken_getservbyname(port_str, "tcp");
if(s) if(s)
@@ -96,7 +96,7 @@ server_setup(krb5_context *context, int argc, char **argv)
if(argv[local_argc] != NULL) if(argv[local_argc] != NULL)
usage(1, args, num_args); usage(1, args, num_args);
return port; return port;
} }
@@ -189,7 +189,7 @@ proto (int sock, const char *service)
&sock, &remotename); &sock, &remotename);
if (status) if (status)
krb5_err(context, 1, status, "krb5_read_message"); krb5_err(context, 1, status, "krb5_read_message");
status=krb5_read_priv_message (context, auth_context, status=krb5_read_priv_message (context, auth_context,
&sock, &tk_file); &sock, &tk_file);
if (status) if (status)
krb5_err(context, 1, status, "krb5_read_message"); krb5_err(context, 1, status, "krb5_read_message");

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan * Copyright (c) 1995 - 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 * 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
@@ -111,7 +111,7 @@ try_pipe (struct x_socket *s, int dpy, const char *pattern)
int ret; int ret;
int fd; int fd;
int pipefd[2]; int pipefd[2];
snprintf (path, sizeof(path), pattern, dpy); snprintf (path, sizeof(path), pattern, dpy);
fd = open (path, O_WRONLY | O_CREAT | O_EXCL, 0600); fd = open (path, O_WRONLY | O_CREAT | O_EXCL, 0600);
if (fd < 0) { if (fd < 0) {
@@ -408,7 +408,7 @@ create_and_write_cookie (char *file,
int saved_errno; int saved_errno;
gethostname (hostname, sizeof(hostname)); gethostname (hostname, sizeof(hostname));
auth.family = FamilyLocal; auth.family = FamilyLocal;
auth.address = hostname; auth.address = hostname;
auth.address_length = strlen(auth.address); auth.address_length = strlen(auth.address);
@@ -504,7 +504,7 @@ verify_and_remove_cookies (int fd, int sock, int cookiesp)
unsigned n, d, npad, dpad; unsigned n, d, npad, dpad;
char *protocol_name, *protocol_data; char *protocol_name, *protocol_data;
u_char zeros[6] = {0, 0, 0, 0, 0, 0}; u_char zeros[6] = {0, 0, 0, 0, 0, 0};
u_char refused[20] = {0, 10, u_char refused[20] = {0, 10,
0, 0, /* protocol major version */ 0, 0, /* protocol major version */
0, 0, /* protocol minor version */ 0, 0, /* protocol minor version */
0, 0, /* length of additional data / 4 */ 0, 0, /* length of additional data / 4 */
@@ -566,7 +566,7 @@ fail:
return 1; return 1;
} }
/* /*
* Return 0 iff `cookie' is compatible with the cookie for the * Return 0 iff `cookie' is compatible with the cookie for the
* localhost with name given in `ai' (or `hostname') and display * localhost with name given in `ai' (or `hostname') and display
* number in `disp_nr'. * number in `disp_nr'.
@@ -579,7 +579,7 @@ match_local_auth (Xauth* auth,
int auth_disp; int auth_disp;
char *tmp_disp; char *tmp_disp;
struct addrinfo *a; struct addrinfo *a;
tmp_disp = malloc(auth->number_length + 1); tmp_disp = malloc(auth->number_length + 1);
if (tmp_disp == NULL) if (tmp_disp == NULL)
return -1; return -1;
@@ -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) {
@@ -754,7 +754,7 @@ suspicious_address (int sock, struct sockaddr *addr)
switch (addr->sa_family) { switch (addr->sa_family) {
case AF_INET: case AF_INET:
return ((struct sockaddr_in *)addr)->sin_addr.s_addr != return ((struct sockaddr_in *)addr)->sin_addr.s_addr !=
htonl(INADDR_LOOPBACK) htonl(INADDR_LOOPBACK)
#if defined(IP_OPTIONS) && defined(HAVE_GETSOCKOPT) #if defined(IP_OPTIONS) && defined(HAVE_GETSOCKOPT)
|| getsockopt (sock, IPPROTO_IP, IP_OPTIONS, data, &len) < 0 || getsockopt (sock, IPPROTO_IP, IP_OPTIONS, data, &len) < 0

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995 - 1999 Kungliga Tekniska Högskolan * Copyright (c) 1995 - 1999 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

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995 - 2005 Kungliga Tekniska Högskolan * Copyright (c) 1995 - 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
@@ -99,7 +99,7 @@ krb4_authenticate (kx_context *kc, int s)
memcpy (c->key, cred.session, sizeof(des_cblock)); memcpy (c->key, cred.session, sizeof(des_cblock));
return 0; return 0;
} }
/* /*
* Read a krb4 priv packet from `fd' into `buf' (of size `len'). * Read a krb4 priv packet from `fd' into `buf' (of size `len').
* Return the number of bytes read or 0 on EOF or -1 on error. * Return the number of bytes read or 0 on EOF or -1 on error.

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995 - 2005 Kungliga Tekniska Högskolan * Copyright (c) 1995 - 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
@@ -43,7 +43,7 @@ struct krb5_kx_context {
krb5_crypto crypto; krb5_crypto crypto;
krb5_principal client; krb5_principal client;
krb5_log_facility *log; krb5_log_facility *log;
}; };
typedef struct krb5_kx_context krb5_kx_context; typedef struct krb5_kx_context krb5_kx_context;
@@ -109,15 +109,15 @@ krb5_authenticate (kx_context *kc, int s)
return 1; return 1;
} }
ret = krb5_auth_con_getkey (CONTEXT(kc), auth_context, ret = krb5_auth_con_getkey (CONTEXT(kc), auth_context,
&K5DATA(kc)->keyblock); &K5DATA(kc)->keyblock);
if (ret) { if (ret) {
krb5_warn (CONTEXT(kc), ret, "krb5_auth_con_getkey: %s", host); krb5_warn (CONTEXT(kc), ret, "krb5_auth_con_getkey: %s", host);
krb5_auth_con_free (CONTEXT(kc), auth_context); krb5_auth_con_free (CONTEXT(kc), auth_context);
return 1; return 1;
} }
ret = krb5_crypto_init (CONTEXT(kc), K5DATA(kc)->keyblock, ret = krb5_crypto_init (CONTEXT(kc), K5DATA(kc)->keyblock,
0, &K5DATA(kc)->crypto); 0, &K5DATA(kc)->crypto);
if (ret) { if (ret) {
krb5_warn (CONTEXT(kc), ret, "krb5_crypto_init"); krb5_warn (CONTEXT(kc), ret, "krb5_crypto_init");
@@ -149,14 +149,14 @@ krb5_read (kx_context *kc,
if (l != 4) if (l != 4)
return -1; return -1;
data_len = (tmp[0] << 24) | (tmp[1] << 16) | (tmp[2] << 8) | tmp[3]; data_len = (tmp[0] << 24) | (tmp[1] << 16) | (tmp[2] << 8) | tmp[3];
outer_len = krb5_get_wrapped_length (CONTEXT(kc), outer_len = krb5_get_wrapped_length (CONTEXT(kc),
K5DATA(kc)->crypto, data_len); K5DATA(kc)->crypto, data_len);
if (outer_len > len) if (outer_len > len)
return -1; return -1;
if (krb5_net_read (CONTEXT(kc), &fd, buf, outer_len) != outer_len) if (krb5_net_read (CONTEXT(kc), &fd, buf, outer_len) != outer_len)
return -1; return -1;
ret = krb5_decrypt (CONTEXT(kc), K5DATA(kc)->crypto, ret = krb5_decrypt (CONTEXT(kc), K5DATA(kc)->crypto,
KRB5_KU_OTHER_ENCRYPTED, KRB5_KU_OTHER_ENCRYPTED,
buf, outer_len, &data); buf, outer_len, &data);
if (ret) { if (ret) {
@@ -186,7 +186,7 @@ krb5_write(kx_context *kc,
unsigned char tmp[4]; unsigned char tmp[4];
size_t outlen; size_t outlen;
ret = krb5_encrypt (CONTEXT(kc), K5DATA(kc)->crypto, ret = krb5_encrypt (CONTEXT(kc), K5DATA(kc)->crypto,
KRB5_KU_OTHER_ENCRYPTED, KRB5_KU_OTHER_ENCRYPTED,
buf, len, &data); buf, len, &data);
if (ret){ if (ret){
@@ -331,7 +331,7 @@ krb5_make_context (kx_context *kc)
kc->data = malloc(sizeof(krb5_kx_context)); kc->data = malloc(sizeof(krb5_kx_context));
if (kc->data == NULL) { if (kc->data == NULL) {
syslog (LOG_ERR, "failed to malloc %lu bytes", syslog (LOG_ERR, "failed to malloc %lu bytes",
(unsigned long)sizeof(krb5_kx_context)); (unsigned long)sizeof(krb5_kx_context));
exit(1); exit(1);
} }

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995-2003 Kungliga Tekniska Högskolan * Copyright (c) 1995-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 * 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
@@ -48,7 +48,7 @@ childhandler (int sig)
pid_t pid; pid_t pid;
int status; int status;
do { do {
pid = waitpid (-1, &status, WNOHANG|WUNTRACED); pid = waitpid (-1, &status, WNOHANG|WUNTRACED);
if (pid > 0 && (WIFEXITED(status) || WIFSIGNALED(status))) if (pid > 0 && (WIFEXITED(status) || WIFSIGNALED(status)))
if (--nchild == 0 && donep) if (--nchild == 0 && donep)
@@ -114,7 +114,7 @@ connect_host (kx_context *kc)
warnx ("%s: %s", kc->host, gai_strerror(error)); warnx ("%s: %s", kc->host, gai_strerror(error));
return -1; return -1;
} }
for (a = ai; a != NULL; a = a->ai_next) { for (a = ai; a != NULL; a = a->ai_next) {
s = socket (a->ai_family, a->ai_socktype, a->ai_protocol); s = socket (a->ai_family, a->ai_socktype, a->ai_protocol);
if (s < 0) if (s < 0)
@@ -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");
@@ -337,7 +337,7 @@ doit_passive (kx_context *kc)
} }
/* /*
* Allocate a local pseudo-xserver and wait for connections * Allocate a local pseudo-xserver and wait for connections
*/ */
static int static int
@@ -384,7 +384,7 @@ doit_active (kx_context *kc)
--rem; --rem;
str = getenv("DISPLAY"); str = getenv("DISPLAY");
if (str == NULL || (str = strchr(str, ':')) == NULL) if (str == NULL || (str = strchr(str, ':')) == NULL)
str = ":0"; str = ":0";
len = strlen (str); len = strlen (str);
tmp = kx_put_int (len, p, rem, 4); tmp = kx_put_int (len, p, rem, 4);
@@ -449,7 +449,7 @@ doit_active (kx_context *kc)
FD_ZERO(&fdset); FD_ZERO(&fdset);
for (i = 0; i < nsockets; ++i) { for (i = 0; i < nsockets; ++i) {
if (sockets[i].fd >= FD_SETSIZE) if (sockets[i].fd >= FD_SETSIZE)
errx (1, "fd too large"); errx (1, "fd too large");
FD_SET(sockets[i].fd, &fdset); FD_SET(sockets[i].fd, &fdset);
} }
@@ -575,7 +575,7 @@ doit (kx_context *kc, int passive_flag)
*/ */
static int static int
doit_v4 (const char *host, int port, const char *user, doit_v4 (const char *host, int port, const char *user,
int passive_flag, int debug_flag, int keepalive_flag, int tcp_flag) int passive_flag, int debug_flag, int keepalive_flag, int tcp_flag)
{ {
int ret; int ret;
@@ -742,7 +742,7 @@ main(int argc, char **argv)
use_v4 = 0; use_v4 = 0;
if(use_v5 == -1 && use_v4 == 1) if(use_v5 == -1 && use_v4 == 1)
use_v5 = 0; use_v5 = 0;
#endif #endif
#ifdef KRB5 #ifdef KRB5
if (ret && use_v5) { if (ret && use_v5) {
@@ -756,7 +756,7 @@ main(int argc, char **argv)
if (ret && use_v4) { if (ret && use_v4) {
if (port == 0) if (port == 0)
port = k_getportbyname("kx", "tcp", htons(KX_PORT)); port = k_getportbyname("kx", "tcp", htons(KX_PORT));
ret = doit_v4 (host, port, user, ret = doit_v4 (host, port, user,
passive_flag, debug_flag, keepalive_flag, tcp_flag); passive_flag, debug_flag, keepalive_flag, tcp_flag);
} }
#endif #endif

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan * Copyright (c) 1995 - 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 * 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

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995 - 2003 Kungliga Tekniska Högskolan * Copyright (c) 1995 - 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 * 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
@@ -48,7 +48,7 @@ childhandler (int sig)
pid_t pid; pid_t pid;
int status; int status;
do { do {
pid = waitpid (-1, &status, WNOHANG|WUNTRACED); pid = waitpid (-1, &status, WNOHANG|WUNTRACED);
if (pid > 0 && pid == wait_on_pid) if (pid > 0 && pid == wait_on_pid)
done = 1; done = 1;
@@ -141,7 +141,7 @@ recv_conn (int sock, kx_context *kc,
} }
kc->thataddr_len = addrlen; kc->thataddr_len = addrlen;
getnameinfo_verified (kc->thataddr, getnameinfo_verified (kc->thataddr,
kc->thataddr_len, kc->thataddr_len,
remotehost, sizeof(remotehost), remotehost, sizeof(remotehost),
NULL, 0, 0); NULL, 0, 0);
@@ -232,7 +232,7 @@ recv_conn (int sock, kx_context *kc,
} }
ret = getnameinfo(kc->thataddr, kc->thataddr_len, ret = getnameinfo(kc->thataddr, kc->thataddr_len,
remoteaddr, sizeof(remoteaddr), remoteaddr, sizeof(remoteaddr),
NULL, 0, NI_NUMERICHOST); NULL, 0, NI_NUMERICHOST);
if (ret != 0) if (ret != 0)
fatal (kc, sock, "getnameinfo failed: %s", gai_strerror(ret)); fatal (kc, sock, "getnameinfo failed: %s", gai_strerror(ret));
@@ -399,7 +399,7 @@ close_connection(int fd, const char *message)
mlen = strlen(message); mlen = strlen(message);
if(mlen > 255) if(mlen > 255)
mlen = 255; mlen = 255;
/* read first part of connection packet, to get byte order */ /* read first part of connection packet, to get byte order */
if(read(fd, buf, 6) != 6) { if(read(fd, buf, 6) != 6) {
close(fd); close(fd);
@@ -418,7 +418,7 @@ close_connection(int fd, const char *message)
*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;
buf[7] = 0; buf[7] = 0;
}else{ }else{
@@ -454,7 +454,7 @@ doit_passive (kx_context *kc,
snprintf (display, display_size, "localhost:%u", display_num); snprintf (display, display_size, "localhost:%u", display_num);
else else
snprintf (display, display_size, ":%u", display_num); snprintf (display, display_size, ":%u", display_num);
error = create_and_write_cookie (xauthfile, xauthfile_size, error = create_and_write_cookie (xauthfile, xauthfile_size,
cookie, cookie_len); cookie, cookie_len);
if (error) { if (error) {
cleanup(nsockets, sockets); cleanup(nsockets, sockets);
@@ -494,7 +494,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);
@@ -507,7 +507,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");
@@ -632,7 +632,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;
@@ -640,7 +640,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,18 +1,18 @@
/* /*
* Copyright (c) 1999 - 2000 Kungliga Tekniska Högskolan * Copyright (c) 1999 - 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 KTH nor the names of its contributors may be * 3. Neither the name of KTH nor the names of its contributors may be
* used to endorse or promote products derived from this software without * used to endorse or promote products derived from this software without

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 2000 Kungliga Tekniska Högskolan * Copyright (c) 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 * 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.
*/ */
#include "login_locl.h" #include "login_locl.h"
@@ -59,13 +59,13 @@ add_env(const char *var, const char *value)
if(str == NULL) if(str == NULL)
errx(1, "Out of memory!"); errx(1, "Out of memory!");
for(i = 0; i < num_env; i++) for(i = 0; i < num_env; i++)
if(strncmp(env[i], var, strlen(var)) == 0 && if(strncmp(env[i], var, strlen(var)) == 0 &&
env[i][strlen(var)] == '='){ env[i][strlen(var)] == '='){
free(env[i]); free(env[i]);
env[i] = str; env[i] = str;
return; return;
} }
extend_env(str); extend_env(str);
} }
@@ -83,7 +83,7 @@ login_read_env(const char *file)
char **newenv; char **newenv;
char *p; char *p;
int i, j; int i, j;
newenv = NULL; newenv = NULL;
i = read_environment(file, &newenv); i = read_environment(file, &newenv);
for (j = 0; j < i; j++) { for (j = 0; j < i; j++) {

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 * 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.
*/ */
#include "login_locl.h" #include "login_locl.h"
@@ -91,7 +91,7 @@ find_limit(const char *name)
/* this function reads limits.conf files similar to pam_limits /* this function reads limits.conf files similar to pam_limits
unimplemented features include: unimplemented features include:
% maxlogins % maxlogins
"-" no limits, "-" no limits,
priorities etc that are not set via setrlimit priorities etc that are not set via setrlimit
XXX uses static storage, and clobbers getgr* XXX uses static storage, and clobbers getgr*
*/ */
@@ -131,7 +131,7 @@ read_limits_conf(const char *file, const struct passwd *pwd)
int c; int c;
while((c = fgetc(f)) != EOF) { while((c = fgetc(f)) != EOF) {
eof = 0; eof = 0;
if(c == '\n') if(c == '\n')
break; break;
} }
if(!eof) { if(!eof) {
@@ -197,7 +197,7 @@ read_limits_conf(const char *file, const struct passwd *pwd)
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)
l->limit.rlim_cur = value; l->limit.rlim_cur = value;
if(strcasecmp(args[1], "hard") == 0 || strcmp(args[1], "-") == 0) if(strcasecmp(args[1], "hard") == 0 || strcmp(args[1], "-") == 0)
l->limit.rlim_max = value; l->limit.rlim_max = value;
} }
fclose(f); fclose(f);

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 1997 - 2006 Kungliga Tekniska Högskolan * Copyright (c) 1997 - 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 * 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.
*/ */
#include "login_locl.h" #include "login_locl.h"
@@ -100,7 +100,7 @@ start_logout_process(void)
execle(prog, argv0, NULL, env); execle(prog, argv0, NULL, env);
err(1, "exec %s", prog); err(1, "exec %s", prog);
} }
} else if(ret < 0) } else if(ret < 0)
err(1, "waitpid"); err(1, "waitpid");
} }
} }
@@ -110,7 +110,7 @@ exec_shell(const char *shell, int fallback)
{ {
char *sh; char *sh;
const char *p; const char *p;
extend_env(NULL); extend_env(NULL);
if(start_login_process() < 0) if(start_login_process() < 0)
warn("login process"); warn("login process");
@@ -125,7 +125,7 @@ exec_shell(const char *shell, int fallback)
errx(1, "Out of memory"); errx(1, "Out of memory");
execle(shell, sh, NULL, env); execle(shell, sh, NULL, env);
if(fallback){ if(fallback){
warnx("Can't exec %s, trying %s", warnx("Can't exec %s, trying %s",
shell, _PATH_BSHELL); shell, _PATH_BSHELL);
execle(_PATH_BSHELL, "-sh", NULL, env); execle(_PATH_BSHELL, "-sh", NULL, env);
err(1, "%s", _PATH_BSHELL); err(1, "%s", _PATH_BSHELL);
@@ -171,9 +171,9 @@ krb5_verify(struct passwd *pwd, const char *password)
return 1; return 1;
} }
ret = krb5_verify_user_lrealm(context, ret = krb5_verify_user_lrealm(context,
princ, princ,
id, id,
password, password,
1, 1,
NULL); NULL);
krb5_free_principal(context, princ); krb5_free_principal(context, princ);
@@ -189,15 +189,15 @@ krb5_to4 (krb5_ccache id)
ret = krb5_cc_get_principal(context, id, &princ); ret = krb5_cc_get_principal(context, id, &princ);
if(ret == 0) { if(ret == 0) {
krb5_appdefault_boolean(context, "login", krb5_appdefault_boolean(context, "login",
krb5_principal_get_realm(context, princ), krb5_principal_get_realm(context, princ),
"krb4_get_tickets", FALSE, &get_v4_tgt); "krb4_get_tickets", FALSE, &get_v4_tgt);
krb5_free_principal(context, princ); krb5_free_principal(context, princ);
} else { } else {
krb5_realm realm = NULL; krb5_realm realm = NULL;
krb5_get_default_realm(context, &realm); krb5_get_default_realm(context, &realm);
krb5_appdefault_boolean(context, "login", krb5_appdefault_boolean(context, "login",
realm, realm,
"krb4_get_tickets", FALSE, &get_v4_tgt); "krb4_get_tickets", FALSE, &get_v4_tgt);
free(realm); free(realm);
} }
@@ -254,7 +254,7 @@ krb5_start_session (const struct passwd *pwd)
char residual[64]; char residual[64];
/* copy credentials to file cache */ /* copy credentials to file cache */
snprintf(residual, sizeof(residual), "FILE:/tmp/krb5cc_%u", snprintf(residual, sizeof(residual), "FILE:/tmp/krb5cc_%u",
(unsigned)pwd->pw_uid); (unsigned)pwd->pw_uid);
krb5_cc_resolve(context, residual, &id2); krb5_cc_resolve(context, residual, &id2);
ret = krb5_cc_copy_cache(context, id, id2); ret = krb5_cc_copy_cache(context, id, id2);
@@ -289,7 +289,7 @@ krb5_get_afs_tokens (const struct passwd *pwd)
return; return;
ret = krb5_cc_default(context, &id2); ret = krb5_cc_default(context, &id2);
if (ret == 0) { if (ret == 0) {
pw_dir = pwd->pw_dir; pw_dir = pwd->pw_dir;
@@ -436,7 +436,7 @@ show_file(const char *file)
fclose(f); fclose(f);
} }
/* /*
* Actually log in the user. `pwd' contains all the relevant * Actually log in the user. `pwd' contains all the relevant
* information about the user. `ttyn' is the complete name of the tty * information about the user. `ttyn' is the complete name of the tty
* and `tty' the short name. * and `tty' the short name.
@@ -456,7 +456,7 @@ do_login(const struct passwd *pwd, char *tty, char *ttyn)
if(!rootlogin) if(!rootlogin)
checknologin(); checknologin();
#ifdef HAVE_GETSPNAM #ifdef HAVE_GETSPNAM
sp = getspnam(pwd->pw_name); sp = getspnam(pwd->pw_name);
#endif #endif
@@ -496,7 +496,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);
@@ -523,7 +523,7 @@ do_login(const struct passwd *pwd, char *tty, char *ttyn)
/* make sure signals are set to default actions, apparently some /* make sure signals are set to default actions, apparently some
OS:es like to ignore SIGINT, which is not very convenient */ OS:es like to ignore SIGINT, which is not very convenient */
for (i = 1; i < NSIG; ++i) for (i = 1; i < NSIG; ++i)
signal(i, SIG_DFL); signal(i, SIG_DFL);
@@ -726,7 +726,7 @@ main(int argc, char **argv)
int ask = 1; int ask = 1;
struct sigaction sa; struct sigaction sa;
setprogname(argv[0]); setprogname(argv[0]);
#ifdef KRB5 #ifdef KRB5
@@ -862,7 +862,7 @@ main(int argc, char **argv)
tty = ttyn + strlen(_PATH_DEV); tty = ttyn + strlen(_PATH_DEV);
else else
tty = ttyn; tty = ttyn;
if (login_access (pwd, remote_host ? remote_host : tty) == 0) { if (login_access (pwd, remote_host ? remote_host : tty) == 0) {
fprintf(stderr, "Permission denied\n"); fprintf(stderr, "Permission denied\n");
if (remote_host) if (remote_host)

View File

@@ -101,13 +101,13 @@ int login_access(struct passwd *user, char *from)
|| !(users = strtok_r(NULL, fs, &foo)) || !(users = strtok_r(NULL, fs, &foo))
|| !(froms = strtok_r(NULL, fs, &foo)) || !(froms = strtok_r(NULL, fs, &foo))
|| strtok_r(NULL, fs, &foo)) { || strtok_r(NULL, fs, &foo)) {
syslog(LOG_ERR, "%s: line %d: bad field count", syslog(LOG_ERR, "%s: line %d: bad field count",
_PATH_LOGACCESS, _PATH_LOGACCESS,
lineno); lineno);
continue; continue;
} }
if (perm[0] != '+' && perm[0] != '-') { if (perm[0] != '+' && perm[0] != '-') {
syslog(LOG_ERR, "%s: line %d: bad first field", syslog(LOG_ERR, "%s: line %d: bad first field",
_PATH_LOGACCESS, _PATH_LOGACCESS,
lineno); lineno);
continue; continue;

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 1997 - 2005 Kungliga Tekniska Högskolan * Copyright (c) 1997 - 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$ */

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 1997 - 2005 Kungliga Tekniska Högskolan * Copyright (c) 1997 - 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$ */

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 1998 Kungliga Tekniska Högskolan * Copyright (c) 1998 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.
*/ */
#include "login_locl.h" #include "login_locl.h"
@@ -40,15 +40,15 @@ do_osfc2_magic(uid_t uid)
#ifdef HAVE_OSFC2 #ifdef HAVE_OSFC2
struct es_passwd *epw; struct es_passwd *epw;
char *argv[2]; char *argv[2];
/* fake */ /* fake */
argv[0] = (char*)getprogname(); argv[0] = (char*)getprogname();
argv[1] = NULL; argv[1] = NULL;
set_auth_parameters(1, argv); set_auth_parameters(1, argv);
epw = getespwuid(uid); epw = getespwuid(uid);
if(epw == NULL) { if(epw == NULL) {
syslog(LOG_AUTHPRIV|LOG_NOTICE, syslog(LOG_AUTHPRIV|LOG_NOTICE,
"getespwuid failed for %d", uid); "getespwuid failed for %d", uid);
printf("Sorry.\n"); printf("Sorry.\n");
return 1; return 1;
@@ -59,17 +59,17 @@ do_osfc2_magic(uid_t uid)
any other kind of serious C2 mumbo-jumbo. We do, any other kind of serious C2 mumbo-jumbo. We do,
however, call setluid, since failing to do so is not however, call setluid, since failing to do so is not
very good (take my word for it). */ very good (take my word for it). */
if(!epw->uflg->fg_uid) { if(!epw->uflg->fg_uid) {
syslog(LOG_AUTHPRIV|LOG_NOTICE, syslog(LOG_AUTHPRIV|LOG_NOTICE,
"attempted login by %s (has no uid)", epw->ufld->fd_name); "attempted login by %s (has no uid)", epw->ufld->fd_name);
printf("Sorry.\n"); printf("Sorry.\n");
return 1; return 1;
} }
setluid(epw->ufld->fd_uid); setluid(epw->ufld->fd_uid);
if(getluid() != epw->ufld->fd_uid) { if(getluid() != epw->ufld->fd_uid) {
syslog(LOG_AUTHPRIV|LOG_NOTICE, syslog(LOG_AUTHPRIV|LOG_NOTICE,
"failed to set LUID for %s (%d)", "failed to set LUID for %s (%d)",
epw->ufld->fd_name, epw->ufld->fd_uid); epw->ufld->fd_name, epw->ufld->fd_uid);
printf("Sorry.\n"); printf("Sorry.\n");
return 1; return 1;

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan * Copyright (c) 1997 - 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 * 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.
*/ */
#include "login_locl.h" #include "login_locl.h"
@@ -69,13 +69,13 @@ read_string(const char *prompt, char *buf, size_t len, int echo)
sigemptyset(&sa.sa_mask); sigemptyset(&sa.sa_mask);
sa.sa_flags = 0; sa.sa_flags = 0;
for(i = 1; i < sizeof(sigs) / sizeof(sigs[0]); i++) for(i = 1; i < sizeof(sigs) / sizeof(sigs[0]); i++)
if (i != SIGALRM) if (i != SIGALRM)
if (sigaction(i, &sa, &sigs[i]) == 0) if (sigaction(i, &sa, &sigs[i]) == 0)
oksigs[i] = 1; oksigs[i] = 1;
if((tty = fopen("/dev/tty", "r")) == NULL) if((tty = fopen("/dev/tty", "r")) == NULL)
tty = stdin; tty = stdin;
fprintf(stderr, "%s", prompt); fprintf(stderr, "%s", prompt);
fflush(stderr); fflush(stderr);
@@ -103,19 +103,19 @@ read_string(const char *prompt, char *buf, size_t len, int echo)
if(of) if(of)
p--; p--;
*p = 0; *p = 0;
if(echo == 0){ if(echo == 0){
printf("\n"); printf("\n");
tcsetattr(fileno(tty), TCSANOW, &t_old); tcsetattr(fileno(tty), TCSANOW, &t_old);
} }
if(tty != stdin) if(tty != stdin)
fclose(tty); fclose(tty);
for(i = 1; i < sizeof(sigs) / sizeof(sigs[0]); i++) for(i = 1; i < sizeof(sigs) / sizeof(sigs[0]); i++)
if (oksigs[i]) if (oksigs[i])
sigaction(i, &sigs[i], NULL); sigaction(i, &sigs[i], NULL);
if(ret) if(ret)
return -3; return -3;
if(intr_flag) if(intr_flag)

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 1997, 1998, 1999 Kungliga Tekniska Högskolan * Copyright (c) 1997, 1998, 1999 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.
*/ */
#include "login_locl.h" #include "login_locl.h"
@@ -60,13 +60,13 @@ change_passwd(const struct passwd *who)
} }
} }
void void
check_shadow(const struct passwd *pw, const struct spwd *sp) check_shadow(const struct passwd *pw, const struct spwd *sp)
{ {
long today; long today;
today = time(0)/(24L * 60 * 60); today = time(0)/(24L * 60 * 60);
if (sp == NULL) if (sp == NULL)
return; return;

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan * Copyright (c) 1995, 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 * 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
@@ -95,6 +95,6 @@ stty_default(void)
termios.c_cc[VEOF] = Ctl('D'); termios.c_cc[VEOF] = Ctl('D');
termios.c_cc[VSUSP] = Ctl('Z'); termios.c_cc[VSUSP] = Ctl('Z');
tcsetattr(0, TCSANOW, &termios); tcsetattr(0, TCSANOW, &termios);
} }

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan * Copyright (c) 1995, 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 * 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
@@ -61,7 +61,7 @@ char *
make_id (char *tty) make_id (char *tty)
{ {
char *res = tty; char *res = tty;
if (strncmp (res, "pts/", 4) == 0) if (strncmp (res, "pts/", 4) == 0)
res += 4; res += 4;
if (strncmp (res, "tty", 3) == 0) if (strncmp (res, "tty", 3) == 0)

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan * Copyright (c) 1995 - 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 * 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
@@ -79,7 +79,7 @@ shrink_hostname (const char *hostname,
#ifdef HAVE_UTMPX_H #ifdef HAVE_UTMPX_H
void utmp_login(char *tty, const char *username, const char *hostname) void utmp_login(char *tty, const char *username, const char *hostname)
{ {
return; return;
} }
#else #else
@@ -87,7 +87,7 @@ void utmp_login(char *tty, const char *username, const char *hostname)
/* update utmp and wtmp - the BSD way */ /* update utmp and wtmp - the BSD way */
static void static void
prepare_utmp (struct utmp *utmp, char *tty, prepare_utmp (struct utmp *utmp, char *tty,
const char *username, const char *hostname) const char *username, const char *hostname)
{ {
char *ttyx = clean_ttyname (tty); char *ttyx = clean_ttyname (tty);

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995-1997, 1999 Kungliga Tekniska Högskolan * Copyright (c) 1995-1997, 1999 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
@@ -50,9 +50,9 @@ struct getargs args[] = {
{ "delete", 'd', arg_flag, &deletep, "delete OTP" }, { "delete", 'd', arg_flag, &deletep, "delete OTP" },
{ "open", 'o', arg_flag, &openp, "open a locked OTP" }, { "open", 'o', arg_flag, &openp, "open a locked OTP" },
{ "renew", 'r', arg_flag, &renewp, "securely renew OTP" }, { "renew", 'r', arg_flag, &renewp, "securely renew OTP" },
{ "hash", 'f', arg_string, &alg_string, { "hash", 'f', arg_string, &alg_string,
"hash algorithm (md4, md5, or sha)", "algorithm"}, "hash algorithm (md4, md5, or sha)", "algorithm"},
{ "user", 'u', arg_string, &user, { "user", 'u', arg_string, &user,
"user other than current user (root only)", "user" }, "user other than current user (root only)", "user" },
{ "version", 0, arg_flag, &version_flag }, { "version", 0, arg_flag, &version_flag },
{ "help", 'h', arg_flag, &help_flag } { "help", 'h', arg_flag, &help_flag }
@@ -67,8 +67,8 @@ usage(int code)
exit(code); exit(code);
} }
/* /*
* Renew the OTP for a user. * Renew the OTP for a user.
* The pass-phrase is not required (RFC 1938/8.0) * The pass-phrase is not required (RFC 1938/8.0)
*/ */
@@ -89,7 +89,7 @@ renew (int argc, char **argv, OtpAlgorithm *alg, char *user)
snprintf (prompt, sizeof(prompt), snprintf (prompt, sizeof(prompt),
"[ otp-%s %u %s ]", "[ otp-%s %u %s ]",
newctx.alg->name, newctx.alg->name,
newctx.n, newctx.n,
newctx.seed); newctx.seed);
if (UI_UTIL_read_pw_string (pw, sizeof(pw), prompt, 0) == 0 && if (UI_UTIL_read_pw_string (pw, sizeof(pw), prompt, 0) == 0 &&
otp_parse (newctx.key, pw, alg) == 0) { otp_parse (newctx.key, pw, alg) == 0) {
@@ -113,7 +113,7 @@ renew (int argc, char **argv, OtpAlgorithm *alg, char *user)
* I would rather have returned !=0 but it's shell-like here around. * I would rather have returned !=0 but it's shell-like here around.
*/ */
static int static int
verify_user_otp(char *username) verify_user_otp(char *username)
{ {
OtpContext ctx; OtpContext ctx;
@@ -122,7 +122,7 @@ verify_user_otp(char *username)
if (otp_challenge (&ctx, username, ss, sizeof(ss)) != 0) { if (otp_challenge (&ctx, username, ss, sizeof(ss)) != 0) {
warnx("no otp challenge found for %s", username); warnx("no otp challenge found for %s", username);
return 1; return 1;
} }
snprintf (prompt, sizeof(prompt), "%s's %s Password: ", username, ss); snprintf (prompt, sizeof(prompt), "%s's %s Password: ", username, ss);
@@ -131,7 +131,7 @@ verify_user_otp(char *username)
return otp_verify_user (&ctx, passwd); return otp_verify_user (&ctx, passwd);
} }
/* /*
* Set the OTP for a user * Set the OTP for a user
*/ */
@@ -194,7 +194,7 @@ delete_otp (int argc, char **argv, char *user)
return ret; return ret;
} }
/* /*
* Tell whether the user has an otp * Tell whether the user has an otp
*/ */
@@ -210,9 +210,9 @@ has_an_otp(char *user)
warnx ("otp_db_open failed"); warnx ("otp_db_open failed");
return 0; /* if no db no otp! */ return 0; /* if no db no otp! */
} }
ctx.user = user; ctx.user = user;
ret = otp_simple_get(db, &ctx); ret = otp_simple_get(db, &ctx);
otp_db_close (db); otp_db_close (db);
return !ret; return !ret;
@@ -251,7 +251,7 @@ open_otp (int argc, char **argv, char *user)
db = otp_db_open (); db = otp_db_open ();
if (db == NULL) if (db == NULL)
errx (1, "otp_db_open failed"); errx (1, "otp_db_open failed");
ctx.user = user; ctx.user = user;
ret = otp_simple_get (db, &ctx); ret = otp_simple_get (db, &ctx);
if (ret == 0) if (ret == 0)
@@ -292,7 +292,7 @@ main (int argc, char **argv)
int uid = getuid(); int uid = getuid();
OtpAlgorithm *alg = otp_find_alg (OTP_ALG_DEFAULT); OtpAlgorithm *alg = otp_find_alg (OTP_ALG_DEFAULT);
int optind = 0; int optind = 0;
setprogname (argv[0]); setprogname (argv[0]);
if(getarg(args, num_args, argc, argv, &optind)) if(getarg(args, num_args, argc, argv, &optind))
usage(1); usage(1);
@@ -318,7 +318,7 @@ main (int argc, char **argv)
if (!(listp || deletep || renewp || openp)) if (!(listp || deletep || renewp || openp))
defaultp = 1; defaultp = 1;
if ( listp + deletep + renewp + defaultp + openp != 1) if ( listp + deletep + renewp + defaultp + openp != 1)
usage(1); /* one of -d or -l or -r or none */ usage(1); /* one of -d or -l or -r or none */
if(deletep || openp || listp) { if(deletep || openp || listp) {
@@ -339,7 +339,7 @@ main (int argc, char **argv)
err (1, "You don't exist"); err (1, "You don't exist");
user = pwd->pw_name; user = pwd->pw_name;
} }
/* /*
* users other that root must provide the next OTP to update the sequence. * users other that root must provide the next OTP to update the sequence.
* it avoids someone to use a pending session to change an OTP sequence. * it avoids someone to use a pending session to change an OTP sequence.

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan * Copyright (c) 1995 - 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 * 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

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995-1999 Kungliga Tekniska Högskolan * Copyright (c) 1995-1999 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
@@ -47,7 +47,7 @@ struct getargs args[] = {
{ "extended", 'e', arg_flag, &extendedp, "print keys in extended format" }, { "extended", 'e', arg_flag, &extendedp, "print keys in extended format" },
{ "count", 'n', arg_integer, &count, "number of keys to print" }, { "count", 'n', arg_integer, &count, "number of keys to print" },
{ "hexadecimal", 'h', arg_flag, &hexp, "output in hexadecimal" }, { "hexadecimal", 'h', arg_flag, &hexp, "output in hexadecimal" },
{ "hash", 'f', arg_string, &alg_string, { "hash", 'f', arg_string, &alg_string,
"hash algorithm (md4, md5, or sha)", "algorithm"}, "hash algorithm (md4, md5, or sha)", "algorithm"},
{ "version", 0, arg_flag, &version_flag }, { "version", 0, arg_flag, &version_flag },
{ "help", 0, arg_flag, &help_flag } { "help", 0, arg_flag, &help_flag }

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 2004 Kungliga Tekniska Högskolan * Copyright (c) 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 * 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.
*/ */
#include <popper.h> #include <popper.h>
@@ -70,7 +70,7 @@ gss_set_error (struct gss_state *gs, int min_stat)
} }
static int static int
gss_loop(POP *p, void *state, gss_loop(POP *p, void *state,
/* const */ void *input, size_t input_length, /* const */ void *input, size_t input_length,
void **output, size_t *output_length) void **output, size_t *output_length)
{ {
@@ -128,12 +128,12 @@ gss_loop(POP *p, void *state,
input_token->value = x; input_token->value = x;
input_token->length = 4; input_token->length = 4;
maj_stat = gss_wrap(&min_stat, maj_stat = gss_wrap(&min_stat,
gs->context_hdl, gs->context_hdl,
FALSE, FALSE,
GSS_C_QOP_DEFAULT, GSS_C_QOP_DEFAULT,
input_token, input_token,
NULL, NULL,
output_token); output_token);
if (GSS_ERROR(maj_stat)) { if (GSS_ERROR(maj_stat)) {
gss_set_error(gs, min_stat); gss_set_error(gs, min_stat);
@@ -157,9 +157,9 @@ gss_loop(POP *p, void *state,
maj_stat = gss_unwrap (&min_stat, maj_stat = gss_unwrap (&min_stat,
gs->context_hdl, gs->context_hdl,
input_token, input_token,
output_token, output_token,
NULL, NULL,
NULL); NULL);
if (GSS_ERROR(maj_stat)) { if (GSS_ERROR(maj_stat)) {
gss_set_error(gs, min_stat); gss_set_error(gs, min_stat);

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 2004 Kungliga Tekniska Högskolan * Copyright (c) 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 * 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.
*/ */
#include <popper.h> #include <popper.h>
@@ -47,7 +47,7 @@ struct krb4_state {
}; };
static int static int
krb4_loop(POP *p, void *state, krb4_loop(POP *p, void *state,
/* const */ void *input, size_t input_length, /* const */ void *input, size_t input_length,
void **output, size_t *output_length) void **output, size_t *output_length)
{ {
@@ -56,7 +56,7 @@ krb4_loop(POP *p, void *state,
int ret; int ret;
des_cblock key; des_cblock key;
unsigned char *data; unsigned char *data;
char instance[INST_SZ]; char instance[INST_SZ];
des_key_schedule schedule; des_key_schedule schedule;
if(ks->stage == 0) { if(ks->stage == 0) {

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 1998 Kungliga Tekniska Högskolan * Copyright (c) 1998 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.
*/ */
#include <popper.h> #include <popper.h>
@@ -38,7 +38,7 @@ RCSID("$Id$");
static void static void
make_path(POP *p, MsgInfoList *mp, int new, char *buf, size_t len) make_path(POP *p, MsgInfoList *mp, int new, char *buf, size_t len)
{ {
snprintf(buf, len, "%s/%s%s%s", p->drop_name, snprintf(buf, len, "%s/%s%s%s", p->drop_name,
new ? "new" : "cur", mp ? "/" : "", mp ? mp->name : ""); new ? "new" : "cur", mp ? "/" : "", mp ? mp->name : "");
} }
@@ -56,8 +56,8 @@ scan_file(POP *p, MsgInfoList *mp)
if(f == NULL) { if(f == NULL) {
#ifdef DEBUG #ifdef DEBUG
if(p->debug) if(p->debug)
pop_log(p, POP_DEBUG, pop_log(p, POP_DEBUG,
"Failed to open message file `%s': %s", "Failed to open message file `%s': %s",
path, strerror(errno)); path, strerror(errno));
#endif #endif
return pop_msg (p, POP_FAILURE, return pop_msg (p, POP_FAILURE,
@@ -128,7 +128,7 @@ int
pop_maildir_info(POP *p) pop_maildir_info(POP *p)
{ {
int e; int e;
p->temp_drop[0] = '\0'; p->temp_drop[0] = '\0';
p->mlp = NULL; p->mlp = NULL;
p->msg_count = 0; p->msg_count = 0;
@@ -147,7 +147,7 @@ pop_maildir_update(POP *p)
int i; int i;
char tmp1[MAXPATHLEN], tmp2[MAXPATHLEN]; char tmp1[MAXPATHLEN], tmp2[MAXPATHLEN];
for(i = 0; i < p->msg_count; i++) { for(i = 0; i < p->msg_count; i++) {
make_path(p, &p->mlp[i], p->mlp[i].flags & NEW_FLAG, make_path(p, &p->mlp[i], p->mlp[i].flags & NEW_FLAG,
tmp1, sizeof(tmp1)); tmp1, sizeof(tmp1));
if(p->mlp[i].flags & DEL_FLAG) { if(p->mlp[i].flags & DEL_FLAG) {
#ifdef DEBUG #ifdef DEBUG
@@ -157,12 +157,12 @@ pop_maildir_update(POP *p)
if(unlink(tmp1) < 0) { if(unlink(tmp1) < 0) {
#ifdef DEBUG #ifdef DEBUG
if(p->debug) if(p->debug)
pop_log(p, POP_DEBUG, "Failed to remove `%s': %s", pop_log(p, POP_DEBUG, "Failed to remove `%s': %s",
tmp1, strerror(errno)); tmp1, strerror(errno));
#endif #endif
/* return failure? */ /* return failure? */
} }
} else if((p->mlp[i].flags & NEW_FLAG) && } else if((p->mlp[i].flags & NEW_FLAG) &&
(p->mlp[i].flags & RETR_FLAG)) { (p->mlp[i].flags & RETR_FLAG)) {
make_path(p, &p->mlp[i], 0, tmp2, sizeof(tmp2)); make_path(p, &p->mlp[i], 0, tmp2, sizeof(tmp2));
#ifdef DEBUG #ifdef DEBUG
@@ -185,13 +185,13 @@ pop_maildir_update(POP *p)
if(errno == EXDEV) { if(errno == EXDEV) {
#ifdef DEBUG #ifdef DEBUG
if(p->debug) if(p->debug)
pop_log(p, POP_DEBUG, "Trying to rename `%s' to `%s'", pop_log(p, POP_DEBUG, "Trying to rename `%s' to `%s'",
tmp1, tmp2); tmp1, tmp2);
#endif #endif
if(rename(tmp1, tmp2) < 0) { if(rename(tmp1, tmp2) < 0) {
#ifdef DEBUG #ifdef DEBUG
if(p->debug) if(p->debug)
pop_log(p, POP_DEBUG, "Failed to rename `%s' to `%s'", pop_log(p, POP_DEBUG, "Failed to rename `%s' to `%s'",
tmp1, tmp2); tmp1, tmp2);
#endif #endif
} }

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 2004 Kungliga Tekniska Högskolan * Copyright (c) 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 * 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.
*/ */
#include <popper.h> #include <popper.h>
@@ -37,7 +37,7 @@
#include <pop_auth.h> #include <pop_auth.h>
RCSID("$Id$"); RCSID("$Id$");
/* /*
* auth: RFC1734 * auth: RFC1734
*/ */
@@ -57,7 +57,7 @@ getline(POP *p)
p--; p--;
*p = '\0'; *p = '\0';
return buf; return buf;
} }
/* just assume we ran out of buffer space, we'll catch eof /* just assume we ran out of buffer space, we'll catch eof
next round */ next round */
size += 1024; size += 1024;
@@ -146,7 +146,7 @@ auth_loop(POP *p, struct auth_mech *m)
status = auth_execute(p, m, state, line); status = auth_execute(p, m, state, line);
free(line); free(line);
} }
(*m->cleanup)(p, state); (*m->cleanup)(p, state);
if(status == POP_AUTH_FAILURE) if(status == POP_AUTH_FAILURE)
@@ -177,7 +177,7 @@ pop_capa_sasl(POP *p)
if(methods[0] == NULL) if(methods[0] == NULL)
return; return;
fprintf(p->output, "SASL"); fprintf(p->output, "SASL");
for (i = 0; methods[i] != NULL; ++i) for (i = 0; methods[i] != NULL; ++i)
fprintf(p->output, " %s", methods[i]->name); fprintf(p->output, " %s", methods[i]->name);

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 2004 Kungliga Tekniska Högskolan * Copyright (c) 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 * 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$ */

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan * Copyright (c) 1995 - 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 * 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
@@ -70,7 +70,7 @@ get_socket (const char *hostname, int port)
struct addrinfo *ai, *a; struct addrinfo *ai, *a;
struct addrinfo hints; struct addrinfo hints;
char portstr[NI_MAXSERV]; char portstr[NI_MAXSERV];
memset (&hints, 0, sizeof(hints)); memset (&hints, 0, sizeof(hints));
hints.ai_socktype = SOCK_STREAM; hints.ai_socktype = SOCK_STREAM;
snprintf (portstr, sizeof(portstr), "%d", ntohs(port)); snprintf (portstr, sizeof(portstr), "%d", ntohs(port));
@@ -107,7 +107,7 @@ doit_v4 (char *host, int port)
ret = krb_sendauth(0, ret = krb_sendauth(0,
s, s,
&ticket, &ticket,
"pop", "pop",
host, host,
krb_realmofhost(host), krb_realmofhost(host),
@@ -140,7 +140,7 @@ doit_v5 (char *host, int port)
ret = krb5_init_context (&context); ret = krb5_init_context (&context);
if (ret) if (ret)
errx (1, "krb5_init_context failed: %d", ret); errx (1, "krb5_init_context failed: %d", ret);
ret = krb5_sname_to_principal (context, ret = krb5_sname_to_principal (context,
host, host,
"pop", "pop",
@@ -268,7 +268,7 @@ main(int argc, char **argv)
use_v4 = 0; use_v4 = 0;
if(use_v5 == -1 && use_v4 == 1) if(use_v5 == -1 && use_v4 == 1)
use_v5 = 0; use_v5 = 0;
#endif #endif
#ifdef KRB5 #ifdef KRB5
if (ret && use_v5) { if (ret && use_v5) {

View File

@@ -7,7 +7,7 @@
#include <popper.h> #include <popper.h>
RCSID("$Id$"); RCSID("$Id$");
/* /*
* dele: Delete a message from the POP maildrop * dele: Delete a message from the POP maildrop
*/ */
int int
@@ -45,7 +45,7 @@ pop_dele (POP *p)
p->msgs_deleted++; p->msgs_deleted++;
p->bytes_deleted += mp->length; p->bytes_deleted += mp->length;
/* Update the last-message-accessed number if it is lower than /* Update the last-message-accessed number if it is lower than
the deleted message */ the deleted message */
if (p->last_msg < msg_num) p->last_msg = msg_num; if (p->last_msg < msg_num) p->last_msg = msg_num;
@@ -96,12 +96,12 @@ pop_xdele(POP *p)
p->bytes_deleted += mp->length; p->bytes_deleted += mp->length;
} }
/* Update the last-message-accessed number if it is lower than /* Update the last-message-accessed number if it is lower than
the deleted message */ the deleted message */
if (p->last_msg < msg_max) p->last_msg = msg_max; if (p->last_msg < msg_max) p->last_msg = msg_max;
return (pop_msg (p,POP_SUCCESS,"Messages %d-%d has been deleted.", return (pop_msg (p,POP_SUCCESS,"Messages %d-%d has been deleted.",
msg_min, msg_max)); msg_min, msg_max));
} }
#endif /* XDELE */ #endif /* XDELE */

View File

@@ -39,17 +39,17 @@ changeuser(POP *p, struct passwd *pwd)
return POP_SUCCESS; return POP_SUCCESS;
} }
/* /*
* dropcopy: Make a temporary copy of the user's mail drop and * dropcopy: Make a temporary copy of the user's mail drop and
* save a stream pointer for it. * save a stream pointer for it.
*/ */
int int
pop_dropcopy(POP *p, struct passwd *pwp) pop_dropcopy(POP *p, struct passwd *pwp)
{ {
int mfd; /* File descriptor for int mfd; /* File descriptor for
the user's maildrop */ the user's maildrop */
int dfd; /* File descriptor for int dfd; /* File descriptor for
the SERVER maildrop */ the SERVER maildrop */
FILE *tf; /* The temp file */ FILE *tf; /* The temp file */
char template[POP_TMPSIZE]; /* Temp name holder */ char template[POP_TMPSIZE]; /* Temp name holder */
@@ -110,11 +110,11 @@ pop_dropcopy(POP *p, struct passwd *pwp)
} }
/* Lock the temporary maildrop */ /* Lock the temporary maildrop */
if ( flock (dfd, (LOCK_EX | LOCK_NB)) == -1 ) if ( flock (dfd, (LOCK_EX | LOCK_NB)) == -1 )
switch(errno) { switch(errno) {
case EWOULDBLOCK: case EWOULDBLOCK:
return pop_msg(p,POP_FAILURE, return pop_msg(p,POP_FAILURE,
"%sMaildrop lock busy! Is another session active?", "%sMaildrop lock busy! Is another session active?",
(p->flags & POP_FLAG_CAPA) ? "[IN-USE] " : ""); (p->flags & POP_FLAG_CAPA) ? "[IN-USE] " : "");
/* NOTREACHED */ /* NOTREACHED */
default: default:
@@ -122,7 +122,7 @@ pop_dropcopy(POP *p, struct passwd *pwp)
strerror(errno)); strerror(errno));
/* NOTREACHED */ /* NOTREACHED */
} }
/* May have grown or shrunk between open and lock! */ /* May have grown or shrunk between open and lock! */
offset = lseek(dfd,0, SEEK_END); offset = lseek(dfd,0, SEEK_END);
@@ -145,7 +145,7 @@ pop_dropcopy(POP *p, struct passwd *pwp)
if ( nchar != 0 ) { if ( nchar != 0 ) {
/* Error adding new mail. Truncate to original size, /* Error adding new mail. Truncate to original size,
and leave the maildrop as is. The user will not and leave the maildrop as is. The user will not
see the new mail until the error goes away. see the new mail until the error goes away.
Should let them process the current backlog, in case Should let them process the current backlog, in case
the error is a quota problem requiring deletions! */ the error is a quota problem requiring deletions! */

View File

@@ -55,10 +55,10 @@ parse_header(MsgInfoList *mp, char *buffer)
if (strncasecmp("Message-Id:",buffer, 11) == 0) { if (strncasecmp("Message-Id:",buffer, 11) == 0) {
if (mp->msg_id == NULL) if (mp->msg_id == NULL)
mp->msg_id = find_value_after_colon(buffer); mp->msg_id = find_value_after_colon(buffer);
} }
#ifdef UIDL #ifdef UIDL
else if (strncasecmp(buffer, "X-UIDL:", 7) == 0) { else if (strncasecmp(buffer, "X-UIDL:", 7) == 0) {
/* Courtesy to Qualcomm, there really is no such /* Courtesy to Qualcomm, there really is no such
thing as X-UIDL */ thing as X-UIDL */
mp->msg_id = find_value_after_colon(buffer); mp->msg_id = find_value_after_colon(buffer);
} }
@@ -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>";
@@ -117,8 +117,8 @@ add_missing_headers(POP *p, MsgInfoList *mp)
return POP_SUCCESS; return POP_SUCCESS;
} }
/* /*
* dropinfo: Extract information about the POP maildrop and store * dropinfo: Extract information about the POP maildrop and store
* it for use by the other POP routines. * it for use by the other POP routines.
*/ */
@@ -126,14 +126,14 @@ int
pop_dropinfo(POP *p) pop_dropinfo(POP *p)
{ {
char buffer[BUFSIZ]; /* Read buffer */ char buffer[BUFSIZ]; /* Read buffer */
MsgInfoList * mp; /* Pointer to message MsgInfoList * mp; /* Pointer to message
info list */ info list */
int msg_num; /* Current message int msg_num; /* Current message
counter */ counter */
int nchar; /* Bytes written/read */ int nchar; /* Bytes written/read */
int blank_line = 1; /* previous line was blank */ int blank_line = 1; /* previous line was blank */
int in_header = 0; /* if we are in a header block */ int in_header = 0; /* if we are in a header block */
/* Initialize maildrop status variables in the POP parameter block */ /* Initialize maildrop status variables in the POP parameter block */
p->msg_count = 0; p->msg_count = 0;
p->msgs_deleted = 0; p->msgs_deleted = 0;
@@ -153,7 +153,7 @@ pop_dropinfo(POP *p)
rewind (p->drop); rewind (p->drop);
/* Scan the file, loading the message information list with /* Scan the file, loading the message information list with
information about each message */ information about each message */
for (msg_num = p->drop_size = 0, mp = p->mlp - 1; for (msg_num = p->drop_size = 0, mp = p->mlp - 1;

View File

@@ -7,7 +7,7 @@
#include <popper.h> #include <popper.h>
RCSID("$Id$"); RCSID("$Id$");
/* /*
* get_command: Extract the command from an input line form a POP client * get_command: Extract the command from an input line form a POP client
*/ */
@@ -133,7 +133,7 @@ pop_get_command(POP *p, char *mp)
return NULL; return NULL;
} }
/* Return a pointer to the entry for this command in /* Return a pointer to the entry for this command in
the command/state table */ the command/state table */
return (s); return (s);
} }

View File

@@ -34,12 +34,12 @@ pop_write_addr(POP *p, struct sockaddr *addr)
return; return;
t = time(NULL); t = time(NULL);
strftime(ts, sizeof(ts), "%Y%m%d%H%M%S", localtime(&t)); strftime(ts, sizeof(ts), "%Y%m%d%H%M%S", localtime(&t));
if(inet_ntop (addr->sa_family, socket_get_address(addr), if(inet_ntop (addr->sa_family, socket_get_address(addr),
as, sizeof(as)) == NULL) { as, sizeof(as)) == NULL) {
pop_log(p, POP_PRIORITY, "failed to print address"); pop_log(p, POP_PRIORITY, "failed to print address");
return; return;
} }
f = fopen(addr_log, "a"); f = fopen(addr_log, "a");
if(f == NULL) { if(f == NULL) {
pop_log(p, POP_PRIORITY, "failed to open address log (%s)", addr_log); pop_log(p, POP_PRIORITY, "failed to open address log (%s)", addr_log);
@@ -55,10 +55,10 @@ krb4_authenticate (POP *p, int s, u_char *buf, struct sockaddr *addr)
{ {
Key_schedule schedule; Key_schedule schedule;
KTEXT_ST ticket; KTEXT_ST ticket;
char instance[INST_SZ]; char instance[INST_SZ];
char version[9]; char version[9];
int auth; int auth;
if (memcmp (buf, KRB_SENDAUTH_VERS, 4) != 0) if (memcmp (buf, KRB_SENDAUTH_VERS, 4) != 0)
return -1; return -1;
if (pop_net_read (p, s, buf + 4, if (pop_net_read (p, s, buf + 4,
@@ -79,18 +79,18 @@ krb4_authenticate (POP *p, int s, u_char *buf, struct sockaddr *addr)
"", "",
schedule, schedule,
version); version);
if (auth != KSUCCESS) { if (auth != KSUCCESS) {
pop_msg(p, POP_FAILURE, "Kerberos authentication failure: %s", pop_msg(p, POP_FAILURE, "Kerberos authentication failure: %s",
krb_get_err_text(auth)); krb_get_err_text(auth));
pop_log(p, POP_PRIORITY, "%s: (%s.%s@%s) %s", p->client, pop_log(p, POP_PRIORITY, "%s: (%s.%s@%s) %s", p->client,
p->kdata.pname, p->kdata.pinst, p->kdata.prealm, p->kdata.pname, p->kdata.pinst, p->kdata.prealm,
krb_get_err_text(auth)); krb_get_err_text(auth));
return -1; return -1;
} }
#ifdef DEBUG #ifdef DEBUG
pop_log(p, POP_DEBUG, "%s.%s@%s (%s): ok", p->kdata.pname, pop_log(p, POP_DEBUG, "%s.%s@%s (%s): ok", p->kdata.pname,
p->kdata.pinst, p->kdata.prealm, p->ipaddr); p->kdata.pinst, p->kdata.prealm, p->ipaddr);
#endif /* DEBUG */ #endif /* DEBUG */
return 0; return 0;
@@ -134,7 +134,7 @@ krb5_authenticate (POP *p, int s, u_char *buf, struct sockaddr *addr)
ret = krb5_unparse_name(p->context, ticket->server, &server); ret = krb5_unparse_name(p->context, ticket->server, &server);
if(ret) { if(ret) {
pop_log(p, POP_PRIORITY, "krb5_unparse_name: %s", pop_log(p, POP_PRIORITY, "krb5_unparse_name: %s",
krb5_get_err_text(p->context, ret)); krb5_get_err_text(p->context, ret));
ret = -1; ret = -1;
goto out; goto out;
@@ -146,7 +146,7 @@ krb5_authenticate (POP *p, int s, u_char *buf, struct sockaddr *addr)
ret = -1; ret = -1;
goto out; goto out;
} else if(p->debug) } else if(p->debug)
pop_log(p, POP_DEBUG, pop_log(p, POP_DEBUG,
"Accepted ticket for service `%s'", server); "Accepted ticket for service `%s'", server);
free(server); free(server);
out: out:
@@ -210,7 +210,7 @@ static struct getargs args[] = {
#if defined(KRB4) || defined(KRB5) #if defined(KRB4) || defined(KRB5)
{ "kerberos", 'k', arg_flag, &kerberos_flag, "use kerberos" }, { "kerberos", 'k', arg_flag, &kerberos_flag, "use kerberos" },
#endif #endif
{ "auth-mode", 'a', arg_string, &auth_str, "required authentication", { "auth-mode", 'a', arg_string, &auth_str, "required authentication",
"plaintext" "plaintext"
#ifdef OTP #ifdef OTP
"|otp" "|otp"
@@ -231,12 +231,12 @@ static struct getargs args[] = {
static int num_args = sizeof(args) / sizeof(args[0]); static int num_args = sizeof(args) / sizeof(args[0]);
/* /*
* init: Start a Post Office Protocol session * init: Start a Post Office Protocol session
*/ */
static int static int
pop_getportbyname(POP *p, const char *service, pop_getportbyname(POP *p, const char *service,
const char *proto, short def) const char *proto, short def)
{ {
#ifdef KRB5 #ifdef KRB5
@@ -310,7 +310,7 @@ pop_init(POP *p,int argcount,char **argmessage)
} }
if(auth_str){ if(auth_str){
if (strcasecmp (auth_str, "plaintext") == 0 || if (strcasecmp (auth_str, "plaintext") == 0 ||
strcasecmp (auth_str, "none") == 0) strcasecmp (auth_str, "none") == 0)
p->auth_level = AUTH_NONE; p->auth_level = AUTH_NONE;
else if(strcasecmp(auth_str, "otp") == 0) { else if(strcasecmp(auth_str, "otp") == 0) {
@@ -354,7 +354,7 @@ pop_init(POP *p,int argcount,char **argmessage)
if(timeout) if(timeout)
pop_timeout = timeout; pop_timeout = timeout;
/* Fake inetd */ /* Fake inetd */
if (interactive_flag) { if (interactive_flag) {
if (portnum == 0) if (portnum == 0)
@@ -372,7 +372,7 @@ pop_init(POP *p,int argcount,char **argmessage)
exit (1); exit (1);
} }
/* Save the dotted decimal form of the client's IP address /* Save the dotted decimal form of the client's IP address
in the POP parameter block */ in the POP parameter block */
inet_ntop (cs->sa_family, socket_get_address (cs), inet_ntop (cs->sa_family, socket_get_address (cs),
p->ipaddr, sizeof(p->ipaddr)); p->ipaddr, sizeof(p->ipaddr));

View File

@@ -7,7 +7,7 @@
#include <popper.h> #include <popper.h>
RCSID("$Id$"); RCSID("$Id$");
/* /*
* last: Display the last message touched in a POP session * last: Display the last message touched in a POP session
*/ */

View File

@@ -7,7 +7,7 @@
#include <popper.h> #include <popper.h>
RCSID("$Id$"); RCSID("$Id$");
/* /*
* list: List the contents of a POP maildrop * list: List the contents of a POP maildrop
*/ */
@@ -38,7 +38,7 @@ pop_list (POP *p)
/* Display message information */ /* Display message information */
return (pop_msg(p,POP_SUCCESS,"%d %ld",msg_num,mp->length)); return (pop_msg(p,POP_SUCCESS,"%d %ld",msg_num,mp->length));
} }
/* Display the entire list of messages */ /* Display the entire list of messages */
pop_msg(p,POP_SUCCESS, pop_msg(p,POP_SUCCESS,
"%d messages (%ld octets)", "%d messages (%ld octets)",
@@ -47,7 +47,7 @@ pop_list (POP *p)
/* Loop through the message information list. Skip deleted messages */ /* Loop through the message information list. Skip deleted messages */
for (i = p->msg_count, mp = p->mlp; i > 0; i--, mp++) { for (i = p->msg_count, mp = p->mlp; i > 0; i--, mp++) {
if (!(mp->flags & DEL_FLAG)) if (!(mp->flags & DEL_FLAG))
fprintf(p->output,"%u %lu\r\n",mp->number,mp->length); fprintf(p->output,"%u %lu\r\n",mp->number,mp->length);
} }

View File

@@ -7,7 +7,7 @@
#include <popper.h> #include <popper.h>
RCSID("$Id$"); RCSID("$Id$");
/* /*
* log: Make a log entry * log: Make a log entry
*/ */

View File

@@ -7,7 +7,7 @@
#include <popper.h> #include <popper.h>
RCSID("$Id$"); RCSID("$Id$");
/* /*
* msg: Send a formatted line to the POP client * msg: Send a formatted line to the POP client
*/ */
@@ -19,7 +19,7 @@ pop_msg(POP *p, int stat, char *format, ...)
va_list ap; va_list ap;
va_start(ap, format); va_start(ap, format);
/* Point to the message buffer */ /* Point to the message buffer */
mp = message; mp = message;
@@ -31,10 +31,10 @@ pop_msg(POP *p, int stat, char *format, ...)
mp += strlen(mp); mp += strlen(mp);
/* Append the message (formatted, if necessary) */ /* Append the message (formatted, if necessary) */
if (format) if (format)
vsnprintf (mp, sizeof(message) - strlen(message), vsnprintf (mp, sizeof(message) - strlen(message),
format, ap); format, ap);
/* Log the message if debugging is turned on */ /* Log the message if debugging is turned on */
#ifdef DEBUG #ifdef DEBUG
if (p->debug && stat == POP_SUCCESS) if (p->debug && stat == POP_SUCCESS)
@@ -42,12 +42,12 @@ pop_msg(POP *p, int stat, char *format, ...)
#endif /* DEBUG */ #endif /* DEBUG */
/* Log the message if a failure occurred */ /* Log the message if a failure occurred */
if (stat != POP_SUCCESS) if (stat != POP_SUCCESS)
pop_log(p,POP_PRIORITY,"%s",message); pop_log(p,POP_PRIORITY,"%s",message);
/* Append the <CR><LF> */ /* Append the <CR><LF> */
strlcat(message, "\r\n", sizeof(message)); strlcat(message, "\r\n", sizeof(message));
/* Send the message to the client */ /* Send the message to the client */
fputs(message, p->output); fputs(message, p->output);
fflush(p->output); fflush(p->output);

View File

@@ -7,8 +7,8 @@
#include <popper.h> #include <popper.h>
RCSID("$Id$"); RCSID("$Id$");
/* /*
* parse: Parse a raw input line from a POP client * parse: Parse a raw input line from a POP client
* into null-delimited tokens * into null-delimited tokens
*/ */
@@ -17,10 +17,10 @@ pop_parse(POP *p, char *buf)
{ {
char * mp; char * mp;
int i; int i;
/* Loop through the POP command array */ /* Loop through the POP command array */
for (mp = buf, i = 0; ; i++) { for (mp = buf, i = 0; ; i++) {
/* Skip leading spaces and tabs in the message */ /* Skip leading spaces and tabs in the message */
while (isspace((unsigned char)*mp))mp++; while (isspace((unsigned char)*mp))mp++;
@@ -51,5 +51,5 @@ pop_parse(POP *p, char *buf)
/* Return the number of tokens extracted minus the command itself */ /* Return the number of tokens extracted minus the command itself */
return (i-1); return (i-1);
} }

View File

@@ -59,7 +59,7 @@ krb5_verify_password (POP *p)
1); 1);
krb5_verify_init_creds_opt_init (&verify_options); krb5_verify_init_creds_opt_init (&verify_options);
ret = krb5_parse_name (p->context, p->user, &client); ret = krb5_parse_name (p->context, p->user, &client);
if (ret) { if (ret) {
pop_log(p, POP_PRIORITY, "krb5_parse_name: %s", pop_log(p, POP_PRIORITY, "krb5_parse_name: %s",
@@ -108,7 +108,7 @@ krb5_verify_password (POP *p)
return ret; return ret;
} }
#endif #endif
/* /*
* pass: Obtain the user password from a POP client * pass: Obtain the user password from a POP client
*/ */
@@ -126,7 +126,7 @@ login_user(POP *p)
} }
pop_log(p, POP_INFO, "login from %s as %s", p->ipaddr, p->user); pop_log(p, POP_INFO, "login from %s as %s", p->ipaddr, p->user);
/* Build the name of the user's maildrop */ /* Build the name of the user's maildrop */
snprintf(p->drop_name, sizeof(p->drop_name), "%s/%s", POP_MAILDIR, p->user); snprintf(p->drop_name, sizeof(p->drop_name), "%s/%s", POP_MAILDIR, p->user);
if(stat(p->drop_name, &st) < 0 || !S_ISDIR(st.st_mode)){ if(stat(p->drop_name, &st) < 0 || !S_ISDIR(st.st_mode)){
@@ -153,7 +153,7 @@ pop_pass (POP *p)
int status; int status;
/* Make one string of all these parameters */ /* Make one string of all these parameters */
for (i = 1; i < p->parm_count; ++i) for (i = 1; i < p->parm_count; ++i)
p->pop_parm[i][strlen(p->pop_parm[i])] = ' '; p->pop_parm[i][strlen(p->pop_parm[i])] = ' ';
@@ -183,7 +183,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

@@ -7,7 +7,7 @@
#include <popper.h> #include <popper.h>
RCSID("$Id$"); RCSID("$Id$");
/* /*
* quit: Terminate a POP session * quit: Terminate a POP session
*/ */

View File

@@ -7,7 +7,7 @@
#include <popper.h> #include <popper.h>
RCSID("$Id$"); RCSID("$Id$");
/* /*
* rset: Unflag all messages flagged for deletion in a POP maildrop * rset: Unflag all messages flagged for deletion in a POP maildrop
*/ */
@@ -20,11 +20,11 @@ pop_rset (POP *p)
/* Unmark all the messages */ /* Unmark all the messages */
for (i = p->msg_count, mp = p->mlp; i > 0; i--, mp++) for (i = p->msg_count, mp = p->mlp; i > 0; i--, mp++)
mp->flags &= ~DEL_FLAG; mp->flags &= ~DEL_FLAG;
/* Reset the messages-deleted and bytes-deleted counters */ /* Reset the messages-deleted and bytes-deleted counters */
p->msgs_deleted = 0; p->msgs_deleted = 0;
p->bytes_deleted = 0; p->bytes_deleted = 0;
/* Reset the last-message-access flag */ /* Reset the last-message-access flag */
p->last_msg = 0; p->last_msg = 0;

View File

@@ -16,7 +16,7 @@ pop_sendline(POP *p, char *buffer)
char * bp; char * bp;
/* Byte stuff lines that begin with the termination octet */ /* Byte stuff lines that begin with the termination octet */
if (*buffer == POP_TERMINATE) if (*buffer == POP_TERMINATE)
fputc(POP_TERMINATE,p->output); fputc(POP_TERMINATE,p->output);
/* Look for a <NL> in the buffer */ /* Look for a <NL> in the buffer */
@@ -37,8 +37,8 @@ pop_sendline(POP *p, char *buffer)
return bp != NULL; return bp != NULL;
} }
/* /*
* send: Send the header and a specified number of lines * send: Send the header and a specified number of lines
* from a mail message to a POP client. * from a mail message to a POP client.
*/ */
@@ -83,7 +83,7 @@ pop_send(POP *p)
/* Flag the message as retreived */ /* Flag the message as retreived */
mp->flags |= RETR_FLAG; mp->flags |= RETR_FLAG;
} }
/* Display the number of bytes in the message */ /* Display the number of bytes in the message */
pop_msg(p, POP_SUCCESS, "%ld octets", mp->length); pop_msg(p, POP_SUCCESS, "%ld octets", mp->length);
@@ -138,8 +138,8 @@ pop_send(POP *p)
if (!return_path_sent || strncasecmp(buffer, "Return-Path:", 12) != 0) if (!return_path_sent || strncasecmp(buffer, "Return-Path:", 12) != 0)
#endif #endif
sent_nl = pop_sendline (p,buffer); sent_nl = pop_sendline (p,buffer);
/* A single newline (blank line) signals the /* A single newline (blank line) signals the
end of the header. sendline() converts this to a NULL, end of the header. sendline() converts this to a NULL,
so that's what we look for. */ so that's what we look for. */
if (*buffer == 0) break; if (*buffer == 0) break;
if (hangup) if (hangup)

View File

@@ -7,7 +7,7 @@
#include <popper.h> #include <popper.h>
RCSID("$Id$"); RCSID("$Id$");
/* /*
* stat: Display the status of a POP maildrop to its client * stat: Display the status of a POP maildrop to its client
*/ */

View File

@@ -2,22 +2,22 @@
* Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan * Copyright (c) 1995, 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 * 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
@@ -35,7 +35,7 @@
RCSID("$Id$"); RCSID("$Id$");
#ifdef UIDL #ifdef UIDL
/* /*
* uidl: Uidl the contents of a POP maildrop * uidl: Uidl the contents of a POP maildrop
*/ */
@@ -66,7 +66,7 @@ pop_uidl (POP *p)
/* Display message information */ /* Display message information */
return (pop_msg(p,POP_SUCCESS,"%u %s",msg_num,mp->msg_id)); return (pop_msg(p,POP_SUCCESS,"%u %s",msg_num,mp->msg_id));
} }
/* Display the entire list of messages */ /* Display the entire list of messages */
pop_msg(p,POP_SUCCESS, pop_msg(p,POP_SUCCESS,
"%d messages (%ld octets)", "%d messages (%ld octets)",
@@ -75,7 +75,7 @@ pop_uidl (POP *p)
/* Loop through the message information list. Skip deleted messages */ /* Loop through the message information list. Skip deleted messages */
for (i = p->msg_count, mp = p->mlp; i > 0; i--, mp++) { for (i = p->msg_count, mp = p->mlp; i > 0; i--, mp++) {
if (!(mp->flags & DEL_FLAG)) if (!(mp->flags & DEL_FLAG))
fprintf(p->output,"%u %s\r\n",mp->number,mp->msg_id); fprintf(p->output,"%u %s\r\n",mp->number,mp->msg_id);
} }

View File

@@ -10,24 +10,24 @@ RCSID("$Id$");
static char standard_error[] = static char standard_error[] =
"Error error updating primary drop. Mailbox unchanged"; "Error error updating primary drop. Mailbox unchanged";
/* /*
* updt: Apply changes to a user's POP maildrop * updt: Apply changes to a user's POP maildrop
*/ */
int int
pop_updt (POP *p) pop_updt (POP *p)
{ {
FILE * md; /* Stream pointer for FILE * md; /* Stream pointer for
the user's maildrop */ the user's maildrop */
int mfd; /* File descriptor for int mfd; /* File descriptor for
above */ above */
char buffer[BUFSIZ]; /* Read buffer */ char buffer[BUFSIZ]; /* Read buffer */
MsgInfoList * mp; /* Pointer to message MsgInfoList * mp; /* Pointer to message
info list */ info list */
int msg_num; /* Current message int msg_num; /* Current message
counter */ counter */
int status_written; /* Status header field int status_written; /* Status header field
written */ written */
int nchar; /* Bytes read/written */ int nchar; /* Bytes read/written */
@@ -54,7 +54,7 @@ pop_updt (POP *p)
} }
#ifdef DEBUG #ifdef DEBUG
if (p->debug) if (p->debug)
pop_log(p,POP_DEBUG,"Opening mail drop \"%s\"",p->drop_name); pop_log(p,POP_DEBUG,"Opening mail drop \"%s\"",p->drop_name);
#endif /* DEBUG */ #endif /* DEBUG */
@@ -72,9 +72,9 @@ pop_updt (POP *p)
} }
/* Go to the right places */ /* Go to the right places */
offset = lseek((int)fileno(p->drop),0,SEEK_END) ; offset = lseek((int)fileno(p->drop),0,SEEK_END) ;
/* Append any messages that may have arrived during the session /* Append any messages that may have arrived during the session
to the temporary maildrop */ to the temporary maildrop */
while ((nchar=read(mfd,buffer,BUFSIZ)) > 0) while ((nchar=read(mfd,buffer,BUFSIZ)) > 0)
if ( nchar != write((int)fileno(p->drop),buffer,nchar) ) { if ( nchar != write((int)fileno(p->drop),buffer,nchar) ) {
@@ -96,10 +96,10 @@ pop_updt (POP *p)
rewind(p->drop); rewind(p->drop);
lseek((int)fileno(p->drop),0,SEEK_SET); lseek((int)fileno(p->drop),0,SEEK_SET);
/* Transfer messages not flagged for deletion from the temporary /* Transfer messages not flagged for deletion from the temporary
maildrop to the new maildrop */ maildrop to the new maildrop */
#ifdef DEBUG #ifdef DEBUG
if (p->debug) if (p->debug)
pop_log(p,POP_DEBUG,"Creating new maildrop \"%s\" from \"%s\"", pop_log(p,POP_DEBUG,"Creating new maildrop \"%s\" from \"%s\"",
p->drop_name,p->temp_drop); p->drop_name,p->temp_drop);
#endif /* DEBUG */ #endif /* DEBUG */
@@ -155,8 +155,8 @@ pop_updt (POP *p)
} }
/* Save another header line */ /* Save another header line */
fputs (buffer, md); fputs (buffer, md);
} }
else { /* Body */ else { /* Body */
if (blank_line && strncmp(buffer,"From ",5) == 0) break; if (blank_line && strncmp(buffer,"From ",5) == 0) break;
fputs (buffer, md); fputs (buffer, md);
blank_line = (*buffer == '\n'); blank_line = (*buffer == '\n');

View File

@@ -7,7 +7,7 @@
#include <popper.h> #include <popper.h>
RCSID("$Id$"); RCSID("$Id$");
/* /*
* user: Prompt for the user name at the start of a POP session * user: Prompt for the user name at the start of a POP session
*/ */

View File

@@ -12,15 +12,15 @@ pop_xover (POP *p)
"%d messages (%ld octets)", "%d messages (%ld octets)",
p->msg_count-p->msgs_deleted, p->msg_count-p->msgs_deleted,
p->drop_size-p->bytes_deleted); p->drop_size-p->bytes_deleted);
/* Loop through the message information list. Skip deleted messages */ /* Loop through the message information list. Skip deleted messages */
for (i = p->msg_count, mp = p->mlp; i > 0; i--, mp++) { for (i = p->msg_count, mp = p->mlp; i > 0; i--, mp++) {
if (!(mp->flags & DEL_FLAG)) if (!(mp->flags & DEL_FLAG))
fprintf(p->output,"%u\t%s\t%s\t%s\t%s\t%lu\t%u\r\n", fprintf(p->output,"%u\t%s\t%s\t%s\t%s\t%lu\t%u\r\n",
mp->number, mp->number,
mp->subject, mp->subject,
mp->from, mp->from,
mp->date, mp->date,
mp->msg_id, mp->msg_id,
mp->length, mp->length,
mp->lines); mp->lines);

View File

@@ -29,7 +29,7 @@ ring(int sig)
{ {
longjmp(env,1); longjmp(env,1);
} }
/* /*
* fgets, but with a timeout * fgets, but with a timeout
*/ */
@@ -37,7 +37,7 @@ static char *
tgets(char *str, int size, FILE *fp, int timeout) tgets(char *str, int size, FILE *fp, int timeout)
{ {
char *ret; char *ret;
signal(SIGALRM, ring); signal(SIGALRM, ring);
alarm(timeout); alarm(timeout);
if (setjmp(env)) { if (setjmp(env)) {
@@ -51,7 +51,7 @@ tgets(char *str, int size, FILE *fp, int timeout)
return ret; return ret;
} }
/* /*
* popper: Handle a Post Office Protocol version 3 session * popper: Handle a Post Office Protocol version 3 session
*/ */
int int
@@ -70,10 +70,10 @@ main (int argc, char **argv)
/* Tell the user that we are listenting */ /* Tell the user that we are listenting */
pop_msg(&p,POP_SUCCESS, "POP3 server ready"); pop_msg(&p,POP_SUCCESS, "POP3 server ready");
/* State loop. The POP server is always in a particular state in /* State loop. The POP server is always in a particular state in
which a specific suite of commands can be executed. The following which a specific suite of commands can be executed. The following
loop reads a line from the client, gets the command, and processes loop reads a line from the client, gets the command, and processes
it in the current context (if allowed) or rejects it. This continues it in the current context (if allowed) or rejects it. This continues
until the client quits or an error occurs. */ until the client quits or an error occurs. */
for (p.CurrentState=auth1;p.CurrentState!=halt&&p.CurrentState!=error;) { for (p.CurrentState=auth1;p.CurrentState!=halt&&p.CurrentState!=error;) {
@@ -94,7 +94,7 @@ main (int argc, char **argv)
/* Search for the command in the command/state table */ /* Search for the command in the command/state table */
if ((s = pop_get_command(&p,message)) == NULL) continue; if ((s = pop_get_command(&p,message)) == NULL) continue;
/* Call the function associated with this command in /* Call the function associated with this command in
the current state */ the current state */
if (s->function) p.CurrentState = s->result[(*s->function)(&p)]; if (s->function) p.CurrentState = s->result[(*s->function)(&p)];
@@ -103,7 +103,7 @@ main (int argc, char **argv)
p.CurrentState = s->success_state; p.CurrentState = s->success_state;
pop_msg(&p,POP_SUCCESS,"time passes"); pop_msg(&p,POP_SUCCESS,"time passes");
} }
} }
} }
/* Say goodbye to the client */ /* Say goodbye to the client */

View File

@@ -10,7 +10,7 @@
/* $Id$ */ /* $Id$ */
/* /*
* Header file for the POP programs * Header file for the POP programs
*/ */
@@ -178,20 +178,20 @@ extern int hangup;
#define AUTH_SASL 2 #define AUTH_SASL 2
#define pop_command pop_parm[0] /* POP command is first token */ #define pop_command pop_parm[0] /* POP command is first token */
#define pop_subcommand pop_parm[1] /* POP XTND subcommand is the #define pop_subcommand pop_parm[1] /* POP XTND subcommand is the
second token */ second token */
typedef enum { /* POP processing states */ typedef enum { /* POP processing states */
auth1, /* Authorization: waiting for auth1, /* Authorization: waiting for
USER command */ USER command */
auth2, /* Authorization: waiting for auth2, /* Authorization: waiting for
PASS command */ PASS command */
trans, /* Transaction */ trans, /* Transaction */
update, /* Update: session ended, update, /* Update: session ended,
process maildrop changes */ process maildrop changes */
halt, /* (Halt): stop processing halt, /* (Halt): stop processing
and exit */ and exit */
error /* (Error): something really error /* (Error): something really
bad happened */ bad happened */
} state; } state;
@@ -201,12 +201,12 @@ typedef enum { /* POP processing states */
#define NEW_FLAG 4 #define NEW_FLAG 4
typedef struct { /* Message information */ typedef struct { /* Message information */
int number; /* Message number relative to int number; /* Message number relative to
the beginning of list */ the beginning of list */
long length; /* Length of message in long length; /* Length of message in
bytes */ bytes */
int lines; /* Number of (null-terminated) lines in the message */ int lines; /* Number of (null-terminated) lines in the message */
long offset; /* Offset from beginning of long offset; /* Offset from beginning of
file */ file */
unsigned flags; unsigned flags;
@@ -225,40 +225,40 @@ typedef struct { /* Message information */
typedef struct { /* POP parameter block */ typedef struct { /* POP parameter block */
int debug; /* Debugging requested */ int debug; /* Debugging requested */
char * myname; /* The name of this POP char * myname; /* The name of this POP
daemon program */ daemon program */
char myhost[MaxHostNameLen]; /* The name of our host char myhost[MaxHostNameLen]; /* The name of our host
computer */ computer */
char client[MaxHostNameLen]; /* Canonical name of client char client[MaxHostNameLen]; /* Canonical name of client
computer */ computer */
char ipaddr[MaxHostNameLen]; /* Dotted-notation format of char ipaddr[MaxHostNameLen]; /* Dotted-notation format of
client IP address */ client IP address */
unsigned short ipport; /* Client port for privileged unsigned short ipport; /* Client port for privileged
operations */ operations */
char user[MAXUSERNAMELEN]; /* Name of the POP user */ char user[MAXUSERNAMELEN]; /* Name of the POP user */
state CurrentState; /* The current POP operational state */ state CurrentState; /* The current POP operational state */
MsgInfoList * mlp; /* Message information list */ MsgInfoList * mlp; /* Message information list */
int msg_count; /* Number of messages in int msg_count; /* Number of messages in
the maildrop */ the maildrop */
int msgs_deleted; /* Number of messages flagged int msgs_deleted; /* Number of messages flagged
for deletion */ for deletion */
int last_msg; /* Last message touched by int last_msg; /* Last message touched by
the user */ the user */
long bytes_deleted; /* Number of maildrop bytes long bytes_deleted; /* Number of maildrop bytes
flagged for deletion */ flagged for deletion */
char drop_name[MAXPATHLEN]; /* The name of the user's char drop_name[MAXPATHLEN]; /* The name of the user's
maildrop */ maildrop */
char temp_drop[MAXPATHLEN]; /* The name of the user's char temp_drop[MAXPATHLEN]; /* The name of the user's
temporary maildrop */ temporary maildrop */
long drop_size; /* Size of the maildrop in long drop_size; /* Size of the maildrop in
bytes */ bytes */
FILE * drop; /* (Temporary) mail drop */ FILE * drop; /* (Temporary) mail drop */
FILE * input; /* Input TCP/IP communication FILE * input; /* Input TCP/IP communication
stream */ stream */
FILE * output; /* Output TCP/IP communication stream */ FILE * output; /* Output TCP/IP communication stream */
FILE * trace; /* Debugging trace file */ FILE * trace; /* Debugging trace file */
char * pop_parm[MAXPARMCOUNT]; /* Parse POP parameter list */ char * pop_parm[MAXPARMCOUNT]; /* Parse POP parameter list */
int parm_count; /* Number of parameters in int parm_count; /* Number of parameters in
parsed list */ parsed list */
int kerberosp; /* Using KPOP? */ int kerberosp; /* Using KPOP? */
#ifdef KRB4 #ifdef KRB4
@@ -278,20 +278,20 @@ typedef struct { /* POP parameter block */
#define POP_FLAG_CAPA 1 #define POP_FLAG_CAPA 1
} POP; } POP;
typedef struct { /* State information for typedef struct { /* State information for
each POP command */ each POP command */
state ValidCurrentState; /* The operating state of state ValidCurrentState; /* The operating state of
the command */ the command */
char * command; /* The POP command */ char * command; /* The POP command */
int min_parms; /* Minimum number of parms int min_parms; /* Minimum number of parms
for the command */ for the command */
int max_parms; /* Maximum number of parms int max_parms; /* Maximum number of parms
for the command */ for the command */
int (*function) (); /* The function that process int (*function) (); /* The function that process
the command */ the command */
state result[2]; /* The resulting state after state result[2]; /* The resulting state after
command processing */ command processing */
#define success_state result[0] /* State when a command #define success_state result[0] /* State when a command
succeeds */ succeeds */
} state_table; } state_table;
@@ -301,7 +301,7 @@ typedef struct { /* Table of extensions */
the subcommand */ the subcommand */
int max_parms; /* Maximum number of parms for int max_parms; /* Maximum number of parms for
the subcommand */ the subcommand */
int (*function) (); /* The function that processes int (*function) (); /* The function that processes
the subcommand */ the subcommand */
} xtnd_table; } xtnd_table;

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 * 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.
*/ */
#include "push_locl.h" #include "push_locl.h"
@@ -57,7 +57,7 @@ struct getargs args[] = {
#ifdef KRB4 #ifdef KRB4
{ "krb4", '4', arg_flag, &use_v4, "Use Kerberos V4", { "krb4", '4', arg_flag, &use_v4, "Use Kerberos V4",
NULL }, NULL },
#endif #endif
#ifdef KRB5 #ifdef KRB5
{ "krb5", '5', arg_flag, &use_v5, "Use Kerberos V5", { "krb5", '5', arg_flag, &use_v5, "Use Kerberos V5",
NULL }, NULL },
@@ -134,12 +134,12 @@ do_connect (const char *hostname, int port, int nodelay)
return s; return s;
} }
typedef enum { INIT = 0, GREET, USER, PASS, STAT, RETR, TOP, typedef enum { INIT = 0, GREET, USER, PASS, STAT, RETR, TOP,
DELE, XDELE, QUIT} pop_state; DELE, XDELE, QUIT} pop_state;
static char *pop_state_string[] = { static char *pop_state_string[] = {
"INIT", "GREET", "USER", "PASS", "STAT", "RETR", "TOP", "INIT", "GREET", "USER", "PASS", "STAT", "RETR", "TOP",
"DELE", "XDELE", "QUIT" "DELE", "XDELE", "QUIT"
}; };
#define PUSH_BUFSIZ 65536 #define PUSH_BUFSIZ 65536
@@ -296,7 +296,7 @@ doit(int s,
if (verbose > 1) if (verbose > 1)
fprintf (stderr, "state: %s count: %d asked_for: %d " fprintf (stderr, "state: %s count: %d asked_for: %d "
"retrieved: %d asked_deleted: %d\n", "retrieved: %d asked_deleted: %d\n",
pop_state_string[state], pop_state_string[state],
count, asked_for, retrieved, asked_deleted); count, asked_for, retrieved, asked_deleted);
if (((state == STAT || state == RETR || state == TOP) if (((state == STAT || state == RETR || state == TOP)
@@ -316,7 +316,7 @@ doit(int s,
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);
@@ -329,11 +329,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
@@ -406,7 +406,7 @@ doit(int s,
++copy; ++copy;
} }
*p = '\n'; *p = '\n';
if(blank_line && if(blank_line &&
strncmp(copy, "From ", min(p - copy + 1, 5)) == 0) strncmp(copy, "From ", min(p - copy + 1, 5)) == 0)
write_state_add(&write_state, ">", 1); write_state_add(&write_state, ">", 1);
write_state_add(&write_state, copy, p - copy + 1); write_state_add(&write_state, copy, p - copy + 1);
@@ -419,7 +419,7 @@ doit(int s,
write_state_add(&write_state, write_state_add(&write_state,
from_line, from_line_length); from_line, from_line_length);
blank_line = 0; blank_line = 0;
if (do_from) if (do_from)
state = TOP; state = TOP;
else else
state = RETR; state = RETR;
@@ -588,7 +588,7 @@ do_v4 (const char *host,
return 1; return 1;
ret = krb_sendauth(0, ret = krb_sendauth(0,
s, s,
&ticket, &ticket,
"pop", "pop",
(char *)host, (char *)host,
krb_realmofhost(host), krb_realmofhost(host),
@@ -768,7 +768,7 @@ main(int argc, char **argv)
use_v4 = 0; use_v4 = 0;
if(use_v5 == -1 && use_v4 == 1) if(use_v5 == -1 && use_v4 == 1)
use_v5 = 0; use_v5 = 0;
#endif #endif
if (do_help) if (do_help)
usage (0); usage (0);

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 1997, 1998 Kungliga Tekniska Högskolan * Copyright (c) 1997, 1998 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$ */

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;
@@ -132,7 +132,7 @@ main(int argc, char **argv)
remin = remout = -1; remin = remout = -1;
/* Command to be executed on remote system using "rsh". */ /* Command to be executed on remote system using "rsh". */
snprintf(cmd, sizeof(cmd), snprintf(cmd, sizeof(cmd),
"rcp%s%s%s", iamrecursive ? " -r" : "", "rcp%s%s%s", iamrecursive ? " -r" : "",
pflag ? " -p" : "", targetshouldbedirectory ? " -d" : ""); pflag ? " -p" : "", targetshouldbedirectory ? " -d" : "");
signal(SIGPIPE, lostconn); signal(SIGPIPE, lostconn);
@@ -189,7 +189,7 @@ toremote(char *targ, int argc, char **argv)
continue; continue;
ret = asprintf(&bp, ret = asprintf(&bp,
"%s%s %s -l %s -n %s %s '%s%s%s:%s'", "%s%s %s -l %s -n %s %s '%s%s%s:%s'",
_PATH_RSH, eflag ? " -e" : "", _PATH_RSH, eflag ? " -e" : "",
host, suser, cmd, src, host, suser, cmd, src,
tuser ? tuser : "", tuser ? "@" : "", tuser ? tuser : "", tuser ? "@" : "",
thost, targ); thost, targ);
@@ -197,7 +197,7 @@ toremote(char *targ, int argc, char **argv)
host = unbracket(argv[i]); host = unbracket(argv[i]);
ret = asprintf(&bp, ret = asprintf(&bp,
"exec %s%s %s -n %s %s '%s%s%s:%s'", "exec %s%s %s -n %s %s '%s%s%s:%s'",
_PATH_RSH, eflag ? " -e" : "", _PATH_RSH, eflag ? " -e" : "",
host, cmd, src, host, cmd, src,
tuser ? tuser : "", tuser ? "@" : "", tuser ? tuser : "", tuser ? "@" : "",
thost, targ); thost, targ);
@@ -715,7 +715,7 @@ run_err(const char *fmt, ...)
* If it cannot create necessary pipes it exits with error message. * If it cannot create necessary pipes it exits with error message.
*/ */
int int
do_cmd(char *host, char *remuser, char *cmd, int *fdin, int *fdout) do_cmd(char *host, char *remuser, char *cmd, int *fdin, int *fdout)
{ {
int pin[2], pout[2], reserved[2]; int pin[2], pout[2], reserved[2];

View File

@@ -1,34 +1,34 @@
/* /*
* Copyright (c) 2001 Kungliga Tekniska Högskolan * Copyright (c) 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 * 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$ */

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