Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/glibc/extra/etc: nscd
Date: Mon, 29 Aug 2011 05:20:27
Message-Id: 20110829052016.411FB2004C@flycatcher.gentoo.org
1 vapier 11/08/29 05:20:16
2
3 Modified: nscd
4 Log:
5 use `checkpath` to create missing dirs, tighten up warning, and tweak pidfile handling to avoid `dirname` exec
6
7 Revision Changes Path
8 1.4 src/patchsets/glibc/extra/etc/nscd
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/extra/etc/nscd?rev=1.4&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/extra/etc/nscd?rev=1.4&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/extra/etc/nscd?r1=1.3&r2=1.4
13
14 Index: nscd
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo/src/patchsets/glibc/extra/etc/nscd,v
17 retrieving revision 1.3
18 retrieving revision 1.4
19 diff -u -r1.3 -r1.4
20 --- nscd 18 Sep 2009 12:29:46 -0000 1.3
21 +++ nscd 29 Aug 2011 05:20:16 -0000 1.4
22 @@ -1,7 +1,7 @@
23 #!/sbin/runscript
24 # Copyright 1999-2005 Gentoo Foundation
25 # Distributed under the terms of the GNU General Public License v2
26 -# $Header: /var/cvsroot/gentoo/src/patchsets/glibc/extra/etc/nscd,v 1.3 2009/09/18 12:29:46 flameeyes Exp $
27 +# $Header: /var/cvsroot/gentoo/src/patchsets/glibc/extra/etc/nscd,v 1.4 2011/08/29 05:20:16 vapier Exp $
28
29 depend() {
30 use dns ldap net slapd
31 @@ -9,17 +9,13 @@
32
33 checkconfig() {
34 if [ ! -d /var/run/nscd ] ; then
35 - mkdir -p /var/run/nscd
36 - chmod 755 /var/run/nscd
37 + checkpath -d -m 755 /var/run/nscd
38 fi
39 if [ -z "${NSCD_PERMS_OK}" ] && [ "$(stat -c %a /var/run/nscd)" != "755" ] ; then
40 - echo ""
41 ewarn "nscd run dir is not world readable, you should reset the perms:"
42 ewarn "chmod 755 /var/run/nscd"
43 ewarn "chmod a+rw /var/run/nscd/socket"
44 - echo ""
45 ewarn "To disable this warning, set 'NSCD_PERMS_OK' in /etc/conf.d/nscd"
46 - echo ""
47 fi
48 }
49
50 @@ -27,6 +23,7 @@
51 checkconfig
52
53 ebegin "Starting Name Service Cache Daemon"
54 +
55 local secure=`while read curline ; do
56 table=${curline%:*}
57 entries=${curline##$table:}
58 @@ -44,8 +41,10 @@
59 ;;
60 esac
61 done < /etc/nsswitch.conf`
62 - local pidfile=@PIDFILE@
63 - mkdir -p "$(dirname ${pidfile})"
64 +
65 + local pidfile="@PIDFILE@"
66 + mkdir -p "${pidfile%/*}"
67 +
68 start-stop-daemon --start --quiet \
69 --exec /usr/sbin/nscd --pidfile ${pidfile} \
70 -- $secure
71 @@ -53,7 +52,7 @@
72 }
73
74 stop() {
75 - local pidfile=@PIDFILE@
76 + local pidfile="@PIDFILE@"
77 ebegin "Shutting down Name Service Cache Daemon"
78 start-stop-daemon --stop --quiet \
79 --exec /usr/sbin/nscd --pidfile ${pidfile}