From owner-freebsd-ports@FreeBSD.ORG Sat Jul 5 02:34:57 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 5A608106566C; Sat, 5 Jul 2008 02:34:57 +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 C41E28FC19; Sat, 5 Jul 2008 02:34:56 +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 m652Ylru031813; Sat, 5 Jul 2008 02:34:47 GMT (envelope-from mikhailg@webanoide.org) Received: from 172.18.96.244 ([172.18.96.244]) by www.san.navalradio.cl (Horde Framework) with HTTP; Fri, 04 Jul 2008 22:34:32 -0400 Message-ID: <20080704223432.49566vn60rygljk8@www.san.navalradio.cl> Date: Fri, 04 Jul 2008 22:34:32 -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> In-Reply-To: <20080704221500.GA1118@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: Sat, 05 Jul 2008 02:34:57 -0000 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.con= f They both work but I like the first one more. > Then there's another thing - it might be better to make this depend on > the actual prefix where the OpenLDAP server is installed (it is not > necessarily /usr/local), but that's a whole different can of beer that > I'm not familiar with, since I don't even have an OpenLDAP server > installed on my system :) Thanks for that. Here's a "proper" working patch. --- slapd.sh.in.original 2008-07-05 01:38:52.000000000 +0000 +++ slapd.sh.in 2008-07-05 01:44:33.000000000 +0000 @@ -39,6 +39,8 @@ # extract user and group, adjust ownership of directories and database +DBDIR=3D`awk '/directory/ {print $2}' %%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