From owner-freebsd-ports@FreeBSD.ORG Mon Jul 7 20:43:46 2008 Return-Path: Delivered-To: ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA07C1065672; Mon, 7 Jul 2008 20:43:46 +0000 (UTC) (envelope-from mikhailg@webanoide.org) Received: from smtp.san.navalradio.cl (overlord.navalradio.cl [201.236.67.146]) by mx1.freebsd.org (Postfix) with ESMTP id 1EEE08FC18; Mon, 7 Jul 2008 20:43:45 +0000 (UTC) (envelope-from mikhailg@webanoide.org) Received: from localhost ([172.18.64.43]) (authenticated bits=0) by smtp.san.navalradio.cl (8.13.8/8.13.8) with ESMTP id m67KhdBV030096; Mon, 7 Jul 2008 20:43:39 GMT (envelope-from mikhailg@webanoide.org) Received: from 172.18.64.77 ([172.18.64.77]) by www.san.navalradio.cl (Horde Framework) with HTTP; Mon, 07 Jul 2008 16:43:39 -0400 Message-ID: <20080707164339.10063b9lns9zqh2c@www.san.navalradio.cl> Date: Mon, 07 Jul 2008 16:43:39 -0400 From: Mikhail Goriachev To: Peter Pentchev , delphij@FreeBSD.org, ports@FreeBSD.org References: <20080704132215.36754y85s8y8kisk@www.san.navalradio.cl> <20080704221500.GA1118@straylight.m.ringlet.net> <20080704223432.49566vn60rygljk8@www.san.navalradio.cl> <20080705075249.GA1145@straylight.m.ringlet.net> In-Reply-To: <20080705075249.GA1145@straylight.m.ringlet.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.2-RC2) / FreeBSD-6.2 Cc: Subject: Re: FreeBSD Port: openldap-server-2.4.10 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2008 20:43:46 -0000 Quoting Peter Pentchev : > On Fri, Jul 04, 2008 at 10:34:32PM -0400, Mikhail Goriachev wrote: >> Quoting Peter Pentchev : >> >> > On Fri, Jul 04, 2008 at 01:22:15PM -0400, Mikhail Goriachev wrote: >> >> Hi, >> > [snip] >> >> I slapped together a workaround. Here's a "patch", maybe the idea of >> >> it will be of some use. >> > >> > Just a minor comment on the patch: >> > >> >> +DBDIR=3D`grep directory /usr/local/etc/openldap/slapd.conf | awk '{ >> >> print $2 }'` >> > >> > This is better written as >> > >> > awk '/directory/ {print $2}' /usr/local/etc/openldap/slapd.conf >> >> Nice one! >> >> > or possibly (I'm not quite familiar with the slapd.conf syntax) even: >> > >> > awk '$1 =3D=3D "directory" {print $2}' /usr/local/etc/openldap/slapd.= conf >> >> They both work but I like the first one more. > > Actually the second one might be better - the first one may be confused > by the string "directory" appearing either in a comment or in the string > value of some other parameter or even in the *name* of some other > parameter. Oh, didn't really see the meaning of the second line before. Thanks a =20 lot for that. And the patch goes again: --- slapd.sh.in.orig 2008-07-05 18:47:30.000000000 +0000 +++ slapd.sh.in 2008-07-05 18:53:00.000000000 +0000 @@ -39,6 +39,8 @@ # extract user and group, adjust ownership of directories and database +DBDIR=3D`awk '$1 =3D=3D "directory" {print $2}' =20 "%%PREFIX%%/etc/openldap/slapd.conf"` + start_precmd() { local slapd_ownername slapd_groupname @@ -48,8 +50,8 @@ ;; *) chown "$slapd_owner" "%%LDAP_RUN_DIR%%" - chown -RL "$slapd_owner" "%%DATABASEDIR%%" - chmod 700 "%%DATABASEDIR%%" + chown -RL "$slapd_owner" "${DBDIR}" + chmod 700 "${DBDIR}" chown "$slapd_owner" "%%PREFIX%%/etc/openldap/slapd.conf" slapd_ownername=3D"${slapd_owner%:*}" Regards, Mikhail. --=20 Mikhail Goriachev Webanoide