* nscd/nscd.c: Adjust some error codes to fit in better with lsb3.
* nscd/connections.c: Likewise.
+2005-06-20 Ulrich Drepper <drepper@redhat.com>
+
+ * nscd/nscd.init: Get more in line with lsb3.
+ * nscd/nscd.c: Adjust some error codes to fit in better with lsb3.
+ * nscd/connections.c: Likewise.
+
2005-06-20 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/sys/quota.h: Add definitions and types for
if (server_user != NULL && secure_in_use)
{
dbg_log (_("Cannot run nscd in secure mode as unprivileged user"));
- exit (1);
+ exit (4);
}
/* Look up unprivileged uid/gid/groups before we start listening on the
if (sock < 0)
{
dbg_log (_("cannot open socket: %s"), strerror (errno));
- exit (1);
+ exit (errno == EACCES ? 4 : 1);
}
/* Bind a name to the socket. */
struct sockaddr_un sock_addr;
if (bind (sock, (struct sockaddr *) &sock_addr, sizeof (sock_addr)) < 0)
{
dbg_log ("%s: %s", _PATH_NSCDSOCKET, strerror (errno));
- exit (1);
+ exit (errno == EACCES ? 4 : 1);
}
/* We don't want to get stuck on accept. */
{
dbg_log (_("Failed to run nscd as user '%s'"), server_user);
perror ("setgid");
- exit (1);
+ exit (4);
}
if (setuid (server_uid) == -1)
{
dbg_log (_("Failed to run nscd as user '%s'"), server_user);
perror ("setuid");
- exit (1);
+ exit (4);
}
}
{
error (0, 0, gettext ("wrong number of arguments"));
argp_help (&argp, stdout, ARGP_HELP_SEE, program_invocation_short_name);
- exit (EXIT_FAILURE);
+ exit (1);
}
/* Read the configuration file. */
case 'K':
if (getuid () != 0)
- error (EXIT_FAILURE, 0, _("Only root is allowed to use this option!"));
+ error (4, 0, _("Only root is allowed to use this option!"));
{
int sock = nscd_open_socket ();
request_header req;
case 'i':
if (getuid () != 0)
- error (EXIT_FAILURE, 0, _("Only root is allowed to use this option!"));
+ error (4, 0, _("Only root is allowed to use this option!"));
else
{
int sock = nscd_open_socket ();
# processname: /usr/sbin/nscd
# config: /etc/nscd.conf
#
+### BEGIN INIT INFO
+# Provides: nscd
+# Required-Start: $syslog
+# Default-Stop: 0 1 6
+# Short-Description: Starts the Name Switch Cache Daemon
+# Description: This is a daemon which handles passwd and group lookups \
+# for running programs and cache the results for the next \
+# query. You should start this daemon if you use \
+# slow naming services like NIS, NIS+, LDAP, or hesiod.
+### END INIT INFO
# Sanity checks.
[ -f /etc/nscd.conf ] || exit 0
;;
*)
#this is not
- exit 0
+ exit 1
;;
esac
restart
RETVAL=$?
;;
- condrestart)
+ try-restart | condrestart)
[ -e /var/lock/subsys/nscd ] && restart
RETVAL=$?
;;
- reload)
+ force-reload | reload)
echo -n $"Reloading $prog: "
killproc /usr/sbin/nscd -HUP
RETVAL=$?
/* SELinux access controls for nscd.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Matthew Rickard <mjricka@epoch.ncsc.mil>, 2004.
static int audit_fd = -1;
/* When an avc denial occurs, log it to audit system */
-static void
+static void
log_callback (const char *fmt, ...)
{
va_list ap;
}
/* Initialize the connection to the audit system */
-static void
+static void
audit_init (void)
{
audit_fd = audit_open ();