1 diff -u --recursive --new-file krb5-1.7-vanilla/src/appl/gssftp/ftp/Makefile.in krb5-1.7/src/appl/gssftp/ftp/Makefile.in
2 --- krb5-1.7-vanilla/src/appl/gssftp/ftp/Makefile.in 2009-09-30 22:58:22.000000000 -0400
3 +++ krb5-1.7/src/appl/gssftp/ftp/Makefile.in 2009-10-01 15:35:02.000000000 -0400
5 SRCS = $(srcdir)/cmds.c $(srcdir)/cmdtab.c $(srcdir)/domacro.c \
6 $(srcdir)/ftp.c $(srcdir)/getpass.c $(srcdir)/glob.c \
7 $(srcdir)/main.c $(srcdir)/radix.c \
8 - $(srcdir)/ruserpass.c $(srcdir)/secure.c
9 + $(srcdir)/ruserpw.c $(srcdir)/secure.c
12 OBJS = $(OUTPRE)cmds.$(OBJEXT) $(OUTPRE)cmdtab.$(OBJEXT) \
13 $(OUTPRE)domacro.$(OBJEXT) $(OUTPRE)ftp.$(OBJEXT) \
14 $(OUTPRE)getpass.$(OBJEXT) $(OUTPRE)glob.$(OBJEXT) \
15 $(OUTPRE)main.$(OBJEXT) $(OUTPRE)radix.$(OBJEXT) \
16 - $(OUTPRE)ruserpass.$(OBJEXT) $(OUTPRE)secure.$(OBJEXT)
17 + $(OUTPRE)ruserpw.$(OBJEXT) $(OUTPRE)secure.$(OBJEXT)
19 LOCALINCLUDES = -I$(srcdir)/.. -I$(srcdir)
24 ftp.o cmds.o main.o: $(srcdir)/../arpa/ftp.h
25 -ftp.o cmds.o cmdtab.o domacro.o main.o ruserpass.o: $(srcdir)/ftp_var.h
26 +ftp.o cmds.o cmdtab.o domacro.o main.o ruserpw.o: $(srcdir)/ftp_var.h
29 cmds.o: $(srcdir)/cmds.c
31 glob.o: $(srcdir)/glob.c
32 main.o: $(srcdir)/main.c
33 pclose.o: $(srcdir)/pclose.c
34 -ruserpass.o: $(srcdir)/ruserpass.c
35 +ruserpw.o: $(srcdir)/ruserpw.c
36 domacro.o: $(srcdir)/domacro.c
37 radix.o: $(srcdir)/radix.c
38 secure.o: $(srcdir)/secure.c
39 diff -u --recursive --new-file krb5-1.7-vanilla/src/appl/gssftp/ftp/deps krb5-1.7/src/appl/gssftp/ftp/deps
40 --- krb5-1.7-vanilla/src/appl/gssftp/ftp/deps 2009-09-30 22:58:24.000000000 -0400
41 +++ krb5-1.7/src/appl/gssftp/ftp/deps 2009-10-01 15:35:02.000000000 -0400
43 $(SRCTOP)/include/port-sockets.h $(srcdir)/../arpa/ftp.h \
45 $(OUTPRE)radix.$(OBJEXT): ftp_var.h radix.c
46 -$(OUTPRE)ruserpass.$(OBJEXT): ftp_var.h ruserpass.c
47 +$(OUTPRE)ruserpw.$(OBJEXT): ftp_var.h ruserpw.c
48 $(OUTPRE)secure.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
49 $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssapi/gssapi_generic.h \
50 $(srcdir)/../arpa/ftp.h secure.c secure.h
51 diff -u --recursive --new-file krb5-1.7-vanilla/src/appl/gssftp/ftp/ftp.c krb5-1.7/src/appl/gssftp/ftp/ftp.c
52 --- krb5-1.7-vanilla/src/appl/gssftp/ftp/ftp.c 2009-09-30 22:58:22.000000000 -0400
53 +++ krb5-1.7/src/appl/gssftp/ftp/ftp.c 2009-10-01 15:35:03.000000000 -0400
57 l_user = pass = l_acct = 0;
58 - if (ruserpass(host, &l_user, &pass, &l_acct) < 0) {
59 + if (ruserpw(host, &l_user, &pass, &l_acct) < 0) {
63 diff -u --recursive --new-file krb5-1.7-vanilla/src/appl/gssftp/ftp/ftp_var.h krb5-1.7/src/appl/gssftp/ftp/ftp_var.h
64 --- krb5-1.7-vanilla/src/appl/gssftp/ftp/ftp_var.h 2009-09-30 22:58:23.000000000 -0400
65 +++ krb5-1.7/src/appl/gssftp/ftp/ftp_var.h 2009-10-01 15:35:03.000000000 -0400
67 struct cmd *getcmd (char *);
71 -int ruserpass (char *, char **, char **, char **);
73 +int ruserpw (char *, char **, char **, char **);
76 int radix_encode (unsigned char *, unsigned char *, int *, int);
77 diff -u --recursive --new-file krb5-1.7-vanilla/src/appl/gssftp/ftp/ruserpass.c krb5-1.7/src/appl/gssftp/ftp/ruserpass.c
78 --- krb5-1.7-vanilla/src/appl/gssftp/ftp/ruserpass.c 2009-09-30 22:58:24.000000000 -0400
79 +++ krb5-1.7/src/appl/gssftp/ftp/ruserpass.c 1969-12-31 19:00:00.000000000 -0500
82 - * Copyright (c) 1985 Regents of the University of California.
83 - * All rights reserved.
85 - * Redistribution and use in source and binary forms, with or without
86 - * modification, are permitted provided that the following conditions
88 - * 1. Redistributions of source code must retain the above copyright
89 - * notice, this list of conditions and the following disclaimer.
90 - * 2. Redistributions in binary form must reproduce the above copyright
91 - * notice, this list of conditions and the following disclaimer in the
92 - * documentation and/or other materials provided with the distribution.
93 - * 3. All advertising materials mentioning features or use of this software
94 - * must display the following acknowledgement:
95 - * This product includes software developed by the University of
96 - * California, Berkeley and its contributors.
97 - * 4. Neither the name of the University nor the names of its contributors
98 - * may be used to endorse or promote products derived from this software
99 - * without specific prior written permission.
101 - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
102 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
103 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
104 - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
105 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
106 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
107 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
108 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
109 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
110 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
115 -static char sccsid[] = "@(#)ruserpass.c 5.3 (Berkeley) 3/1/91";
116 -#endif /* not lint */
118 -#include <sys/types.h>
121 -#ifdef HAVE_STDLIB_H
124 -#ifdef HAVE_UNISTD_H
128 -#include <sys/stat.h>
130 -#include "ftp_var.h"
133 -#include <win-mac.h>
136 -#ifndef MAXHOSTNAMELEN
137 -#define MAXHOSTNAMELEN 64
140 -static int token (void);
151 -static char tokval[100];
153 -static struct toktab {
157 - { "default", DEFAULT },
158 - { "login", LOGIN },
159 - { "password", PASSWD },
160 - { "passwd", PASSWD },
161 - { "account", ACCOUNT },
162 - { "machine", MACH },
163 - { "macdef", MACDEF },
177 - while ((c = getc(cfile)) != EOF &&
178 - (c == '\n' || c == '\t' || c == ' ' || c == ','))
184 - while ((c = getc(cfile)) != EOF && c != '"') {
191 - while ((c = getc(cfile)) != EOF
192 - && c != '\n' && c != '\t' && c != ' ' && c != ',') {
199 - if (tokval[0] == 0)
201 - for (t = toktab; t->tokstr; t++)
202 - if (!strcmp(t->tokstr, tokval))
208 -ruserpass(host, aname, apass, aacct)
209 - char *host, **aname, **apass, **aacct;
211 - char *hdir, buf[FTP_BUFSIZ], *tmp;
212 - char myname[MAXHOSTNAMELEN + 1], *mydomain;
213 - int t, i, c, usedefault = 0;
216 - hdir = getenv("HOME");
219 - (void) snprintf(buf, sizeof(buf), "%s/.netrc", hdir);
220 - cfile = fopen(buf, "r");
221 - if (cfile == NULL) {
222 - if (errno != ENOENT)
226 - if (gethostname(myname, sizeof(myname)) < 0)
228 - if ((mydomain = strchr(myname, '.')) == NULL)
231 - while ((t = token())) switch(t) {
242 - * Allow match either for user's input host name
243 - * or official hostname. Also allow match of
244 - * incompletely-specified host in local domain.
246 - if (strcasecmp(host, tokval) == 0)
248 - if (strcasecmp(hostname, tokval) == 0)
250 - if ((tmp = strchr(hostname, '.')) != NULL &&
251 - strcasecmp(tmp, mydomain) == 0 &&
252 - strncasecmp(hostname, tokval,
253 - (unsigned) (tmp-hostname)) == 0 &&
254 - tokval[tmp - hostname] == '\0')
256 - if ((tmp = strchr(host, '.')) != NULL &&
257 - strcasecmp(tmp, mydomain) == 0 &&
258 - strncasecmp(host, tokval,
259 - (unsigned ) (tmp - host)) == 0 &&
260 - tokval[tmp - host] == '\0')
265 - while ((t = token()) && t != MACH && t != DEFAULT) switch(t) {
270 - *aname = strdup(tokval);
272 - if (strcmp(*aname, tokval))
278 - if (strcmp(*aname, "anonymous") &&
279 - fstat(fileno(cfile), &stb) >= 0 &&
280 - (stb.st_mode & 077) != 0) {
281 - fprintf(stderr, "Error - .netrc file not correct mode.\n");
282 - fprintf(stderr, "Remove password or correct mode.\n");
285 - if (token() && *apass == 0) {
286 - *apass = strdup(tokval);
290 - if (fstat(fileno(cfile), &stb) >= 0
291 - && (stb.st_mode & 077) != 0) {
292 - fprintf(stderr, "Error - .netrc file not correct mode.\n");
293 - fprintf(stderr, "Remove account or correct mode.\n");
296 - if (token() && *aacct == 0) {
297 - *aacct = strdup(tokval);
302 - (void) fclose(cfile);
305 - while ((c = getc(cfile)) != EOF)
306 - if (c != ' ' && c != '\t')
308 - if (c == EOF || c == '\n') {
309 - printf("Missing macdef name argument.\n");
312 - if (macnum == 16) {
313 - printf("Limit of 16 macros have already been defined\n");
316 - tmp = macros[macnum].mac_name;
318 - for (i=0; i < 8 && (c=getc(cfile)) != EOF &&
319 - !isspace(c); ++i) {
323 - printf("Macro definition missing null line terminator.\n");
328 - while ((c=getc(cfile)) != EOF && c != '\n');
331 - printf("Macro definition missing null line terminator.\n");
335 - macros[macnum].mac_start = macbuf;
338 - macros[macnum].mac_start = macros[macnum-1].mac_end + 1;
340 - tmp = macros[macnum].mac_start;
341 - while (tmp != macbuf + 4096) {
342 - if ((c=getc(cfile)) == EOF) {
343 - printf("Macro definition missing null line terminator.\n");
347 - if (*tmp == '\n') {
348 - if (*(tmp-1) == '\0') {
349 - macros[macnum++].mac_end = tmp - 1;
356 - if (tmp == macbuf + 4096) {
357 - printf("4K macro buffer exceeded\n");
362 - fprintf(stderr, "Unknown .netrc keyword %s\n", tokval);
368 - (void) fclose(cfile);
371 - (void) fclose(cfile);
374 diff -u --recursive --new-file krb5-1.7-vanilla/src/appl/gssftp/ftp/ruserpw.c krb5-1.7/src/appl/gssftp/ftp/ruserpw.c
375 --- krb5-1.7-vanilla/src/appl/gssftp/ftp/ruserpw.c 1969-12-31 19:00:00.000000000 -0500
376 +++ krb5-1.7/src/appl/gssftp/ftp/ruserpw.c 2009-10-01 15:35:57.000000000 -0400
379 + * Copyright (c) 1985 Regents of the University of California.
380 + * All rights reserved.
382 + * Redistribution and use in source and binary forms, with or without
383 + * modification, are permitted provided that the following conditions
385 + * 1. Redistributions of source code must retain the above copyright
386 + * notice, this list of conditions and the following disclaimer.
387 + * 2. Redistributions in binary form must reproduce the above copyright
388 + * notice, this list of conditions and the following disclaimer in the
389 + * documentation and/or other materials provided with the distribution.
390 + * 3. All advertising materials mentioning features or use of this software
391 + * must display the following acknowledgement:
392 + * This product includes software developed by the University of
393 + * California, Berkeley and its contributors.
394 + * 4. Neither the name of the University nor the names of its contributors
395 + * may be used to endorse or promote products derived from this software
396 + * without specific prior written permission.
398 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
399 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
400 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
401 + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
402 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
403 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
404 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
405 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
406 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
407 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
412 +static char sccsid[] = "@(#)ruserpw.c 5.3 (Berkeley) 3/1/91";
413 +#endif /* not lint */
415 +#include <sys/types.h>
418 +#ifdef HAVE_STDLIB_H
421 +#ifdef HAVE_UNISTD_H
425 +#include <sys/stat.h>
427 +#include "ftp_var.h"
430 +#include <win-mac.h>
433 +#ifndef MAXHOSTNAMELEN
434 +#define MAXHOSTNAMELEN 64
437 +static int token (void);
448 +static char tokval[100];
450 +static struct toktab {
454 + { "default", DEFAULT },
455 + { "login", LOGIN },
456 + { "password", PASSWD },
457 + { "passwd", PASSWD },
458 + { "account", ACCOUNT },
459 + { "machine", MACH },
460 + { "macdef", MACDEF },
474 + while ((c = getc(cfile)) != EOF &&
475 + (c == '\n' || c == '\t' || c == ' ' || c == ','))
481 + while ((c = getc(cfile)) != EOF && c != '"') {
488 + while ((c = getc(cfile)) != EOF
489 + && c != '\n' && c != '\t' && c != ' ' && c != ',') {
496 + if (tokval[0] == 0)
498 + for (t = toktab; t->tokstr; t++)
499 + if (!strcmp(t->tokstr, tokval))
505 +ruserpw(host, aname, apass, aacct)
506 + char *host, **aname, **apass, **aacct;
508 + char *hdir, buf[FTP_BUFSIZ], *tmp;
509 + char myname[MAXHOSTNAMELEN + 1], *mydomain;
510 + int t, i, c, usedefault = 0;
513 + hdir = getenv("HOME");
516 + (void) snprintf(buf, sizeof(buf), "%s/.netrc", hdir);
517 + cfile = fopen(buf, "r");
518 + if (cfile == NULL) {
519 + if (errno != ENOENT)
523 + if (gethostname(myname, sizeof(myname)) < 0)
525 + if ((mydomain = strchr(myname, '.')) == NULL)
528 + while ((t = token())) switch(t) {
539 + * Allow match either for user's input host name
540 + * or official hostname. Also allow match of
541 + * incompletely-specified host in local domain.
543 + if (strcasecmp(host, tokval) == 0)
545 + if (strcasecmp(hostname, tokval) == 0)
547 + if ((tmp = strchr(hostname, '.')) != NULL &&
548 + strcasecmp(tmp, mydomain) == 0 &&
549 + strncasecmp(hostname, tokval,
550 + (unsigned) (tmp-hostname)) == 0 &&
551 + tokval[tmp - hostname] == '\0')
553 + if ((tmp = strchr(host, '.')) != NULL &&
554 + strcasecmp(tmp, mydomain) == 0 &&
555 + strncasecmp(host, tokval,
556 + (unsigned ) (tmp - host)) == 0 &&
557 + tokval[tmp - host] == '\0')
562 + while ((t = token()) && t != MACH && t != DEFAULT) switch(t) {
567 + *aname = strdup(tokval);
569 + if (strcmp(*aname, tokval))
575 + if (strcmp(*aname, "anonymous") &&
576 + fstat(fileno(cfile), &stb) >= 0 &&
577 + (stb.st_mode & 077) != 0) {
578 + fprintf(stderr, "Error - .netrc file not correct mode.\n");
579 + fprintf(stderr, "Remove password or correct mode.\n");
582 + if (token() && *apass == 0) {
583 + *apass = strdup(tokval);
587 + if (fstat(fileno(cfile), &stb) >= 0
588 + && (stb.st_mode & 077) != 0) {
589 + fprintf(stderr, "Error - .netrc file not correct mode.\n");
590 + fprintf(stderr, "Remove account or correct mode.\n");
593 + if (token() && *aacct == 0) {
594 + *aacct = strdup(tokval);
599 + (void) fclose(cfile);
602 + while ((c = getc(cfile)) != EOF)
603 + if (c != ' ' && c != '\t')
605 + if (c == EOF || c == '\n') {
606 + printf("Missing macdef name argument.\n");
609 + if (macnum == 16) {
610 + printf("Limit of 16 macros have already been defined\n");
613 + tmp = macros[macnum].mac_name;
615 + for (i=0; i < 8 && (c=getc(cfile)) != EOF &&
616 + !isspace(c); ++i) {
620 + printf("Macro definition missing null line terminator.\n");
625 + while ((c=getc(cfile)) != EOF && c != '\n');
628 + printf("Macro definition missing null line terminator.\n");
632 + macros[macnum].mac_start = macbuf;
635 + macros[macnum].mac_start = macros[macnum-1].mac_end + 1;
637 + tmp = macros[macnum].mac_start;
638 + while (tmp != macbuf + 4096) {
639 + if ((c=getc(cfile)) == EOF) {
640 + printf("Macro definition missing null line terminator.\n");
644 + if (*tmp == '\n') {
645 + if (*(tmp-1) == '\0') {
646 + macros[macnum++].mac_end = tmp - 1;
653 + if (tmp == macbuf + 4096) {
654 + printf("4K macro buffer exceeded\n");
659 + fprintf(stderr, "Unknown .netrc keyword %s\n", tokval);
665 + (void) fclose(cfile);
668 + (void) fclose(cfile);