summaryrefslogtreecommitdiff
path: root/ftp/wu-ftpd+ipv6/files/patch-aa
blob: a414a2f7a1575752d473bf22b564b483f3c20105 (plain) (blame)
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
*** src/ftpd.c.orig	Wed Apr 13 22:17:18 1994
--- src/ftpd.c	Fri Jan 13 20:22:05 1995
***************
*** 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,250 ----
  
  #endif /* SETPROCTITLE */
  
+ #ifdef SKEY
+ int	pwok = 0;
+ char	*skey_challenge();
+ char	*skey_crypt();
+ #endif
+ 
  #ifdef KERBEROS
  void init_krb();
  void end_krb();
***************
*** 878,884 ****
--- 886,897 ----
      } else
          acl_setfunctions();
  
+ #ifdef SKEY
+     pwok = skeyaccess(name, NULL, remotehost);
+     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,1014 ****
--- 1020,1032 ----
  #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
          if ((numfails = ultrix_check_pass(passwd, xpasswd)) < 0) {
***************
*** 1095,1101 ****
      (void) initgroups(pw->pw_name, pw->pw_gid);
  
      /* open wtmp before chroot */
!     (void) sprintf(ttyline, "ftp%d", getpid());
      logwtmp(ttyline, pw->pw_name, remotehost);
      logged_in = 1;
  
--- 1113,1119 ----
      (void) initgroups(pw->pw_name, pw->pw_gid);
  
      /* open wtmp before chroot */
!     (void) sprintf(ttyline, "ftp%ld", getpid());
      logwtmp(ttyline, pw->pw_name, remotehost);
      logged_in = 1;
  
***************
*** 1422,1428 ****
          for (loop = 0; namebuf[loop]; loop++)
              if (isspace(namebuf[loop]) || iscntrl(namebuf[loop]))
                  namebuf[loop] = '_';
!         sprintf(msg, "%.24s %d %s %d %s %c %s %c %c %s ftp %d %s\n",
                  ctime(&curtime),
                  xfertime,
                  remotehost,
--- 1440,1446 ----
          for (loop = 0; namebuf[loop]; loop++)
              if (isspace(namebuf[loop]) || iscntrl(namebuf[loop]))
                  namebuf[loop] = '_';
!         sprintf(msg, "%.24s %d %s %qd %s %c %s %c %c %s ftp %d %s\n",
                  ctime(&curtime),
                  xfertime,
                  remotehost,
***************
*** 1610,1616 ****
          for (loop = 0; namebuf[loop]; loop++)
              if (isspace(namebuf[loop]) || iscntrl(namebuf[loop]))
                  namebuf[loop] = '_';
!         sprintf(msg, "%.24s %d %s %d %s %c %s %c %c %s ftp %d %s\n",
                  ctime(&curtime),
                  xfertime,
                  remotehost,
--- 1628,1634 ----
          for (loop = 0; namebuf[loop]; loop++)
              if (isspace(namebuf[loop]) || iscntrl(namebuf[loop]))
                  namebuf[loop] = '_';
!         sprintf(msg, "%.24s %d %s %qd %s %c %s %c %c %s ftp %d %s\n",
                  ctime(&curtime),
                  xfertime,
                  remotehost,
***************
*** 1699,1705 ****
      file_size = size;
      byte_count = 0;
      if (size != (off_t) - 1)
!         (void) sprintf(sizebuf, " (%ld bytes)", size);
      else
          (void) strcpy(sizebuf, "");
      if (pdata >= 0) {
--- 1717,1723 ----
      file_size = size;
      byte_count = 0;
      if (size != (off_t) - 1)
!         (void) sprintf(sizebuf, " (%qd bytes)", size);
      else
          (void) strcpy(sizebuf, "");
      if (pdata >= 0) {
*** src/realpath.c.orig	Fri Apr  1 20:03:45 1994
--- src/realpath.c	Fri Jan 13 01:09:30 1995
***************
*** 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
*** src/extensions.c.orig	Fri Jan 13 20:26:26 1995
--- src/extensions.c	Fri Jan 13 20:29:39 1995
***************
*** 103,109 ****
      if (st->st_mtime > newer_time) {
          if (show_fullinfo != 0) {
              if (flag == FTW_F || flag == FTW_D) {
!                 fprintf(dout, "%s %d %d %s", flag == FTW_F ? "F" : "D",
                          st->st_size, st->st_mtime, path);
              }
          } else if (flag == FTW_F)
--- 103,109 ----
      if (st->st_mtime > newer_time) {
          if (show_fullinfo != 0) {
              if (flag == FTW_F || flag == FTW_D) {
!                 fprintf(dout, "%s %qd %ld %s", flag == FTW_F ? "F" : "D",
                          st->st_size, st->st_mtime, path);
              }
          } else if (flag == FTW_F)
***************
*** 524,530 ****
          if (fp == NULL)
              return (0);
          fgets(buf, sizeof(buf), fp);
!         if (sscanf(buf, "%d %d %d %d %d %d %d", &tmbuf.tm_year, &tmbuf.tm_mon,
          &tmbuf.tm_mday, &tmbuf.tm_hour, &tmbuf.tm_min, &deny, &disc) != 7) {
              return (0);
          }
--- 524,530 ----
          if (fp == NULL)
              return (0);
          fgets(buf, sizeof(buf), fp);
!         if (sscanf(buf, "%d %d %d %d %d %ld %ld", &tmbuf.tm_year, &tmbuf.tm_mon,
          &tmbuf.tm_mday, &tmbuf.tm_hour, &tmbuf.tm_min, &deny, &disc) != 7) {
              return (0);
          }