Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Jan 2004 01:10:03 +1030
From:      David Hunt <davidh@apdata.com.au>
To:        jesse@gallup.com
Cc:        ports@FreeBSD.org
Subject:   FreeBSD Port: p5-Net-Server-0.85
Message-ID:  <200401240110.03758.davidh@apdata.com.au>

next in thread | raw e-mail | index | archive | help

--Boundary-00=_DJTEAjYOGV69SrV
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi There

Not being entirely sure how to apply the patchs to the port, for the uid failure with amavisd-new.  Can you please tell me how I can apply the following 2 patches to the port.

Amavisd-new error:
an 24 01:08:55 gateway.internal.lawsoft.com.au amavisd[2335]: Net::Server: 2004/01/24-01:08:55 Amavis (type Net::Server::PreForkSimple) starting! pid(2335)
Jan 24 01:08:55 gateway.internal.lawsoft.com.au amavisd[2335]: Net::Server: Binding to UNIX socket file /var/amavis/amavisd.sock using SOCK_STREAM
Jan 24 01:08:55 gateway.internal.lawsoft.com.au amavisd[2335]: Net::Server: Binding to TCP port 10024 on host 127.0.0.1
Jan 24 01:08:55 gateway.internal.lawsoft.com.au amavisd[2335]: Net::Server: Setting gid to "1004 1004"
Jan 24 01:08:55 gateway.internal.lawsoft.com.au amavisd[2335]: Net::Server: Setting uid to "1004"
Jan 24 01:08:55 gateway.internal.lawsoft.com.au amavisd[2335]: Net::Server: 2004/01/24-01:08:55 Couldn't become uid "1004"\n\n  at line 479 in file /usr/local/lib/perl5/site_perl/5.005/Net/Server.pm
Jan 24 01:08:55 gateway.internal.lawsoft.com.au amavisd[2335]: Net::Server: 2004/01/24-01:08:55 Server closing!


Many thanks

David H

--Boundary-00=_DJTEAjYOGV69SrV
Content-Type: text/x-diff;
  charset="us-ascii";
  name="net-server.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="net-server.patch"

--- Server.pm~	2003-03-07 15:51:35.000000000 +0100
+++ Server.pm	2003-04-25 13:59:12.000000000 +0200
@@ -475,8 +475,10 @@
     }
   };
   if( $@ ){
-    if( $< == 0 || $> == 0 ){
+    if( $> == 0 ){
       $self->fatal( $@ );
+    } elsif( $< == 0){
+      $self->log(2,"NOTICE: Effective UID changed, but Real UID is 0: $@");
     }else{
       $self->log(2,$@);
     }
--- Server/Daemonize.pm~	2002-09-24 20:55:15.000000000 +0200
+++ Server/Daemonize.pm	2003-04-25 13:58:16.000000000 +0200
@@ -204,8 +204,7 @@
     die "Couldn't become uid \"$uid\"\n";
   }
   my $result = POSIX::setuid( $uid );
-  if( ! defined($result)
-      || $result != $uid ){ # assuming this is true for all systems
+  if( ! defined($result) ){
     die "Couldn't POSIX::setuid to \"$uid\" [$!]\n";
   }
   return 1;

--Boundary-00=_DJTEAjYOGV69SrV
Content-Type: text/x-diff;
  charset="us-ascii";
  name="net-server.patch2"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="net-server.patch2"

--- Server.pm~	Thu Nov  6 21:04:11 2003
+++ Server.pm	Thu Nov 20 16:59:02 2003
@@ -480,7 +480,7 @@
     if( $> == 0 ){
       $self->fatal( $@ );
     } elsif( $< == 0){
-      $self->log(2,"NOTICE: Effective UID changed, but Real UID is 0: $@");
+      $self->log(2,"WARNING: Effective UID changed, but Real UID is 0: $@");
     }else{
       $self->log(2,$@);
     }
--- Server/Daemonize.pm~	Thu Nov  6 21:04:11 2003
+++ Server/Daemonize.pm	Thu Nov 20 16:59:53 2003
@@ -199,7 +199,8 @@
 ### change the process to run as this uid
 sub set_uid {
   my $uid = get_uid( shift() );
-  $< = $> = $uid;
+  $< = $uid;  # real UID, must be changed first on some systems (FreeBSD)
+  $> = $uid;  # effective UID
   if( $< != $uid ){
     die "Couldn't become uid \"$uid\"\n";
   }

--Boundary-00=_DJTEAjYOGV69SrV--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200401240110.03758.davidh>