remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -2,22 +2,22 @@
|
||||
* Copyright (c) 1995-2000 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
|
@@ -2,22 +2,22 @@
|
||||
* Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
|
@@ -2,22 +2,22 @@
|
||||
* Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -61,7 +61,7 @@ set_buffer_size(int fd, int read)
|
||||
}
|
||||
#endif /* HAVE_GETSOCKOPT */
|
||||
|
||||
while(size >= 131072 &&
|
||||
while(size >= 131072 &&
|
||||
setsockopt(fd, SOL_SOCKET, optname, (void *)&size, sizeof(size)) < 0)
|
||||
size /= 2;
|
||||
#endif
|
||||
|
@@ -189,7 +189,7 @@ setpeer(int argc, char **argv)
|
||||
unix_proxy = 0;
|
||||
else
|
||||
unix_server = 0;
|
||||
if (overbose &&
|
||||
if (overbose &&
|
||||
!strncmp(reply_string, "215 TOPS20", 10))
|
||||
printf(
|
||||
"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;
|
||||
|
||||
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_mday > day) ||
|
||||
(tm->tm_mday == day &&
|
||||
(tm->tm_mday == day &&
|
||||
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_sec > sec))
|
||||
return (1);
|
||||
}
|
||||
@@ -868,7 +868,7 @@ status(int argc, char **argv)
|
||||
sec_status();
|
||||
printf("Mode: %s; Type: %s; Form: %s; Structure: %s\n",
|
||||
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(doglob));
|
||||
printf("Store unique: %s; Receive unique: %s\n", onoff(sunique),
|
||||
@@ -1171,7 +1171,7 @@ ls(int argc, char **argv)
|
||||
return;
|
||||
}
|
||||
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])) {
|
||||
code = -1;
|
||||
return;
|
||||
@@ -1237,7 +1237,7 @@ shell(int argc, char **argv)
|
||||
{
|
||||
pid_t pid;
|
||||
RETSIGTYPE (*old1)(int), (*old2)(int);
|
||||
char shellnam[40], *shellpath, *namep;
|
||||
char shellnam[40], *shellpath, *namep;
|
||||
int waitstatus;
|
||||
|
||||
old1 = signal (SIGINT, SIG_IGN);
|
||||
@@ -1833,7 +1833,7 @@ domap(char *name)
|
||||
break;
|
||||
case '[':
|
||||
LOOP:
|
||||
if (*++cp2 == '$' && isdigit((unsigned char)*(cp2+1))) {
|
||||
if (*++cp2 == '$' && isdigit((unsigned char)*(cp2+1))) {
|
||||
if (*++cp2 == '0') {
|
||||
char *cp3 = name;
|
||||
|
||||
@@ -1852,7 +1852,7 @@ LOOP:
|
||||
}
|
||||
}
|
||||
else {
|
||||
while (*cp2 && *cp2 != ',' &&
|
||||
while (*cp2 && *cp2 != ',' &&
|
||||
*cp2 != ']') {
|
||||
if (*cp2 == '\\') {
|
||||
cp2++;
|
||||
@@ -2137,7 +2137,7 @@ klist(int argc, char **argv)
|
||||
code = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
ret = command("SITE KLIST");
|
||||
code = (ret == COMPLETE);
|
||||
}
|
||||
|
@@ -98,7 +98,7 @@ hookup (const char *host, int port)
|
||||
addrstr, sizeof(addrstr),
|
||||
NULL, 0, NI_NUMERICHOST) != 0)
|
||||
strlcpy (addrstr, "unknown address", sizeof(addrstr));
|
||||
|
||||
|
||||
warn ("connect %s", addrstr);
|
||||
close (s);
|
||||
s = -1;
|
||||
@@ -202,16 +202,16 @@ login (char *host)
|
||||
}
|
||||
strlcpy(username, userstr, sizeof(username));
|
||||
n = command("USER %s", userstr);
|
||||
if (n == COMPLETE)
|
||||
if (n == COMPLETE)
|
||||
n = command("PASS dummy"); /* DK: Compatibility with gssftp daemon */
|
||||
else if(n == CONTINUE) {
|
||||
if (pass == NULL) {
|
||||
char prompt[128];
|
||||
if(myname &&
|
||||
if(myname &&
|
||||
(!strcmp(userstr, "ftp") || !strcmp(userstr, "anonymous"))) {
|
||||
snprintf(defaultpass, sizeof(defaultpass),
|
||||
snprintf(defaultpass, sizeof(defaultpass),
|
||||
"%s@%s", myname, mydomain);
|
||||
snprintf(prompt, sizeof(prompt),
|
||||
snprintf(prompt, sizeof(prompt),
|
||||
"Password (%s): ", defaultpass);
|
||||
} else if (sec_complete) {
|
||||
pass = myname;
|
||||
@@ -417,7 +417,7 @@ getreply (int expecteof)
|
||||
continue;
|
||||
default:
|
||||
if(p < buf + sizeof(buf) - 1)
|
||||
*p++ = c;
|
||||
*p++ = c;
|
||||
else if(long_warn == 0) {
|
||||
fprintf(stderr, "WARNING: incredibly long line received\n");
|
||||
long_warn = 1;
|
||||
@@ -1338,7 +1338,7 @@ noport:
|
||||
verbose = -1;
|
||||
|
||||
result = command ("EPRT |%d|%s|%d|",
|
||||
inet_af, addr_str,
|
||||
inet_af, addr_str,
|
||||
ntohs(socket_get_port (data_addr)));
|
||||
verbose = overbose;
|
||||
|
||||
@@ -1353,7 +1353,7 @@ noport:
|
||||
goto bad;
|
||||
}
|
||||
|
||||
result = command("PORT %d,%d,%d,%d,%d,%d",
|
||||
result = command("PORT %d,%d,%d,%d,%d,%d",
|
||||
(a >> 24) & 0xff,
|
||||
(a >> 16) & 0xff,
|
||||
(a >> 8) & 0xff,
|
||||
@@ -1392,7 +1392,7 @@ bad:
|
||||
int
|
||||
initconn (void)
|
||||
{
|
||||
if (passivemode)
|
||||
if (passivemode)
|
||||
return passive_mode ();
|
||||
else
|
||||
return active_mode ();
|
||||
|
@@ -2,22 +2,22 @@
|
||||
* Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
|
@@ -1,34 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 1998 - 2005 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifdef FTP_SERVER
|
||||
@@ -265,7 +265,7 @@ gss_adat(void *app_data, void *buf, size_t len)
|
||||
GSS_C_NO_OID,
|
||||
&msg_ctx,
|
||||
&status_string);
|
||||
syslog(LOG_ERR, "gss_accept_sec_context: %s",
|
||||
syslog(LOG_ERR, "gss_accept_sec_context: %s",
|
||||
(char*)status_string.value);
|
||||
gss_release_buffer(&new_stat, &status_string);
|
||||
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 msg_ctx = 0;
|
||||
gss_buffer_desc status_string;
|
||||
|
||||
|
||||
gss_display_status(&new_stat,
|
||||
min_stat,
|
||||
GSS_C_MECH_CODE,
|
||||
GSS_C_NO_OID,
|
||||
&msg_ctx,
|
||||
&status_string);
|
||||
printf("Error importing name %s: %s\n",
|
||||
printf("Error importing name %s: %s\n",
|
||||
(char *)name.value,
|
||||
(char *)status_string.value);
|
||||
free(name.value);
|
||||
@@ -345,7 +345,7 @@ import_name(const char *kname, const char *host, gss_name_t *target_name)
|
||||
static int
|
||||
gss_auth(void *app_data, char *host)
|
||||
{
|
||||
|
||||
|
||||
OM_uint32 maj_stat, min_stat;
|
||||
gss_name_t target_name;
|
||||
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;
|
||||
|
||||
const char *knames[] = { "ftp", "host", NULL }, **kname = knames;
|
||||
|
||||
|
||||
|
||||
|
||||
if(import_name(*kname++, host, &target_name))
|
||||
return AUTH_ERROR;
|
||||
|
||||
@@ -417,7 +417,7 @@ gss_auth(void *app_data, char *host)
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (bindings != GSS_C_NO_CHANNEL_BINDINGS)
|
||||
free(bindings);
|
||||
|
||||
@@ -427,7 +427,7 @@ gss_auth(void *app_data, char *host)
|
||||
GSS_C_NO_OID,
|
||||
&msg_ctx,
|
||||
&status_string);
|
||||
printf("Error initializing security context: %s\n",
|
||||
printf("Error initializing security context: %s\n",
|
||||
(char*)status_string.value);
|
||||
gss_release_buffer(&new_stat, &status_string);
|
||||
return AUTH_CONTINUE;
|
||||
@@ -507,7 +507,7 @@ gss_auth(void *app_data, char *host)
|
||||
gss_release_name(&min_stat, &targ_name);
|
||||
} else
|
||||
printf("Failed to get gss name of peer.\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return AUTH_OK;
|
||||
|
@@ -2,22 +2,22 @@
|
||||
* Copyright (c) 1995-1999 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -92,7 +92,7 @@ kauth(int argc, char **argv)
|
||||
}
|
||||
tkt.length = tmp;
|
||||
tktcopy.length = tkt.length;
|
||||
|
||||
|
||||
p = strstr(reply_string, "P=");
|
||||
if(!p){
|
||||
printf("Bad reply from server.\n");
|
||||
@@ -104,14 +104,14 @@ kauth(int argc, char **argv)
|
||||
name = p + 2;
|
||||
for(; *p && *p != ' ' && *p != '\r' && *p != '\n'; p++);
|
||||
*p = 0;
|
||||
|
||||
|
||||
snprintf(buf, sizeof(buf), "Password for %s:", name);
|
||||
if (des_read_pw_string (passwd, sizeof(passwd)-1, buf, 0))
|
||||
*passwd = '\0';
|
||||
des_string_to_key (passwd, &key);
|
||||
|
||||
des_key_sched(&key, schedule);
|
||||
|
||||
|
||||
des_pcbc_encrypt((des_cblock*)tkt.dat, (des_cblock*)tktcopy.dat,
|
||||
tkt.length,
|
||||
schedule, &key, DES_DECRYPT);
|
||||
|
@@ -2,22 +2,22 @@
|
||||
* Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -72,13 +72,13 @@ krb4_decode(void *app_data, void *buf, int len, int level)
|
||||
MSG_DAT m;
|
||||
int e;
|
||||
struct krb4_data *d = app_data;
|
||||
|
||||
|
||||
if(level == prot_safe)
|
||||
e = krb_rd_safe(buf, len, &d->key,
|
||||
(struct sockaddr_in *)REMOTE_ADDR,
|
||||
(struct sockaddr_in *)LOCAL_ADDR, &m);
|
||||
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 *)LOCAL_ADDR, &m);
|
||||
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;
|
||||
*to = malloc(length + 31);
|
||||
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 *)REMOTE_ADDR);
|
||||
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 *)REMOTE_ADDR);
|
||||
else
|
||||
@@ -132,11 +132,11 @@ krb4_adat(void *app_data, void *buf, size_t len)
|
||||
tkt.length = len;
|
||||
|
||||
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, "");
|
||||
if(kerror == RD_AP_UNDEC){
|
||||
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, "");
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
memcpy(d->key, auth_dat.session, sizeof(d->key));
|
||||
des_set_key(&d->key, d->schedule);
|
||||
|
||||
@@ -208,7 +208,7 @@ krb4_init(void *app_data)
|
||||
}
|
||||
|
||||
static int
|
||||
mk_auth(struct krb4_data *d, KTEXT adat,
|
||||
mk_auth(struct krb4_data *d, KTEXT adat,
|
||||
char *service, char *host, int checksum)
|
||||
{
|
||||
int ret;
|
||||
@@ -268,7 +268,7 @@ krb4_auth(void *app_data, char *host)
|
||||
printf("Using NAT IP address (%s) for kerberos 4\n",
|
||||
inet_ntoa(natAddr));
|
||||
localaddr->sin_addr = natAddr;
|
||||
|
||||
|
||||
/*
|
||||
* This not the best place to do this, but it
|
||||
* is here we know that (probably) NAT is in
|
||||
@@ -309,11 +309,11 @@ krb4_auth(void *app_data, char *host)
|
||||
return AUTH_ERROR;
|
||||
}
|
||||
adat.length = len;
|
||||
ret = krb_rd_safe(adat.dat, adat.length, &d->key,
|
||||
(struct sockaddr_in *)hisctladdr,
|
||||
ret = krb_rd_safe(adat.dat, adat.length, &d->key,
|
||||
(struct sockaddr_in *)hisctladdr,
|
||||
(struct sockaddr_in *)myctladdr, &msg_data);
|
||||
if(ret){
|
||||
printf("Error reading reply from server: %s.\n",
|
||||
printf("Error reading reply from server: %s.\n",
|
||||
krb_get_err_text(ret));
|
||||
return AUTH_ERROR;
|
||||
}
|
||||
|
@@ -142,7 +142,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
if (argc > 0) {
|
||||
char *xargv[5];
|
||||
|
||||
|
||||
if (setjmp(toplevel))
|
||||
exit(0);
|
||||
signal(SIGINT, intr);
|
||||
|
@@ -59,7 +59,7 @@ static struct toktab {
|
||||
{ "account", ACCOUNT },
|
||||
{ "machine", MACH },
|
||||
{ "macdef", MACDEF },
|
||||
{ "prot", PROT },
|
||||
{ "prot", PROT },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
@@ -137,7 +137,7 @@ next:
|
||||
continue;
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
if (strcasecmp(host, tokval) == 0)
|
||||
@@ -163,7 +163,7 @@ next:
|
||||
|
||||
case LOGIN:
|
||||
if (token()) {
|
||||
if (*aname == 0) {
|
||||
if (*aname == 0) {
|
||||
*aname = strdup(tokval);
|
||||
} else {
|
||||
if (strcmp(*aname, tokval))
|
||||
@@ -199,7 +199,7 @@ next:
|
||||
fclose(cfile);
|
||||
return (0);
|
||||
}
|
||||
while ((c=getc(cfile)) != EOF &&
|
||||
while ((c=getc(cfile)) != EOF &&
|
||||
(c == ' ' || c == '\t'));
|
||||
if (c == EOF || c == '\n') {
|
||||
printf("Missing macdef name argument.\n");
|
||||
|
@@ -2,22 +2,22 @@
|
||||
* Copyright (c) 1998-2002, 2005 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -74,7 +74,7 @@ level_to_name(enum protection_level level)
|
||||
}
|
||||
|
||||
#ifndef FTP_SERVER /* not used in server */
|
||||
static enum protection_level
|
||||
static enum protection_level
|
||||
name_to_level(const char *name)
|
||||
{
|
||||
int i;
|
||||
@@ -229,12 +229,12 @@ sec_read(int fd, void *dataptr, int length)
|
||||
in_buffer.eof_flag = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
len = buffer_read(&in_buffer, dataptr, length);
|
||||
length -= len;
|
||||
rx += len;
|
||||
dataptr = (char*)dataptr + len;
|
||||
|
||||
|
||||
while(length){
|
||||
int ret;
|
||||
|
||||
@@ -286,7 +286,7 @@ sec_write(int fd, char *dataptr, int length)
|
||||
{
|
||||
int len = buffer_size;
|
||||
int tx = 0;
|
||||
|
||||
|
||||
if(data_prot == prot_clear)
|
||||
return write(fd, dataptr, length);
|
||||
|
||||
@@ -337,7 +337,7 @@ sec_putc(int c, FILE *F)
|
||||
char ch = c;
|
||||
if(data_prot == prot_clear)
|
||||
return putc(c, F);
|
||||
|
||||
|
||||
buffer_write(&out_buffer, &ch, 1);
|
||||
if(c == '\n' || out_buffer.index >= 1024 /* XXX */) {
|
||||
sec_write(fileno(F), out_buffer.data, out_buffer.index);
|
||||
@@ -352,14 +352,14 @@ sec_read_msg(char *s, int level)
|
||||
int len;
|
||||
char *buf;
|
||||
int return_code;
|
||||
|
||||
|
||||
buf = malloc(strlen(s));
|
||||
len = base64_decode(s + 4, buf); /* XXX */
|
||||
|
||||
|
||||
len = (*mech->decode)(app_data, buf, len, level);
|
||||
if(len < 0)
|
||||
return -1;
|
||||
|
||||
|
||||
buf[len] = '\0';
|
||||
|
||||
if(buf[3] == '-')
|
||||
@@ -381,7 +381,7 @@ sec_vfprintf(FILE *f, const char *fmt, va_list ap)
|
||||
int len;
|
||||
if(!sec_complete)
|
||||
return vfprintf(f, fmt, ap);
|
||||
|
||||
|
||||
if (vasprintf(&buf, fmt, ap) == -1) {
|
||||
printf("Failed to allocate command.\n");
|
||||
return -1;
|
||||
@@ -520,10 +520,10 @@ prot(char *pl)
|
||||
reply(504, "Unrecognized protection level.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(sec_complete){
|
||||
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));
|
||||
}else{
|
||||
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 data channel.\n", level_to_name(data_prot));
|
||||
if(buffer_size > 0)
|
||||
printf("Protection buffer size: %lu.\n",
|
||||
printf("Protection buffer size: %lu.\n",
|
||||
(unsigned long)buffer_size);
|
||||
}else{
|
||||
printf("Not using any security mechanism.\n");
|
||||
@@ -669,7 +669,7 @@ sec_prot_internal(int level)
|
||||
printf("Failed to set protection level.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
data_prot = (enum protection_level)level;
|
||||
return 0;
|
||||
}
|
||||
@@ -708,17 +708,17 @@ sec_prot(int argc, char **argv)
|
||||
return;
|
||||
}
|
||||
level = name_to_level(argv[argc - 1]);
|
||||
|
||||
|
||||
if(level == -1)
|
||||
goto usage;
|
||||
|
||||
|
||||
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));
|
||||
code = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(argc == 2 || strncasecmp(argv[1], "data", strlen(argv[1])) == 0) {
|
||||
if(sec_prot_internal(level) < 0){
|
||||
code = -1;
|
||||
@@ -759,9 +759,9 @@ sec_prot_command(int argc, char **argv)
|
||||
level = name_to_level(argv[1]);
|
||||
if(level == -1)
|
||||
goto usage;
|
||||
|
||||
|
||||
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));
|
||||
code = -1;
|
||||
return;
|
||||
@@ -808,7 +808,7 @@ sec_login(char *host)
|
||||
|
||||
verbose = -1; /* shut up all messages this will produce (they
|
||||
are usually not very user friendly) */
|
||||
|
||||
|
||||
for(m = mechs; *m && (*m)->name; m++) {
|
||||
void *tmp;
|
||||
|
||||
@@ -818,7 +818,7 @@ sec_login(char *host)
|
||||
return -1;
|
||||
}
|
||||
app_data = tmp;
|
||||
|
||||
|
||||
if((*m)->init && (*(*m)->init)(app_data) != 0) {
|
||||
printf("Skipping %s...\n", (*m)->name);
|
||||
continue;
|
||||
@@ -852,13 +852,13 @@ sec_login(char *host)
|
||||
sec_complete = 1;
|
||||
if(doencrypt) {
|
||||
command_prot = prot_private;
|
||||
request_data_prot = prot_private;
|
||||
request_data_prot = prot_private;
|
||||
} else {
|
||||
command_prot = prot_safe;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
verbose = old_verbose;
|
||||
return *m == NULL;
|
||||
}
|
||||
|
@@ -1,34 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 1998 - 2005 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
@@ -36,11 +36,11 @@
|
||||
#ifndef __security_h__
|
||||
#define __security_h__
|
||||
|
||||
enum protection_level {
|
||||
prot_clear,
|
||||
prot_safe,
|
||||
prot_confidential,
|
||||
prot_private
|
||||
enum protection_level {
|
||||
prot_clear,
|
||||
prot_safe,
|
||||
prot_confidential,
|
||||
prot_private
|
||||
};
|
||||
|
||||
struct sec_client_mech {
|
||||
@@ -137,4 +137,4 @@ enum protection_level set_command_prot(enum protection_level);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __security_h__ */
|
||||
#endif /* __security_h__ */
|
||||
|
@@ -754,7 +754,7 @@ host_port
|
||||
|
||||
sin4->sin_family = AF_INET;
|
||||
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);
|
||||
}
|
||||
;
|
||||
|
@@ -190,7 +190,7 @@ parse_auth_level(char *str)
|
||||
else
|
||||
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" },
|
||||
{ "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" },
|
||||
#ifdef KRB5
|
||||
#ifdef KRB5
|
||||
{ "gss-bindings", 0, arg_flag, &ftp_do_gss_bindings, "Require GSS-API bindings", NULL},
|
||||
#endif
|
||||
{ "version", 0, arg_flag, &version_flag },
|
||||
@@ -297,7 +297,7 @@ main(int argc, char **argv)
|
||||
{
|
||||
char *p;
|
||||
long val = 0;
|
||||
|
||||
|
||||
if(guest_umask_string) {
|
||||
val = strtol(guest_umask_string, &p, 8);
|
||||
if (*p != '\0' || val < 0)
|
||||
@@ -328,7 +328,7 @@ main(int argc, char **argv)
|
||||
else
|
||||
warnx("bad value for -p");
|
||||
}
|
||||
|
||||
|
||||
if (maxtimeout < ftpd_timeout)
|
||||
maxtimeout = ftpd_timeout;
|
||||
|
||||
@@ -528,7 +528,7 @@ user(char *name)
|
||||
guest = 0;
|
||||
if (strcmp(name, "ftp") == 0 || strcmp(name, "anonymous") == 0) {
|
||||
if ((auth_level & AUTH_FTP) == 0 ||
|
||||
checkaccess("ftp") ||
|
||||
checkaccess("ftp") ||
|
||||
checkaccess("anonymous"))
|
||||
reply(530, "User %s access denied.", name);
|
||||
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'
|
||||
* or `deny' after the username. If anything other than `allow', or
|
||||
* just nothing, is given after the username, `deny' is assumed.
|
||||
@@ -689,9 +689,9 @@ checkaccess(char *name)
|
||||
int allowed = ALLOWED;
|
||||
char *user, *perm, line[BUFSIZ];
|
||||
char *foo;
|
||||
|
||||
|
||||
fd = fopen(_PATH_FTPUSERS, "r");
|
||||
|
||||
|
||||
if(fd == NULL)
|
||||
return allowed;
|
||||
|
||||
@@ -799,7 +799,7 @@ int do_login(int code, char *passwd)
|
||||
sizeof(data_addr));
|
||||
|
||||
syslog(LOG_INFO, "ANONYMOUS FTP LOGIN FROM %s(%s), %s",
|
||||
remotehost,
|
||||
remotehost,
|
||||
data_addr,
|
||||
passwd);
|
||||
}
|
||||
@@ -850,11 +850,11 @@ end_login(void)
|
||||
static int
|
||||
krb5_verify(struct passwd *pwd, char *passwd)
|
||||
{
|
||||
krb5_context context;
|
||||
krb5_context context;
|
||||
krb5_ccache id;
|
||||
krb5_principal princ;
|
||||
krb5_error_code ret;
|
||||
|
||||
|
||||
ret = krb5_init_context(&context);
|
||||
if(ret)
|
||||
return ret;
|
||||
@@ -882,7 +882,7 @@ krb5_verify(struct passwd *pwd, char *passwd)
|
||||
}
|
||||
krb5_cc_destroy(context, id);
|
||||
krb5_free_context (context);
|
||||
if(ret)
|
||||
if(ret)
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
@@ -922,8 +922,8 @@ pass(char *passwd)
|
||||
char realm[REALM_SZ];
|
||||
if((rval = krb_get_lrealm(realm, 1)) == KSUCCESS)
|
||||
rval = krb_verify_user(pw->pw_name,
|
||||
"", realm,
|
||||
passwd,
|
||||
"", realm,
|
||||
passwd,
|
||||
KRB_VERIFY_SECURE, NULL);
|
||||
if (rval == KSUCCESS ) {
|
||||
chown (tkt_string(), pw->pw_uid, pw->pw_gid);
|
||||
@@ -1106,7 +1106,7 @@ done:
|
||||
|
||||
/* filename sanity check */
|
||||
|
||||
int
|
||||
int
|
||||
filename_check(char *filename)
|
||||
{
|
||||
char *p;
|
||||
@@ -1127,7 +1127,7 @@ filename_check(char *filename)
|
||||
lreply(553, "\"%s\" is not an acceptable filename.", filename);
|
||||
lreply(553, "The filename must start with an alphanumeric "
|
||||
"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);
|
||||
return 1;
|
||||
}
|
||||
@@ -1252,7 +1252,7 @@ bad:
|
||||
}
|
||||
|
||||
static int
|
||||
accept_with_timeout(int socket,
|
||||
accept_with_timeout(int socket,
|
||||
struct sockaddr *address,
|
||||
socklen_t *address_len,
|
||||
struct timeval *timeout)
|
||||
@@ -1305,7 +1305,7 @@ dataconn(const char *name, off_t size, const char *mode)
|
||||
#if defined(IP_TOS) && defined(HAVE_SETSOCKOPT)
|
||||
{
|
||||
int tos = IPTOS_THROUGHPUT;
|
||||
|
||||
|
||||
setsockopt(s, IPPROTO_IP, IP_TOS, (void *)&tos,
|
||||
sizeof(tos));
|
||||
}
|
||||
@@ -1323,7 +1323,7 @@ dataconn(const char *name, off_t size, const char *mode)
|
||||
if (usedefault)
|
||||
data_dest = his_addr;
|
||||
usedefault = 1;
|
||||
/*
|
||||
/*
|
||||
* Default to using the same socket type as the ctrl address,
|
||||
* unless we know the type of the data address.
|
||||
*/
|
||||
@@ -1411,7 +1411,7 @@ send_data(FILE *instr, FILE *outstr)
|
||||
struct stat st;
|
||||
char *chunk;
|
||||
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) {
|
||||
/*
|
||||
* 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");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
switch (type) {
|
||||
|
||||
case TYPE_I:
|
||||
@@ -1534,7 +1534,7 @@ receive_data(FILE *instr, FILE *outstr)
|
||||
char *p, *q;
|
||||
int cr_flag = 0;
|
||||
while ((cnt = sec_read(fileno(instr),
|
||||
buf + cr_flag,
|
||||
buf + cr_flag,
|
||||
bufsize - cr_flag)) > 0){
|
||||
if (urgflag && handleoobcmd())
|
||||
return (-1);
|
||||
@@ -1831,7 +1831,7 @@ pwd(void)
|
||||
char *ret;
|
||||
|
||||
/* 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));
|
||||
if (ret == NULL)
|
||||
@@ -2017,8 +2017,8 @@ pasv(void)
|
||||
socket_set_address_and_port (pasv_addr,
|
||||
socket_get_address (ctrl_addr),
|
||||
0);
|
||||
socket_set_portrange(pdata, restricted_data_ports,
|
||||
pasv_addr->sa_family);
|
||||
socket_set_portrange(pdata, restricted_data_ports,
|
||||
pasv_addr->sa_family);
|
||||
if (seteuid(0) < 0)
|
||||
fatal("Failed to seteuid");
|
||||
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_get_address (ctrl_addr),
|
||||
0);
|
||||
socket_set_portrange(pdata, restricted_data_ports,
|
||||
pasv_addr->sa_family);
|
||||
socket_set_portrange(pdata, restricted_data_ports,
|
||||
pasv_addr->sa_family);
|
||||
if (seteuid(0) < 0)
|
||||
fatal("Failed to seteuid");
|
||||
if (bind(pdata, pasv_addr, socket_sockaddr_size (pasv_addr)) < 0) {
|
||||
@@ -2353,7 +2353,7 @@ out:
|
||||
transflag = 0;
|
||||
if (dout != NULL){
|
||||
sec_write(fileno(dout), buf, 0); /* XXX flush */
|
||||
|
||||
|
||||
fclose(dout);
|
||||
}
|
||||
data = -1;
|
||||
|
@@ -1,34 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
@@ -152,7 +152,7 @@
|
||||
#if defined(KRB4) || defined(KRB5)
|
||||
#include <kafs.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef OTP
|
||||
#include <otp.h>
|
||||
#endif
|
||||
|
@@ -1,34 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 1998 - 2001 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "ftpd_locl.h"
|
||||
@@ -37,8 +37,8 @@
|
||||
|
||||
RCSID("$Id$");
|
||||
|
||||
/* XXX a bit too much of krb5 dependency here...
|
||||
What is the correct way to do this?
|
||||
/* XXX a bit too much of krb5 dependency here...
|
||||
What is the correct way to do this?
|
||||
*/
|
||||
|
||||
struct gss_krb5_data {
|
||||
@@ -88,7 +88,7 @@ gss_userok(void *app_data, char *username)
|
||||
free(kdata);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
ret = 0;
|
||||
krb5_free_principal(kdata->context, client);
|
||||
return ret;
|
||||
@@ -105,20 +105,20 @@ gss_session(void *app_data, char *username)
|
||||
ret = 0;
|
||||
|
||||
kdata = (struct gss_krb5_data *)(data->mech_data);
|
||||
|
||||
|
||||
/* more of krb-depend stuff :-( */
|
||||
/* gss_add_cred() ? */
|
||||
if (data->delegated_cred_handle != GSS_C_NO_CREDENTIAL) {
|
||||
krb5_ccache ccache = NULL;
|
||||
krb5_ccache ccache = NULL;
|
||||
const char* ticketfile;
|
||||
struct passwd *kpw;
|
||||
|
||||
|
||||
ret = krb5_cc_gen_new(kdata->context, &krb5_fcc_ops, &ccache);
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
||||
|
||||
ticketfile = krb5_cc_get_name(kdata->context, ccache);
|
||||
|
||||
|
||||
ret = gss_krb5_copy_ccache(&minor_status,
|
||||
data->delegated_cred_handle,
|
||||
ccache);
|
||||
@@ -126,11 +126,11 @@ gss_session(void *app_data, char *username)
|
||||
ret = 0;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
do_destroy_tickets = 1;
|
||||
|
||||
kpw = getpwnam(username);
|
||||
|
||||
|
||||
if (kpw == NULL) {
|
||||
unlink(ticketfile);
|
||||
ret = 1;
|
||||
@@ -138,16 +138,16 @@ gss_session(void *app_data, char *username)
|
||||
}
|
||||
|
||||
chown (ticketfile, kpw->pw_uid, kpw->pw_gid);
|
||||
|
||||
|
||||
if (asprintf(&k5ccname, "FILE:%s", ticketfile) != -1) {
|
||||
esetenv ("KRB5CCNAME", k5ccname, 1);
|
||||
}
|
||||
afslog(NULL, 1);
|
||||
fail:
|
||||
if (ccache)
|
||||
krb5_cc_close(kdata->context, ccache);
|
||||
krb5_cc_close(kdata->context, ccache);
|
||||
}
|
||||
|
||||
|
||||
gss_release_cred(&minor_status, &data->delegated_cred_handle);
|
||||
krb5_free_context(kdata->context);
|
||||
free(kdata);
|
||||
|
@@ -2,22 +2,22 @@
|
||||
* Copyright (c) 1995 - 1999, 2003 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -54,7 +54,7 @@ static int
|
||||
save_tkt(const char *user,
|
||||
const char *instance,
|
||||
const char *realm,
|
||||
const void *arg,
|
||||
const void *arg,
|
||||
key_proc_t key_proc,
|
||||
KTEXT *cipp)
|
||||
{
|
||||
@@ -74,7 +74,7 @@ store_ticket(KTEXT cip)
|
||||
int left = cip->length;
|
||||
int len;
|
||||
int kerror;
|
||||
|
||||
|
||||
ptr = (char *) cip->dat;
|
||||
|
||||
/* extract session key */
|
||||
@@ -85,7 +85,7 @@ store_ticket(KTEXT cip)
|
||||
len = strnlen(ptr, left);
|
||||
if (len == left)
|
||||
return(INTK_BADPW);
|
||||
|
||||
|
||||
/* extract server's name */
|
||||
strlcpy(sp.name, ptr, sizeof(sp.name));
|
||||
ptr += len + 1;
|
||||
@@ -94,7 +94,7 @@ store_ticket(KTEXT cip)
|
||||
len = strnlen(ptr, left);
|
||||
if (len == left)
|
||||
return(INTK_BADPW);
|
||||
|
||||
|
||||
/* extract server's instance */
|
||||
strlcpy(sp.instance, ptr, sizeof(sp.instance));
|
||||
ptr += len + 1;
|
||||
@@ -103,7 +103,7 @@ store_ticket(KTEXT cip)
|
||||
len = strnlen(ptr, left);
|
||||
if (len == left)
|
||||
return(INTK_BADPW);
|
||||
|
||||
|
||||
/* extract server's realm */
|
||||
strlcpy(sp.realm, ptr, sizeof(sp.realm));
|
||||
ptr += len + 1;
|
||||
@@ -118,7 +118,7 @@ store_ticket(KTEXT cip)
|
||||
tkt.length = (unsigned char) ptr[2];
|
||||
ptr += 3;
|
||||
left -= 3;
|
||||
|
||||
|
||||
if (tkt.length > left)
|
||||
return(INTK_BADPW);
|
||||
|
||||
@@ -135,7 +135,7 @@ store_ticket(KTEXT cip)
|
||||
* happen is that we might receive a replayed ticket, which could
|
||||
* at most be useless.
|
||||
*/
|
||||
|
||||
|
||||
#if 0
|
||||
/* check KDC time stamp */
|
||||
{
|
||||
@@ -145,7 +145,7 @@ store_ticket(KTEXT cip)
|
||||
if (swap_bytes) swap_u_long(kdc_time);
|
||||
|
||||
ptr += 4;
|
||||
|
||||
|
||||
if (abs((int)(local_time - kdc_time)) > CLOCK_SKEW) {
|
||||
return(RD_AP_TIME); /* XXX should probably be better
|
||||
code */
|
||||
@@ -164,8 +164,8 @@ store_ticket(KTEXT cip)
|
||||
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);
|
||||
tf_close();
|
||||
|
||||
@@ -177,7 +177,7 @@ kauth(char *principal, char *ticket)
|
||||
{
|
||||
char *p;
|
||||
int ret;
|
||||
|
||||
|
||||
if(get_command_prot() != prot_private) {
|
||||
reply(500, "Request denied (bad protection level)");
|
||||
return;
|
||||
@@ -209,7 +209,7 @@ kauth(char *principal, char *ticket)
|
||||
reply(200, "Tickets will be destroyed on exit.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
ret = krb_get_in_tkt (pr.name,
|
||||
pr.instance,
|
||||
pr.realm,
|
||||
@@ -261,7 +261,7 @@ dest_cc(void)
|
||||
krb5_context context;
|
||||
krb5_error_code ret;
|
||||
krb5_ccache id;
|
||||
|
||||
|
||||
ret = krb5_init_context(&context);
|
||||
if (ret == 0) {
|
||||
if (k5ccname)
|
||||
|
@@ -2,22 +2,22 @@
|
||||
* Copyright (c) 1995 - 2005 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -48,7 +48,7 @@ print_cred(krb5_context context, krb5_creds *cred)
|
||||
krb5_format_time(context, cred->times.starttime, t1, sizeof(t1), 1);
|
||||
else
|
||||
krb5_format_time(context, cred->times.authtime, t1, sizeof(t1), 1);
|
||||
|
||||
|
||||
if(cred->times.endtime > sec)
|
||||
krb5_format_time(context, cred->times.endtime, t2, sizeof(t2), 1);
|
||||
else
|
||||
@@ -81,7 +81,7 @@ print_tickets (krb5_context context,
|
||||
return 500;
|
||||
}
|
||||
|
||||
lreply(200, "%17s: %s:%s",
|
||||
lreply(200, "%17s: %s:%s",
|
||||
"Credentials cache",
|
||||
krb5_cc_get_type(context, ccache),
|
||||
krb5_cc_get_name(context, ccache));
|
||||
@@ -137,7 +137,7 @@ klist5(void)
|
||||
else
|
||||
ret = krb5_cc_default (context, &ccache);
|
||||
if (ret) {
|
||||
lreply(500, "krb5_cc_default: %d", ret);
|
||||
lreply(500, "krb5_cc_default: %d", ret);
|
||||
return 500;
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ klist5(void)
|
||||
|
||||
ret = krb5_cc_close (context, ccache);
|
||||
if (ret) {
|
||||
lreply(500, "krb5_cc_close: %d", ret);
|
||||
lreply(500, "krb5_cc_close: %d", ret);
|
||||
exit_status = 500;
|
||||
}
|
||||
|
||||
|
@@ -2,22 +2,22 @@
|
||||
* Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -178,5 +178,5 @@ ftpd_logwtmp(char *line, char *name, char *host)
|
||||
ftpd_logwtmp_asl(line, name, host);
|
||||
#else
|
||||
ftpd_logwtmp_wtmp(line, name, host);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 1999 - 2002 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of KTH nor the names of its contributors may be
|
||||
* 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];
|
||||
int file_type = 0;
|
||||
struct stat *st = &file->st;
|
||||
|
||||
|
||||
file->inode = st->st_ino;
|
||||
file->bsize = block_convert(st->st_blocks);
|
||||
|
||||
|
||||
if(S_ISDIR(st->st_mode)) {
|
||||
file->mode[0] = 'd';
|
||||
file_type = '/';
|
||||
@@ -187,10 +187,10 @@ make_fileinfo(FILE *out, const char *filename, struct fileinfo *file, int flags)
|
||||
file_type = '%';
|
||||
}
|
||||
#endif
|
||||
else
|
||||
else
|
||||
file->mode[0] = '?';
|
||||
{
|
||||
char *x[] = { "---", "--x", "-w-", "-wx",
|
||||
char *x[] = { "---", "--x", "-w-", "-wx",
|
||||
"r--", "r-x", "rw-", "rwx" };
|
||||
strcpy(file->mode + 1, x[(st->st_mode & S_IRWXU) >> 6]);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)) {
|
||||
#if defined(major) && defined(minor)
|
||||
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
|
||||
if (do_the_afs_dance &&
|
||||
k_hasafs()
|
||||
k_hasafs()
|
||||
&& strcmp(file, ".")
|
||||
&& strcmp(file, "..")
|
||||
&& strcmp(file, "/"))
|
||||
@@ -431,7 +431,7 @@ lstat_file (const char *file, struct stat *sb)
|
||||
return -1;
|
||||
|
||||
a_params.out = malloc (maxsize);
|
||||
if (a_params.out == NULL) {
|
||||
if (a_params.out == NULL) {
|
||||
free (path_bkp);
|
||||
return -1;
|
||||
}
|
||||
@@ -473,7 +473,7 @@ lstat_file (const char *file, struct stat *sb)
|
||||
return lstat (file, sb);
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* wow this was a mountpoint, lets cook the struct stat
|
||||
* use . as a prototype
|
||||
*/
|
||||
@@ -551,15 +551,15 @@ list_files(FILE *out, const char **files, int n_files, int flags)
|
||||
}
|
||||
switch(SORT_MODE(flags)) {
|
||||
case LS_SORT_NAME:
|
||||
qsort(fi, n_files, sizeof(*fi),
|
||||
qsort(fi, n_files, sizeof(*fi),
|
||||
(int (*)(const void*, const void*))compare_filename);
|
||||
break;
|
||||
case LS_SORT_MTIME:
|
||||
qsort(fi, n_files, sizeof(*fi),
|
||||
qsort(fi, n_files, sizeof(*fi),
|
||||
(int (*)(const void*, const void*))compare_mtime);
|
||||
break;
|
||||
case LS_SORT_SIZE:
|
||||
qsort(fi, n_files, sizeof(*fi),
|
||||
qsort(fi, n_files, sizeof(*fi),
|
||||
(int (*)(const void*, const void*))compare_size);
|
||||
break;
|
||||
}
|
||||
@@ -633,7 +633,7 @@ list_files(FILE *out, const char **files, int n_files, int flags)
|
||||
max_major,
|
||||
max_minor,
|
||||
max_date);
|
||||
} else if(DISP_MODE(flags) == LS_DISP_COLUMN ||
|
||||
} else if(DISP_MODE(flags) == LS_DISP_COLUMN ||
|
||||
DISP_MODE(flags) == LS_DISP_CROSS) {
|
||||
int max_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;
|
||||
}
|
||||
if(flags & LS_SIZE)
|
||||
sec_fprintf2(out, "total %lu\r\n",
|
||||
sec_fprintf2(out, "total %lu\r\n",
|
||||
(unsigned long)total_blocks);
|
||||
if(DISP_MODE(flags) == LS_DISP_CROSS) {
|
||||
for(i = 0, j = 0; i < n_files; i++) {
|
||||
if(fi[i].filename == NULL)
|
||||
continue;
|
||||
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);
|
||||
else
|
||||
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)
|
||||
j++;
|
||||
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);
|
||||
else
|
||||
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], '/');
|
||||
if(p == NULL)
|
||||
p = files[i];
|
||||
else
|
||||
else
|
||||
p++;
|
||||
if(!(flags & LS_DIR_FLAG) || !IS_DOT_DOTDOT(p)) {
|
||||
if((flags & LS_SHOW_DIRNAME)) {
|
||||
|
@@ -65,7 +65,7 @@ RCSID("$Id$");
|
||||
#include "extern.h"
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* 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
|
||||
* 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));
|
||||
if (no_glob ||
|
||||
glob(argv[argc], flags, NULL, &gl) ||
|
||||
if (no_glob ||
|
||||
glob(argv[argc], flags, NULL, &gl) ||
|
||||
gl.gl_pathc == 0)
|
||||
gargv[gargc++] = strdup(argv[argc]);
|
||||
else
|
||||
|
Reference in New Issue
Block a user