Quoting Peter Pentchev <[EMAIL PROTECTED]>:

On Fri, Jul 04, 2008 at 10:34:32PM -0400, Mikhail Goriachev wrote:
Quoting Peter Pentchev <[EMAIL PROTECTED]>:

> 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=`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 == "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 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=`awk '$1 == "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="${slapd_owner%:*}"





Regards,
Mikhail.


--
Mikhail Goriachev
Webanoide

_______________________________________________
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to