From mm@mail2.vx.sk  Wed Mar  2 23:52:39 2011
Return-Path: <mm@mail2.vx.sk>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CBC63106564A;
	Wed,  2 Mar 2011 23:52:39 +0000 (UTC)
	(envelope-from mm@mail2.vx.sk)
Received: from mail2.vx.sk (mail2.vx.sk [IPv6:2a01:4f8:100:84a3::3])
	by mx1.freebsd.org (Postfix) with ESMTP id 652FE8FC15;
	Wed,  2 Mar 2011 23:52:39 +0000 (UTC)
Received: from neo.vx.sk (localhost [127.0.0.1])
	by mail2.vx.sk (Postfix) with ESMTP id 5B355EA80E;
	Thu,  3 Mar 2011 00:52:38 +0100 (CET)
Received: from mail2.vx.sk ([127.0.0.1])
	by neo.vx.sk (mail.vx.sk [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id rUPvLld7d5fm; Thu,  3 Mar 2011 00:47:36 +0100 (CET)
Received: by mail2.vx.sk (Postfix, from userid 1001)
	id B244EEA7F1; Thu,  3 Mar 2011 00:47:36 +0100 (CET)
Message-Id: <20110302234736.B244EEA7F1@mail2.vx.sk>
Date: Thu,  3 Mar 2011 00:47:36 +0100 (CET)
From: Martin Matuska <mm@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: dinoex@FreeBSD.org
Subject: [PATCH] print/cups-base: fix handling of pam.d/cups
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         155218
>Category:       ports
>Synopsis:       [PATCH] print/cups-base: fix handling of pam.d/cups
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dinoex
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 03 00:00:21 UTC 2011
>Closed-Date:    Mon Mar 07 21:53:03 CET 2011
>Last-Modified:  Mon Mar 07 21:53:03 CET 2011
>Originator:     Martin Matuska
>Release:        FreeBSD 8.2-STABLE amd64
>Organization:
>Environment:
System: FreeBSD neo.vx.sk 8.2-STABLE FreeBSD 8.2-STABLE #0 r219122M: Wed Mar  2 00:08:08
>Description:
${PREFIX}/etc/pam.d/cups is a user config and should not be deleted if
user-modified or overwritten by a new installation.

See security/sudo as an example.

Added file(s):
- files/patch-conf-Makefile

Port maintainer (dinoex@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
>Fix:

--- cups-base-1.4.6_2.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/print/cups-base/Makefile,v
retrieving revision 1.153
diff -u -r1.153 Makefile
--- Makefile	20 Feb 2011 21:49:23 -0000	1.153
+++ Makefile	2 Mar 2011 23:45:49 -0000
@@ -362,6 +362,12 @@
 	${INSTALL_DATA} ${WRKSRC}/conf/${f} ${CUPS_ETCDIR}/${f}.N
 	cd ${CUPS_ETCDIR}/; if test ! -f ${f}; then ${CP} -p ${f}.N ${f}; fi
 .endfor
+.if defined(WITH_PAM)
+	@if [ ! -f ${PREFIX}/etc/pam.d/cups ]; then \
+		${CP} -p ${PREFIX}/etc/pam.d/cups.default \
+		${PREFIX}/etc/pam.d/cups ; \
+	fi
+.endif
 	${MKDIR} ${EXAMPLESDIR}
 	${INSTALL_DATA} ${WRKDIR}/ulpt-cupsd.conf ${EXAMPLESDIR}/
 	${INSTALL_SCRIPT} ${WRKDIR}/ulpt-cupsd.sh ${PREFIX}/sbin/
Index: pkg-plist
===================================================================
RCS file: /home/pcvs/ports/print/cups-base/pkg-plist,v
retrieving revision 1.60
diff -u -r1.60 pkg-plist
--- pkg-plist	20 Feb 2011 21:49:23 -0000	1.60
+++ pkg-plist	2 Mar 2011 23:45:49 -0000
@@ -38,7 +38,9 @@
 etc/cups/snmp.conf.N
 @exec if test ! -f %D/etc/cups/snmp.conf; then cp -p %D/etc/cups/snmp.conf.N %D/etc/cups/snmp.conf; fi
 @exec chgrp cups %D/etc/cups
-%%WITH_PAMD%%etc/pam.d/cups
+@unexec if cmp -s %D/etc/pam.d/cups.default %D/etc/pam.d/cups; then rm -f %D/etc/pam.d/cups ; fi
+%%WITH_PAMD%%etc/pam.d/cups.default
+@exec if [ ! -f %D/etc/pam.d/cups ] ; then cp -p %D/%F %B/cups; fi
 bin/cancel
 bin/cupstestdsc
 bin/cupstestppd
Index: files/patch-conf-Makefile
===================================================================
RCS file: files/patch-conf-Makefile
diff -N files/patch-conf-Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-conf-Makefile	2 Mar 2011 23:45:49 -0000
@@ -0,0 +1,16 @@
+--- conf/Makefile.orig	2011-03-03 00:19:41.555484014 +0100
++++ conf/Makefile	2011-03-03 00:20:17.791387420 +0100
+@@ -90,10 +90,10 @@
+ 	done
+ 	-if test x$(PAMDIR) != x; then \
+ 		$(INSTALL_DIR) -m 755 $(BUILDROOT)$(PAMDIR); \
+-		if test -r $(BUILDROOT)$(PAMDIR)/cups ; then \
+-			$(INSTALL_DATA) $(PAMFILE) $(BUILDROOT)$(PAMDIR)/cups.N ; \
++		if test -r $(BUILDROOT)$(PAMDIR)/cups.default ; then \
++			$(INSTALL_DATA) $(PAMFILE) $(BUILDROOT)$(PAMDIR)/cups.default.N ; \
+ 		else \
+-			$(INSTALL_DATA) $(PAMFILE) $(BUILDROOT)$(PAMDIR)/cups ; \
++			$(INSTALL_DATA) $(PAMFILE) $(BUILDROOT)$(PAMDIR)/cups.default ; \
+ 		fi ; \
+ 	fi
+ 
--- cups-base-1.4.6_2.patch ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->dinoex 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Mar 3 00:00:36 UTC 2011 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=155218 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/155218: commit references a PR
Date: Mon,  7 Mar 2011 20:43:29 +0000 (UTC)

 dinoex      2011-03-07 20:43:15 UTC
 
   FreeBSD ports repository
 
   Modified files:
     print/cups-base      Makefile pkg-plist 
   Added files:
     print/cups-base/files patch-conf-Makefile 
   Log:
   - preserve modified etc/pam.d/cups
   PR:             155218
   Sumbitted by:   mm
   
   Revision  Changes    Path
   1.154     +6 -0      ports/print/cups-base/Makefile
   1.1       +16 -0     ports/print/cups-base/files/patch-conf-Makefile (new)
   1.61      +3 -1      ports/print/cups-base/pkg-plist
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: dinoex 
State-Changed-When: Mon Mar 7 21:52:50 CET 2011 
State-Changed-Why:  
committed, thanks. 

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