1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
*** src/ftpd.c.orig Wed Apr 13 23:17:18 1994
--- src/ftpd.c Sat Dec 17 23:48:25 1994
***************
*** 139,146 ****
*freopen(const char *, const char *, FILE *);
extern int ftpd_pclose(FILE *iop),
fclose(FILE *);
! extern char *getline(),
! *realpath(char *pathname, char *result);
extern char cbuf[];
extern off_t restart_point;
--- 139,148 ----
*freopen(const char *, const char *, FILE *);
extern int ftpd_pclose(FILE *iop),
fclose(FILE *);
! extern char *getline();
! #ifndef HAVE_REALPATH
! extern char *realpath(char *pathname, char *result);
! #endif
extern char cbuf[];
extern off_t restart_point;
***************
*** 237,242 ****
--- 239,254 ----
#endif /* SETPROCTITLE */
+ #ifdef SKEY
+ #include <skey.h>
+ int pwok = 0;
+ char addr_string[20];
+ /*
+ char *skey_challenge();
+ char *skey_crypt();
+ */
+ #endif
+
#ifdef KERBEROS
void init_krb();
void end_krb();
***************
*** 279,284 ****
--- 291,299 ----
exit(1);
#endif
}
+ #ifdef SKEY
+ strcpy(addr_string, inet_ntoa(his_addr.sin_addr));
+ #endif
addrlen = sizeof(ctrl_addr);
if (getsockname(0, (struct sockaddr *) &ctrl_addr, &addrlen) < 0) {
syslog(LOG_ERR, "getsockname (%s): %m", argv[0]);
***************
*** 878,884 ****
--- 893,904 ----
} else
acl_setfunctions();
+ #ifdef SKEY
+ pwok = skeyaccess(name, NULL, remotehost, addr_string);
+ reply(331, "%s", skey_challenge(name, pw, pwok));
+ #else
reply(331, "Password required for %s.", name);
+ #endif
askpasswd = 1;
/* Delay before reading passwd after first failed attempt to slow down
* passwd-guessing programs. */
***************
*** 1007,1013 ****
--- 1027,1038 ----
#ifdef KERBEROS
xpasswd = crypt16(passwd, salt);
#else
+ #ifdef SKEY
+ xpasswd = skey_crypt(passwd, salt, pw, pwok);
+ pwok = 0;
+ #else
xpasswd = crypt(passwd, salt);
+ #endif
#endif
#ifdef ULTRIX_AUTH
diff -c -r src/realpath.c.orig src/realpath.c
*** src/realpath.c.orig Fri Apr 1 21:03:45 1994
--- src/realpath.c Tue Oct 18 17:48:34 1994
***************
*** 29,36 ****
--- 29,39 ----
* POSSIBILITY OF SUCH DAMAGE.
*/
+
#include "config.h"
+ #ifndef HAVE_REALPATH
+
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
***************
*** 159,161 ****
--- 162,165 ----
strcpy(result, workpath);
return (result);
}
+ #endif
|