Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Mar 2008 21:46:33 +0200 (CEST)
From:      Stefan Sperling <stsp@stsp.name>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/122269: mail/fetchmail install as non-root user with SU_CMD fails
Message-ID:  <200803301946.m2UJkXnu067255@ted.stsp.name>
Resent-Message-ID: <200803301950.m2UJo5nF098357@freefall.freebsd.org>

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

>Number:         122269
>Category:       ports
>Synopsis:       mail/fetchmail install as non-root user with SU_CMD fails
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 30 19:50:05 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Stefan Sperling
>Release:        FreeBSD 7.0-RELEASE i386
>Organization:
>Environment:
System: FreeBSD ted.stsp.name 7.0-RELEASE FreeBSD 7.0-RELEASE #2: Sat Mar 29 23:54:21 CET 2008 stsp@ted.stsp.name:/usr/obj/home/stsp/src/freebsd-7.0/sys/TED i386

	
>Description:
When installing the mail/fetchmail port as a non-root user
with SU_CMD, the install fails because the port Makefile
executes the pkg-install script which needs root privileges
to succeed as a non-root user.
	
>How-To-Repeat:
Set SU_CMD in /etc/make.conf, for example:

	SU_CMD=/usr/bin/su root -c

Try to install fetchmail.

This will happen:

===>  Installing for fetchmail-6.3.8_4
===>   fetchmail-6.3.8_4 depends on file: /usr/local/share/certs/ca-root-nss.crt - found
===>   fetchmail-6.3.8_4 depends on shared library: intl - found
fetchmail:*:124:
You already have a group "fetchmail", so I will use it.
fetchmail:*:124:124::0:0:Fetchmail mail-retrieval daemon:/var/run/fetchmail:/usr
/sbin/nologin
You already have a user "fetchmail", so I will use it.
install: mkdir /var/run/fetchmail: Permission denied
*** Error code 71

Stop in /usr/ports/mail/fetchmail.
*** Error code 1

Stop in /usr/ports/mail/fetchmail.

	
>Fix:

The port should acquire root privileges before executing
the pkg-install script. The patch below fixes the issue for me.

Index: mail/fetchmail/Makefile
===================================================================
RCS file: /usr/ncvs/ports/mail/fetchmail/Makefile,v
retrieving revision 1.191
diff -u -r1.191 Makefile
--- mail/fetchmail/Makefile	4 Oct 2007 01:49:27 -0000	1.191
+++ mail/fetchmail/Makefile	30 Mar 2008 19:38:46 -0000
@@ -136,7 +136,7 @@
 
 	@${ECHO_CMD} ""
 
-pre-install:
+pre-su-install:
 	@${SETENV} ${SCRIPTS_ENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
 
 post-install:
	


>Release-Note:
>Audit-Trail:
>Unformatted:



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