on 1/19/01 11:55 AM, Ken Jones at [EMAIL PROTECTED] wrote:

> Alberto Rodr�guez wrote:
>> 
>> ----- Original Message -----
>> From: "Alberto Rodr�guez" <[EMAIL PROTECTED]>
>> To: <[EMAIL PROTECTED]>
>> Sent: Wednesday, January 17, 2001 9:39 PM
>> Subject: vpopmail and qmail-smtpd-auth
>> 
>> According qmail-smtpd-auth�s FAQ
>> "http://members.elysium.pl/brush/qmail-smtpd-auth/faq.html#a2"  is possible
>> to use qmail-smtpd-auth with vpopmail. There, you have a patch
>> vpopmail.patch, and you must apply it to vpopmail source.
>> 
>> Well... The problem is that I get the patch and inside
>> /tmp/vpopmail/vpopmail-4.9.6-1 I make :
>> 
>> patch -p0 < vpopmail.patch
>> 
>> and I get the following...
>> --------------------------
>> |- cls--- vpopmail-3.4.11/vchkpw.c.smtpauth      Fri Jun  9 22:20:39 2000
>> |+++ vpopmail-3.4.11/vchkpw.c    Fri Jun  9 22:22:16 2000
>> --------------------------
>> File to patch:
>> 
>> Perhaps the problem is that this patch is only for 3.4.11 version and now
>> you haven�t to patch vpopmail to work with qmail-smtp-auth...
>> 
>> Coud anyone help me with this question?
>> 
>> Thanks in advance.
> 
> I think the patch changes to vpopmail have already been incorporated
> into the vpopmail standard release. At least in the 4.9.7 and 4.9.8
> releases.
> 
> Ken Jones


Actually, they haven't.  I just updated the patch from Krzysztof Dabrowski's
smtp-auth site FAQ 
(http://members.elysium.pl/brush/qmail-smtpd-auth/faq.html#a2) to work with 
vpopmail-4.9.8.  It appears that after applying this patch, you must 
run your tcpserver for POP connections as user root.  Otherwise, the 
setuid/setgid functions will not occur and POP connections will fail.

-Bill


*** vchkpw.c.original   Mon Jan 22 14:01:45 2001
--- vchkpw.c    Mon Jan 22 14:13:21 2001
***************
*** 316,338 ****
       * is required to run as the pop users uid/gid
       * change to the vpasswds uid and gid 
       */
-       if (setgid(pwent->pw_gid) == -1) {
-               log_exit(LOG_NOTICE, 4, "vchkpw: setgid() failed");
-       }
  
!       /* captn' changing group permissions, Eye Eye! */
!       if (setuid(pwent->pw_uid) == -1) {
!               log_exit(LOG_NOTICE, 5, "vchkpw: setuid() failed");
!       }
  
!       /* hop into thier email directory */
!       if (chdir(pwent->pw_dir) == -1) {
  
!               /* if the dir does not exist, create it */
!               if (vmake_maildir(pwent->pw_dir, pwent->pw_uid, pwent->pw_gid)==-1) {
!                       log_exit(LOG_NOTICE, 5, "vchkpw: make user dir failed");
                }
        }
        /* set up some environment variables */
        scopy(buf,"USER=",sizeof(buf)); 
        scat(buf,pwent->pw_name,sizeof(buf)); 
--- 316,347 ----
       * is required to run as the pop users uid/gid
       * change to the vpasswds uid and gid 
       */
  
!      /* Only call setgid/setuid if being called by root
!       * otherwise assume being called by user for auth purposes only
!       * ie, smtp auth 
!       */
  
!       if (getuid() == 0) {
!               if (setgid(pwent->pw_gid) == -1) {
!                       log_exit(LOG_NOTICE, 4, "vchkpw: setgid() failed");
!               }
  
!               /* captn' changing group permissions, Eye Eye! */
!               if (setuid(pwent->pw_uid) == -1) {
!                       log_exit(LOG_NOTICE, 5, "vchkpw: setuid() failed");
!               }
! 
!               /* hop into thier email directory */
!               if (chdir(pwent->pw_dir) == -1) {
! 
!                       /* if the dir does not exist, create it */
!                       if (vmake_maildir(pwent->pw_dir, pwent->pw_uid, 
pwent->pw_gid)==-1) {
!                               log_exit(LOG_NOTICE, 5, "vchkpw: make user dir 
failed");
!                       }
                }
        }
+ 
        /* set up some environment variables */
        scopy(buf,"USER=",sizeof(buf)); 
        scat(buf,pwent->pw_name,sizeof(buf)); 

Reply via email to