[BACK]Return to ftpd.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / libexec / ftpd

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/libexec/ftpd/ftpd.c between version 1.184 and 1.185

version 1.184, 2008/04/28 20:23:03 version 1.185, 2008/06/09 00:33:39
Line 2502  statcmd(void)
Line 2502  statcmd(void)
 {  {
         struct sockinet *su = NULL;          struct sockinet *su = NULL;
         static char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];          static char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];
         u_char *a, *p;          unsigned char *a, *p;
         int ispassive, af;          int ispassive, af;
         off_t otbi, otbo, otb;          off_t otbi, otbo, otb;
   
         a = p = (u_char *)NULL;          a = p = (unsigned char *)NULL;
   
         reply(-211, "%s FTP server status:", hostname);          reply(-211, "%s FTP server status:", hostname);
         reply(0, "Version: %s", EMPTYSTR(version) ? "<suppressed>" : version);          reply(0, "Version: %s", EMPTYSTR(version) ? "<suppressed>" : version);
Line 2563  statcmd(void)
Line 2563  statcmd(void)
  printaddr:   printaddr:
                                                         /* PASV/PORT */                                                          /* PASV/PORT */
                 if (su->su_family == AF_INET) {                  if (su->su_family == AF_INET) {
                         a = (u_char *) &su->su_addr;                          a = (unsigned char *) &su->su_addr;
                         p = (u_char *) &su->su_port;                          p = (unsigned char *) &su->su_port;
 #define UC(b) (((int) b) & 0xff)  #define UC(b) (((int) b) & 0xff)
                         reply(0, "%s (%d,%d,%d,%d,%d,%d)",                          reply(0, "%s (%d,%d,%d,%d,%d,%d)",
                                 ispassive ? "PASV" : "PORT" ,                                  ispassive ? "PASV" : "PORT" ,
Line 2579  statcmd(void)
Line 2579  statcmd(void)
                 alen = 0;                  alen = 0;
                 switch (su->su_family) {                  switch (su->su_family) {
                 case AF_INET:                  case AF_INET:
                         a = (u_char *) &su->su_addr;                          a = (unsigned char *) &su->su_addr;
                         p = (u_char *) &su->su_port;                          p = (unsigned char *) &su->su_port;
                         alen = sizeof(su->su_addr);                          alen = sizeof(su->su_addr);
                         af = 4;                          af = 4;
                         break;                          break;
 #ifdef INET6  #ifdef INET6
                 case AF_INET6:                  case AF_INET6:
                         a = (u_char *) &su->su_6addr;                          a = (unsigned char *) &su->su_6addr;
                         p = (u_char *) &su->su_port;                          p = (unsigned char *) &su->su_port;
                         alen = sizeof(su->su_6addr);                          alen = sizeof(su->su_6addr);
                         af = 6;                          af = 6;
                         break;                          break;
Line 3721  auth_conv(int num_msg, const struct pam_
Line 3721  auth_conv(int num_msg, const struct pam_
                         if (msg[i]->msg[0] == '\0') {                          if (msg[i]->msg[0] == '\0') {
                                 (void)strlcpy(pbuf, "password", sizeof(pbuf));                                  (void)strlcpy(pbuf, "password", sizeof(pbuf));
                         } else {                          } else {
                                 /* Uncapitalize msg, remove trailing ':' */                                          /* Uncapitalize msg */
                                 (void)strlcpy(pbuf, msg[i]->msg, sizeof(pbuf));                                  (void)strlcpy(pbuf, msg[i]->msg, sizeof(pbuf));
                                 n = strlen(pbuf);  
                                 if (isupper((unsigned char)pbuf[0]))                                  if (isupper((unsigned char)pbuf[0]))
                                         pbuf[0] = tolower(                                          pbuf[0] = tolower(
                                             (unsigned char)pbuf[0]);                                              (unsigned char)pbuf[0]);
                                 n = strlen(pbuf) - 1;                                          /* Remove trailing ':' and whitespace */
                                 if (pbuf[n] == ':')                                  n = strlen(pbuf);
                                         pbuf[n] = '\0';                                  while (n-- > 0) {
                                           if (isspace((unsigned char)pbuf[n]) ||
                                               pbuf[n] == ':')
                                                   pbuf[n] = '\0';
                                           else
                                                   break;
                                   }
                         }                          }
                                 /* Send reply, wait for a response. */                                  /* Send reply, wait for a response. */
                         reply(331, "User %s accepted, provide %s.",                          reply(331, "User %s accepted, provide %s.",
Line 3825  auth_pam(void)
Line 3830  auth_pam(void)
         }          }
   
         e = pam_authenticate(pamh, 0);          e = pam_authenticate(pamh, 0);
           if (ftpd_debug)
                   syslog(LOG_DEBUG, "pam_authenticate: user '%s' returned %d",
                       curname, e);
         switch (e) {          switch (e) {
         case PAM_SUCCESS:          case PAM_SUCCESS:
                 /*                  /*
Line 3852  auth_pam(void)
Line 3860  auth_pam(void)
                                 pw = sgetpwnam(tmpl_user);                                  pw = sgetpwnam(tmpl_user);
                                 if (ftpd_debug)                                  if (ftpd_debug)
                                         syslog(LOG_DEBUG,                                          syslog(LOG_DEBUG,
                                             "PAM changed user from %s to %s",                                              "auth_pam: PAM changed "
                                               "user from '%s' to '%s'",
                                             curname, pw->pw_name);                                              curname, pw->pw_name);
                                 (void)strlcpy(curname, pw->pw_name,                                  (void)strlcpy(curname, pw->pw_name,
                                     curname_len);                                      curname_len);

Legend:
Removed from v.1.184  
changed lines
  Added in v.1.185

CVSweb <webmaster@jp.NetBSD.org>