From nobody@FreeBSD.org  Mon Apr 21 19:31:05 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6B6C01065677
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 21 Apr 2008 19:31:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 606248FC1C
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 21 Apr 2008 19:31:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m3LJUi01098165
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 21 Apr 2008 19:30:44 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m3LJUiX2098164;
	Mon, 21 Apr 2008 19:30:44 GMT
	(envelope-from nobody)
Message-Id: <200804211930.m3LJUiX2098164@www.freebsd.org>
Date: Mon, 21 Apr 2008 19:30:44 GMT
From: Chris St Denis <chris@smartt.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: svnserve requires user svn, should be automatically created and rc script's default path differs from Makefile's
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         122972
>Category:       ports
>Synopsis:       devel/subversion - svnserve requires user svn, should be automatically created and rc script's default path differs from Makefile's
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lev
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 21 19:40:01 UTC 2008
>Closed-Date:    Sat Oct 25 09:07:58 UTC 2008
>Last-Modified:  Sat Oct 25 09:10:00 UTC 2008
>Originator:     Chris St Denis
>Release:        n/a
>Organization:
>Environment:
n/a
>Description:
To use svnserve daemon a user and group must be created. The group can be auto created with WITH_REPOSITORY_CREATION however no user is created. I have attached a patch that also creates the user in the same way the group is already created.

Also, the svnserve daemon's rc script defaults the path to %%PREFIX%%/repositories where as the Makefile (for the purposes of WITH_REPOSITORY_CREATION) defaults to /home/svn/repos. One of these should be changed. The second attached patch changes the RC script to /home/svn/repos
>How-To-Repeat:

>Fix:
Patch for makefile (not heavily tested)
-------------------
drs# diff -u Makefile.old Makefile
--- Makefile.old        Mon Apr 21 12:16:50 2008
+++ Makefile    Mon Apr 21 12:20:46 2008db/$$i; \
+           *) ${CHOWN} -R ${SVNUSER}:${SVNGROUP} $
@@ -159,10 +159,12 @@
 CONFIGURE_ARGS+=       --with-apxs=${APXS}
 PLIST_SUB+=    MOD_DAV_SVN=""
 SVNGROUP?=     www
+SVNUSER?=      www
 .else
 PLIST_SUB+=    MOD_DAV_SVN="@comment "
 PKGDEINSTALL=  NONEXISTENT
 SVNGROUP?=     svn
+SVNUSER?=      svn
 .endif

 .if defined(WITH_APACHE2_APR)
@@ -300,10 +302,10 @@
 .endif
        @${ECHO_MSG} ""
 .if defined(WITH_REPOSITORY_CREATION)
-       @${ECHO_MSG} "I will create (or use, if it exists) \"${SVNGROUP}\" group."
+       @${ECHO_MSG} "I will create (or use, if it exists) \"${SVNUSER}\" user and \"${SVNGROUP}\" group."
        @${ECHO_MSG} "Make sure that all committers are its members."
        @${ECHO_MSG} ""
-       @${ECHO_MSG} "Repository will be created at '${SVNREPOS}' with group '${SVNGROUP}'."
+       @${ECHO_MSG} "Repository will be created at '${SVNREPOS}' with user \"${SVNUSER}\" and group '${SVNGROUP}'."
        @${ECHO_MSG} "Type of repository will be '${SVNFSTYPE}'."
        @${ECHO_MSG} "You could change these settings by defining SVNREPOS, SVNGROUP and SVNFSTYPE."
 .else
@@ -449,17 +451,29 @@
                ${FALSE}; \
            fi; \
        fi
+        @if /usr/sbin/pw usershow "${SVNUSER}" >/dev/null 2>&1; then \
+            ${ECHO_MSG} "You already have a user \"${SVNUSER}\", so I will use it."; \
+        else \
+            if /usr/sbin/pw useradd ${SVNUSER} -h -; \
+            then \
+                ${ECHO_MSG} "Added user \"${SVNUSER}\"."; \
+            else \
+                ${ECHO_MSG} "Adding user \"${SVNUSER}\" failed..."; \
+                ${ECHO_MSG} "Please create it, and try again."; \
+                ${FALSE}; \
+            fi; \
+
 .endif
        @${MKDIR} ${SVNREPOS}
        @${PREFIX}/bin/svnadmin create --fs-type ${SVNFSTYPE} ${SVNREPOS}
 .if defined(WITH_SVNSERVE_WRAPPER)
-       @${CHGRP} ${SVNGROUP} ${SVNGRPFILES}
+       @${CHOWN} ${SVNUSER}:${SVNGROUP} ${SVNGRPFILES}
        @${CHMOD} g+w ${SVNGRPFILES}
        @for i in ${SVNREPOS}/db/* ; do \
            i=$${i##*/}; \
            case $$i in \
            DB_CONFIG|fs-type|uuid) ;; \
-           *) ${CHGRP} -R ${SVNGROUP} ${SVNREPOS}/{SVNREPOS}/db/$$i; \
               ${CHMOD} -R g+w ${SVNREPOS}/db/$$i; \
               ;; \
            esac; \

Second patch
------------
drs# diff -u svnserve.in.old svnserve.in
--- svnserve.in.old     Mon Apr 21 12:30:42 2008
+++ svnserve.in Mon Apr 21 12:30:51 2008
@@ -22,7 +22,7 @@
 # Set some defaults
 svnserve_enable=${svnserve_enable:-"NO"}
 svnserve_flags=${svnserve_flags:-"-d --listen-port=3690"}
-svnserve_data=${svnserve_data:-"%%PREFIX%%/repositories"}
+svnserve_data=${svnserve_data:-"/home/svn/repos"}
 svnserve_user=${svnserve_user:-"svn"}
 svnserve_group=${svnserve_group:-"svn"}


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->lev 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Apr 21 22:33:45 UTC 2008 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=122972 
State-Changed-From-To: open->closed 
State-Changed-By: lev 
State-Changed-When: Sat Oct 25 09:07:30 UTC 2008 
State-Changed-Why:  

Committed, thanks! 


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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/122972: commit references a PR
Date: Sat, 25 Oct 2008 09:06:34 +0000 (UTC)

 lev         2008-10-25 09:06:21 UTC
 
   FreeBSD ports repository
 
   Modified files:
     devel/subversion     Makefile Makefile.common distinfo 
     devel/subversion/files build-outputs.mk svnserve.in 
   Log:
     (1) Update to 1.5.4
     (2) Create SVNUSER in cases when SVHGROUP is created [1]
     (3) Change default repository path to "/home/svn/repos" in svnwrapper [1]
     (4) Fix typo [2]
   
   PR:             [1] ports/122972, [2] ports/127347
   
   Revision  Changes    Path
   1.124     +17 -5     ports/devel/subversion/Makefile
   1.10      +4 -2      ports/devel/subversion/Makefile.common
   1.59      +3 -9      ports/devel/subversion/distinfo
   1.3       +42 -42    ports/devel/subversion/files/build-outputs.mk
   1.2       +1 -1      ports/devel/subversion/files/svnserve.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"
 
>Unformatted:
