From dmx@tiger.tehnopark.org  Wed Feb 20 15:26:45 2008
Return-Path: <dmx@tiger.tehnopark.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B63BE16A401
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Feb 2008 15:26:45 +0000 (UTC)
	(envelope-from dmx@tiger.tehnopark.org)
Received: from tiger.tehnopark.org (ul198.informika.ru [194.226.214.198])
	by mx1.freebsd.org (Postfix) with ESMTP id 34E3713C459
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Feb 2008 15:26:44 +0000 (UTC)
	(envelope-from dmx@tiger.tehnopark.org)
Received: from tiger.tehnopark.org (localhost.tehnopark.org [127.0.0.1])
	by tiger.tehnopark.org (8.13.8/8.13.8) with ESMTP id m1KElAG8088278
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Feb 2008 17:47:10 +0300 (MSK)
	(envelope-from dmx@tiger.tehnopark.org)
Received: (from root@localhost)
	by tiger.tehnopark.org (8.13.8/8.13.8/Submit) id m1KElA9N088277;
	Wed, 20 Feb 2008 17:47:10 +0300 (MSK)
	(envelope-from dmx)
Message-Id: <200802201447.m1KElA9N088277@tiger.tehnopark.org>
Date: Wed, 20 Feb 2008 17:47:10 +0300 (MSK)
From: dmx@dmx.org.ru
Reply-To: dmx@dmx.org.ru
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] security/clamav. During install process, created work dirs have wrong permissions
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         120885
>Category:       ports
>Synopsis:       [patch] security/clamav -  During install process, created work dirs have wrong permissions
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    garga
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 20 15:30:03 UTC 2008
>Closed-Date:    Thu Feb 21 13:21:13 UTC 2008
>Last-Modified:  Thu Feb 21 13:21:13 UTC 2008
>Originator:     dmx@dmx.org.ru
>Release:        FreeBSD 6.2-STABLE amd64
>Organization:
dmx@dmx.org.ru
>Environment:
System: FreeBSD tiger.tehnopark.org 6.2-STABLE FreeBSD 6.2-STABLE #1: Wed Apr 4 04:48:40 MSD 2007 root@tiger.tehnopark.org:/usr/obj/usr/src/sys/TIGER amd64
>Description:
security/clamav port (clamav-0.92.1)
With wrong umask before install, make install clamav port,
directories (DBDIR, LOGDIR, RUNDIR) will be create with wrong permissions.
>How-To-Repeat:
Just set some umask (e.g. umask 0222) and run "make install"
>Fix:
--- pkg-install.in.orig Wed Mar 28 15:12:07 2007
+++ pkg-install.in  Wed Feb 20 16:54:47 2008
@@ -13,8 +13,7 @@
 RUNDIR=%%RUNDIR%%
 
 PW="pw"
-CHOWN="chown"
-MKDIR="mkdir -p"
+MKDIR="install -v -d -m 0755 -o ${CLAMAVUSER} -g ${CLAMAVGROUP}"
 
 if [ "$2" = "PRE-INSTALL" ]; then

@@ -42,14 +41,9 @@
 
 elif [ "$2" = "POST-INSTALL" ]; then

-   [ ! -d "${DBDIR}" ] && (${MKDIR} ${DBDIR} || exit 1)
-   ${CHOWN} -R ${CLAMAVUSER}:${CLAMAVGROUP} ${DBDIR} || exit 1
-
-   [ ! -d "${LOGDIR}" ] && (${MKDIR} ${LOGDIR} || exit 1)
-   ${CHOWN} -R ${CLAMAVUSER}:${CLAMAVGROUP} ${LOGDIR} || exit 1
-
-   [ ! -d "${RUNDIR}" ] && (${MKDIR} ${RUNDIR} || exit 1)
-   ${CHOWN} -R ${CLAMAVUSER}:${CLAMAVGROUP} ${RUNDIR} || exit 1
+   ${MKDIR} ${DBDIR} || exit 1
+   ${MKDIR} ${LOGDIR} || exit 1
+   ${MKDIR} ${RUNDIR} || exit 1
 
 fi

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->beech 
Responsible-Changed-By: beech 
Responsible-Changed-When: Wed Feb 20 18:32:23 UTC 2008 
Responsible-Changed-Why:  
I'll take it 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120885 
State-Changed-From-To: open->feedback 
State-Changed-By: beech 
State-Changed-When: Wed Feb 20 21:18:36 UTC 2008 
State-Changed-Why:  
Maintainer is committer 


Responsible-Changed-From-To: beech->garga 
Responsible-Changed-By: beech 
Responsible-Changed-When: Wed Feb 20 21:18:36 UTC 2008 
Responsible-Changed-Why:  
Over to maintainer 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/120885: commit references a PR
Date: Thu, 21 Feb 2008 13:20:00 +0000 (UTC)

 garga       2008-02-21 13:19:51 UTC
 
   FreeBSD ports repository
 
   Modified files:
     security/clamav      Makefile 
     security/clamav/files pkg-install.in 
   Log:
   - Fix a thread problem on FreeBSD 5.x forcing it to use -lpthread [1]
   - Fix a problem on pkg-install, when umask is not default, it create dirs with
     wrong permissions [2]
   - Bump PORTREVISION
   
   PR:             ports/120885 [2]
   Submitted by:   dmx@dmx.org.ru [2]
   Noticed by:     havp pointyhat via pav
   
   Revision  Changes    Path
   1.109     +3 -0      ports/security/clamav/Makefile
   1.5       +4 -12     ports/security/clamav/files/pkg-install.in
 _______________________________________________
 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: feedback->closed 
State-Changed-By: garga 
State-Changed-When: Thu Feb 21 13:21:12 UTC 2008 
State-Changed-Why:  
Committed. Thanks! 

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