From yasu@home.utahime.org  Sat Mar 12 00:17:21 2005
Return-Path: <yasu@home.utahime.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 1A06D16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 12 Mar 2005 00:17:21 +0000 (GMT)
Received: from utahime.as.wakwak.ne.jp (utahime.as.wakwak.ne.jp [61.205.238.40])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 14DF443D3F
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 12 Mar 2005 00:17:20 +0000 (GMT)
	(envelope-from yasu@home.utahime.org)
Received: from eastasia.home.utahime.org (eastasia.home.utahime.org [192.168.174.1])
	by utahime.as.wakwak.ne.jp (Postfix) with ESMTP id 5665BB87E
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 12 Mar 2005 09:17:18 +0900 (JST)
Received: from localhost.home.utahime.org (localhost.home.utahime.org [127.0.0.1])
	by localhost-backdoor.home.utahime.org (Postfix) with ESMTP id 26028551F;
	Sat, 12 Mar 2005 09:17:18 +0900 (JST)
Received: from eastasia.home.utahime.org (localhost.home.utahime.org [127.0.0.1])
	by localhost.home.utahime.org (AvMailGate-2.0.2-5) id 00243-700A07BB;
	Sat, 12 Mar 2005 09:17:18 +0900
Received: by eastasia.home.utahime.org (Postfix, from userid 1000)
	id 057D254F3; Sat, 12 Mar 2005 09:17:17 +0900 (JST)
Message-Id: <20050312001717.057D254F3@eastasia.home.utahime.org>
Date: Sat, 12 Mar 2005 09:17:17 +0900 (JST)
From: KIMURA Yasuhiro <yasu@utahime.org>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [PATCH] mail/maildrop: Fix and Change spec of MAILDROP_SUID/MAILDROP_GUID options
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         78715
>Category:       ports
>Synopsis:       [PATCH] mail/maildrop: Fix and Change spec of MAILDROP_SUID/MAILDROP_GUID options
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    sergei
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 12 00:20:02 GMT 2005
>Closed-Date:    Mon Mar 14 14:37:26 GMT 2005
>Last-Modified:  Mon Mar 14 14:37:26 GMT 2005
>Originator:     KIMURA Yasuhiro
>Release:        FreeBSD 4.11-RELEASE i386
>Organization:
>Environment:
System: FreeBSD xxxxxxxx 4.11-RELEASE FreeBSD 4.11-RELEASE #0: Wed Jan 26 08:33:31 JST 2005 xxxxxxxx i386


	
>Description:
	

	Maildrop was installed without suid/sgid bit even if
	MAILDROP_SUID/MAILDROP_SGID option is set. So fix it.
	And also change spec of these options so that suid/sgid bit
	is set only if these options are explicitly specified.

>How-To-Repeat:
	
>Fix:

	

--- patch-maildrop begins here ---
Index: Makefile
===================================================================
RCS file: /net/cvsup/cvsroot/ports/mail/maildrop/Makefile,v
retrieving revision 1.37
diff -u -r1.37 Makefile
--- Makefile	9 Mar 2005 15:36:55 -0000	1.37
+++ Makefile	11 Mar 2005 23:50:58 -0000
@@ -10,8 +10,6 @@
 # MAILDROP_SUID=<uid>,
 # MAILDROP_SGID=<gid>	Maildrop will be installed with suid permissions for
 #			MAILDROP_SUID, and sgid permissions for MAILDROP_SGID.
-#			If undefined, these values default to "root" and "mail"
-#			respectively, which should be suitable for most systems.
 # MAILDROP_TRUSTED_USERS=<user> Specify users allowed to use the -d option
 # NO_MAILWRAPPER=yes	If defined, let configure guess which sendmail binary
 #			to use
@@ -34,8 +32,6 @@
 CONFIGURE_ARGS=	--enable-syslog=1 \
 		--enable-use-flock=1 \
 		--with-etcdir="${PREFIX}/etc" \
-		--enable-maildrop-uid="${MAILDROP_SUID}" \
-		--enable-maildrop-gid="${MAILDROP_SGID}" \
 		--enable-maildirquota
 CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
 CPPFLAGS+=	-I${LOCALBASE}/include
@@ -54,6 +50,14 @@
 CONFIGURE_ARGS+=	--without-db
 .endif
 
+.if defined(MAILDROP_SUID)
+CONFIGURE_ARGS+=	--enable-maildrop-uid="${MAILDROP_SUID}"
+.endif
+
+.if defined(MAILDROP_SGID)
+CONFIGURE_ARGS+=	--enable-maildrop-gid="${MAILDROP_SGID}"
+.endif
+
 .if !defined(NO_MAILWRAPPER)
 CONFIGURE_ARGS+=	--enable-sendmail=/usr/sbin/sendmail
 .endif
@@ -80,9 +84,6 @@
 CONFIGURE_ARGS+=	--disable-authlib
 .endif
 
-MAILDROP_SUID?=	root
-MAILDROP_SGID?=	mail
-
 .if defined(NOPORTDOCS)
 # Just install the binary and man pages, no extra documentation
 INSTALL_TARGET=	install-maildrop install-deliverquota install-man
@@ -98,9 +99,15 @@
 DOCS=	AUTHORS INSTALL INSTALL.html README README.html README.postfix \
 	UPGRADE UPGRADE.html maildroptips.txt maildir/README.*
 
-.if !defined(NOPORTDOCS)
 post-install:
+.if !defined(NOPORTDOCS)
 	cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
 .endif
+.if defined(MAILDROP_SUID)
+	${CHMOD} u+s ${LOCALBASE}/bin/maildrop
+.endif
+.if defined(MAILDROP_SGID)
+	${CHMOD} g+s ${LOCALBASE}/bin/maildrop
+.endif
 
 .include <bsd.port.post.mk>
--- patch-maildrop ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->sergei 
Responsible-Changed-By: novel 
Responsible-Changed-When: Sun Mar 13 16:28:52 GMT 2005 
Responsible-Changed-Why:  
Over to maintainer. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=78715 
State-Changed-From-To: open->closed 
State-Changed-By: sergei 
State-Changed-When: Mon Mar 14 14:36:34 GMT 2005 
State-Changed-Why:  
Committed, thanks! 
One minor change: s/LOCALBASE/PREFIX/ in post-install target. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=78715 
>Unformatted:
