pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mail/poppassd - fix a problem that poppassd(8) would h...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/dd7e01a8cda8
branches:  trunk
changeset: 482110:dd7e01a8cda8
user:      taca <taca%pkgsrc.org@localhost>
date:      Wed Oct 20 14:18:42 2004 +0000

description:
- fix a problem that poppassd(8) would hang with smbpasswd(1).
- make it work on Solaris; tested on SunOS 5.8.

Bump package revision.

diffstat:

 mail/poppassd/Makefile         |   4 +-
 mail/poppassd/distinfo         |   7 ++-
 mail/poppassd/patches/patch-ac |  88 ++++++++++++++++++++++++++++++-----------
 mail/poppassd/patches/patch-ad |  14 ++++++
 mail/poppassd/patches/patch-ae |  12 +++++
 mail/poppassd/patches/patch-af |  12 +++++
 6 files changed, 108 insertions(+), 29 deletions(-)

diffs (truncated from 313 to 300 lines):

diff -r ec879dc7cf9c -r dd7e01a8cda8 mail/poppassd/Makefile
--- a/mail/poppassd/Makefile    Wed Oct 20 11:13:05 2004 +0000
+++ b/mail/poppassd/Makefile    Wed Oct 20 14:18:42 2004 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.11 2004/04/18 05:07:49 snj Exp $
+# $NetBSD: Makefile,v 1.12 2004/10/20 14:18:42 taca Exp $
 #
 
 DISTNAME=              qpopper${VERSION}
 PKGNAME=               poppassd-${VERSION}
-PKGREVISION=           2
+PKGREVISION=           3
 CATEGORIES=            mail
 MASTER_SITES=          ftp://ftp.qualcomm.com/eudora/servers/unix/popper/
 
diff -r ec879dc7cf9c -r dd7e01a8cda8 mail/poppassd/distinfo
--- a/mail/poppassd/distinfo    Wed Oct 20 11:13:05 2004 +0000
+++ b/mail/poppassd/distinfo    Wed Oct 20 14:18:42 2004 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.8 2004/01/30 07:05:27 taca Exp $
+$NetBSD: distinfo,v 1.9 2004/10/20 14:18:42 taca Exp $
 
 SHA1 (qpopper4.0.5.tar.gz) = 726d40da2210bf4b82541a28971986e6a3d9e1a5
 Size (qpopper4.0.5.tar.gz) = 2281284 bytes
@@ -6,4 +6,7 @@
 Size (qpopper-4.0.5-ipv6-20030313.diff.gz) = 60773 bytes
 SHA1 (patch-aa) = 0dd1bdc832d00bd640e7003afea28f0d90c2f975
 SHA1 (patch-ab) = 713698d5834b569a0ee08088567a71e218d50550
-SHA1 (patch-ac) = 77420b58627a7bab36a9ad49957abd03ebdaaa71
+SHA1 (patch-ac) = db8329f0937554be80a88f4754b37f3a69bd70aa
+SHA1 (patch-ad) = 01036ef18732b3a7576ac79e35ea9b027e2eef63
+SHA1 (patch-ae) = fa5febd4eedccdbd5610821b222a689193993bae
+SHA1 (patch-af) = 76ad4e1f557876dd1adf6c74f97512ad2fd8b92d
diff -r ec879dc7cf9c -r dd7e01a8cda8 mail/poppassd/patches/patch-ac
--- a/mail/poppassd/patches/patch-ac    Wed Oct 20 11:13:05 2004 +0000
+++ b/mail/poppassd/patches/patch-ac    Wed Oct 20 14:18:42 2004 +0000
@@ -1,6 +1,6 @@
-$NetBSD: patch-ac,v 1.5 2004/01/30 07:05:28 taca Exp $
+$NetBSD: patch-ac,v 1.6 2004/10/20 14:18:42 taca Exp $
 
---- password/poppassd.c.orig   2004-01-30 15:59:13.000000000 +0900
+--- password/poppassd.c.orig   Wed Oct 20 15:12:58 2004
 +++ password/poppassd.c
 @@ -167,8 +167,13 @@
  /* LANMAN allows up to 14 char passwords (truncates if longer), but tacacs
@@ -16,7 +16,16 @@
  
  #include "config.h"
  
-@@ -273,7 +278,7 @@ void    get_client_info ( POP *p, BOOL n
+@@ -176,6 +181,8 @@
+ #include <sys/stat.h>
+ #include <sys/wait.h>
+ 
++#include <signal.h>
++
+ #if HAVE_SYS_NETINET_IN_H
+ #  include <sys/netinet/in.h>
+ #endif
+@@ -273,7 +280,7 @@ void    get_client_info ( POP *p, BOOL n
  char   *sock_ntop ( struct sockaddr *p, int salen );
  int     sock_port ( struct sockaddr *p, int salen );
  char   *debug_str ( char *p, int inLen, int order );
@@ -25,7 +34,7 @@
  
  /*
   * External prototypes
-@@ -294,6 +299,7 @@ pop_result auth_user ( POP *p, char *pas
+@@ -294,6 +301,7 @@ pop_result auth_user ( POP *p, char *pas
  
  static char *P1[] =
     {
@@ -33,7 +42,7 @@
       "changing password for *\nold password: ",  /* shadow */
       "enter login password: ",                   /* Solaris */
       "old smb password: ",                       /* smb */
-@@ -323,6 +329,7 @@ static char *P4[] =
+@@ -323,6 +331,7 @@ static char *P4[] =
     {
       "password changed. ", /* shadow */
       "password changed ",  /* smb */
@@ -41,16 +50,16 @@
       ""
     };
  
-@@ -337,6 +344,8 @@ char           msg_buf [ 2048 ]     = ""
+@@ -337,6 +346,8 @@ char           msg_buf [ 2048 ]     = ""
  char          *pwd_binary           = PASSWD_BINARY;
  char          *smb_binary           = SMBPASSWD_BINARY;
  
-+int child_pid = 0;
-+int child_status = -1;
++int child_pid;
++int child_status;
  
  /*
   * Be careful using TRACE in an 'if' statement!
-@@ -346,18 +355,19 @@ char          *smb_binary           = SM
+@@ -346,18 +357,19 @@ char          *smb_binary           = SM
  #define RUN_PASSWD 1
  #define RUN_SMBPASSWD 2
  
@@ -72,7 +81,7 @@
  
  #ifdef HAS_SHADOW
      struct spwd *spwd;
-@@ -375,8 +385,6 @@ int main ( int argc, char *argv[] )
+@@ -375,8 +387,6 @@ int main ( int argc, char *argv[] )
              pname = ptr + 1;
      }
  
@@ -81,7 +90,7 @@
      /*
       * Set up some stuff in -p- so we can call Qpopper routines
       */
-@@ -384,6 +392,17 @@ int main ( int argc, char *argv[] )
+@@ -384,6 +394,17 @@ int main ( int argc, char *argv[] )
      p.AuthType            = noauth;
      p.myname              = pname;
  
@@ -99,7 +108,7 @@
      /*
       * Handle command-line options
       */
-@@ -392,9 +411,9 @@ int main ( int argc, char *argv[] )
+@@ -392,9 +413,9 @@ int main ( int argc, char *argv[] )
      {
          switch (nopt)
          {
@@ -112,7 +121,7 @@
                                    "[-t trace-file] [-v] [-y log-facility]\n",
                            pname );
                  exit (1);
-@@ -411,20 +430,34 @@ int main ( int argc, char *argv[] )
+@@ -411,20 +432,34 @@ int main ( int argc, char *argv[] )
                  verbose = TRUE;
                  break;
  
@@ -130,14 +139,14 @@
                  TRACE ( trace_file, POP_DEBUG, HERE,
 -                        "Changing SMB passwords using %s", smb_binary );
 +                        "Changing SMB password using %s", smb_binary );
-                 break;
- 
++                break;
++
 +           case 'P':
 +                mode |= RUN_PASSWD;
 +                TRACE ( trace_file, POP_DEBUG, HERE,
 +                      "Changing standard password enabled" );
-+                break;
-+
+                 break;
+ 
 +
             case 'p':
                  mode |= RUN_PASSWD;
@@ -149,7 +158,7 @@
                  break;
  
             case 't':
-@@ -475,6 +508,10 @@ int main ( int argc, char *argv[] )
+@@ -475,6 +510,10 @@ int main ( int argc, char *argv[] )
                          "Avoiding reverse lookups (-R)" );
                  break;
  
@@ -160,7 +169,7 @@
              case 'y': /* log facility */
                  if ( optarg == NULL || *optarg == '\0' ) {
                      err_msg ( HERE, "-y value expected" );
-@@ -562,44 +599,50 @@ int main ( int argc, char *argv[] )
+@@ -562,44 +601,50 @@ int main ( int argc, char *argv[] )
          return 1;
      }
  
@@ -238,7 +247,7 @@
          return 1;
      }
  
-@@ -631,6 +674,20 @@ int main ( int argc, char *argv[] )
+@@ -631,6 +676,20 @@ int main ( int argc, char *argv[] )
      return 0;
  }
  
@@ -259,16 +268,18 @@
  
  /* Run a child process to do the password change */
  
-@@ -651,6 +708,8 @@ void runchild ( char *userid, char *oldp
+@@ -651,6 +710,10 @@ void runchild ( char *userid, char *oldp
          exit ( 1 );
      }
  
 +  signal(SIGCHLD, reapchild);
++  child_pid = 0;
++  child_status = -1;
 +
    /* fork child process to talk to password program */
  
    pid = fork();
-@@ -675,10 +734,16 @@ void runchild ( char *userid, char *oldp
+@@ -675,10 +738,16 @@ void runchild ( char *userid, char *oldp
      wpid = waitpid ( pid, &wstat, 0 );
      if ( wpid < 0 )
      {
@@ -288,19 +299,46 @@
  
      if ( pid != wpid )
      {
-@@ -782,6 +847,11 @@ int dochild (int master, char *slavedev,
+@@ -700,7 +769,6 @@ void runchild ( char *userid, char *oldp
+       WriteToClient ("500 Server error (abnormal exit), get help!");
+       exit(1);
+     }
+-
+     close ( master ); /* done with the pty */
+   }
+   else      /* Child */
+@@ -782,6 +850,13 @@ int dochild (int master, char *slavedev,
     chdir ("/");
     umask (0);
  
++#ifdef HAVE_SETLOGIN
 +   if (setlogin(userid) < 0) {
 +      err_msg ( HERE, "setlogin failed: %m" );
 +      return(0);
 +   }
++#endif
 +
  /*
   * Become the user and run passwd. Linux shadowed passwd doesn't need
   * to be run as root with the username passed on the command line.
-@@ -950,8 +1020,12 @@ int match (char *str, char *pat)
+@@ -880,6 +955,7 @@ void writestring (int fd, char *s)
+ int talktochild (int master, char *userid, char *oldpass, char *newpass,
+                  char *emess, int asroot)
+ {
++     int n;
+      char buf[BUFSIZE];
+      char pswd[BUFSIZE+1];
+ 
+@@ -921,6 +997,8 @@ int talktochild (int master, char *useri
+      if ( !expect(master, P4, buf) )
+         TRACE ( trace_file, POP_DEBUG, HERE, "no response -- assuming OK" );
+ 
++     while ((n = read(master, buf, sizeof buf)) > 0)
++      ;
+      return SUCCESS;
+ }
+ 
+@@ -950,8 +1028,12 @@ int match (char *str, char *pat)
             strlen(pat), debug_str(pat, strlen(pat), 1) );
  
     while (*str && *pat) {
@@ -315,7 +353,7 @@
  
       /* ignore multiple space sequences */
       if (*pat == ' ' && isspace (*str)) {
-@@ -1050,7 +1124,11 @@ int expect (int master, char **expected,
+@@ -1050,7 +1132,11 @@ int expect (int master, char **expected,
          if ( m < 0 ) {
             err_msg ( HERE, "read error from child" );
             return FAILURE;
diff -r ec879dc7cf9c -r dd7e01a8cda8 mail/poppassd/patches/patch-ad
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/poppassd/patches/patch-ad    Wed Oct 20 14:18:42 2004 +0000
@@ -0,0 +1,14 @@
+$NetBSD: patch-ad,v 1.1 2004/10/20 14:18:42 taca Exp $
+
+--- config.h.in.orig   2004-10-20 14:19:23.413009000 +0900
++++ config.h.in
+@@ -58,6 +58,9 @@
+ /* Define if you don't have vprintf but do have _doprnt.  */
+ #undef HAVE_DOPRNT
+ 
++/* Define if you have setlogin system call. */
++#undef HAVE_SETLOGIN
++
+ /* Define if you have <sys/wait.h> that is POSIX.1 compatible.  */
+ #undef HAVE_SYS_WAIT_H
+ 
diff -r ec879dc7cf9c -r dd7e01a8cda8 mail/poppassd/patches/patch-ae
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/poppassd/patches/patch-ae    Wed Oct 20 14:18:42 2004 +0000
@@ -0,0 +1,12 @@
+$NetBSD: patch-ae,v 1.1 2004/10/20 14:18:42 taca Exp $
+
+--- configure.in.orig  2004-10-20 14:19:23.863020000 +0900
++++ configure.in
+@@ -1440,6 +1440,7 @@ gethostbyname \
+ gettimeofday \
+ getusershell \
+ mkdir \
++setlogin \
+ socket \
+ strdup \
+ strerror \
diff -r ec879dc7cf9c -r dd7e01a8cda8 mail/poppassd/patches/patch-af
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/poppassd/patches/patch-af    Wed Oct 20 14:18:42 2004 +0000



Home | Main Index | Thread Index | Old Index