Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 07 Jul 2008 16:43:39 -0400
From:      Mikhail Goriachev <mikhailg@webanoide.org>
To:        Peter Pentchev <roam@ringlet.net>, delphij@FreeBSD.org, ports@FreeBSD.org
Subject:   Re: FreeBSD Port: openldap-server-2.4.10
Message-ID:  <20080707164339.10063b9lns9zqh2c@www.san.navalradio.cl>
In-Reply-To: <20080705075249.GA1145@straylight.m.ringlet.net>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
Quoting Peter Pentchev <roam@ringlet.net>:

> On Fri, Jul 04, 2008 at 10:34:32PM -0400, Mikhail Goriachev wrote:
>> Quoting Peter Pentchev <roam@ringlet.net>:
>>
>> > 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080707164339.10063b9lns9zqh2c>