Bug#428884: bashism in init script fails to start nscd
Package: nscd
Version: 2.3.6.ds1-8
Severity: important
Tags: patch
Hi,
I've reported a similar bug to the sendmail-bin postinst script
some time ago, you'll find it at
| http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=424213
for reference and deeper information.
The script defines a shell function "stop()", however, all Korn
shells have "stop" defined as builtin alias (unalias would work,
but in the below patch, I've renamed the stop() function and,
for consistency, the start() function).
Maybe someone should scan all Debian packages for that issue.
I'd be appreciated if you apply the patch in a follow-up release,
as Debian Policy states that scripts beginning with #!/bin/sh must
be portable.
Thanks!
-- System Information:
Debian Release: 4.0
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/mksh
Kernel: Linux 2.6.18-4-k7
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Versions of packages nscd depends on:
ii libc6 2.3.6.ds1-13 GNU C Library: Shared libraries
nscd recommends no packages.
--- nscd.orig 2007-06-14 22:07:35.000000000 +0000
+++ /etc/init.d/nscd 2007-06-14 22:08:07.000000000 +0000
@@ -21,7 +21,7 @@ umask 022
[ -x "$DAEMON" ] || exit 0
[ -d /var/run/nscd ] || mkdir -p /var/run/nscd
-start()
+start_nscd()
{
# Return
# 0 if daemon has been started
@@ -40,7 +40,7 @@ start()
$SECURE || return 2
}
-stop()
+stop_nscd()
{
# Return
# 0 if daemon has been stopped
@@ -68,7 +68,7 @@ status()
case "$1" in
start)
echo -n "Starting $DESC: $NAME"
- start
+ start_nscd
case "$?" in
0) echo "." ; exit 0 ;;
1) echo " (already running)." ; exit 0 ;;
@@ -77,7 +77,7 @@ start)
;;
stop)
echo -n "Stopping $DESC: $NAME"
- stop
+ stop_nscd
case "$?" in
0) echo "." ; exit 0 ;;
1) echo " (not running)." ; exit 0 ;;
@@ -86,11 +86,11 @@ stop)
;;
restart|force-reload|reload)
echo -n "Restarting $DESC: $NAME"
- stop
+ stop_nscd
$DAEMON --invalidate passwd --invalidate group
case "$?" in
0|1)
- start
+ start_nscd
case "$?" in
0) echo "." ; exit 0 ;;
1) echo " (failed -- old process is still running)." ; exit 1 ;;
Reply to: