Browse Source

shadow: fixed nscd to ignore exit 1 code

Note:

If nscd is installed but not in use, then running `nscd -i` will exit(1).
We shouldn't warn in this case since this is not abnormal behavior.

Example: useradd
---------------------------------------------------------------------------
useradd: nscd exited with status 1useradd: Failed to flush the nscd cache.
---------------------------------------------------------------------------
user/chris/test/arm
Christian Wiese 13 years ago
parent
commit
9358b3548b
  1. 46
      base/shadow/shadow-4.1.5-nscd-ignore-exit-1.patch

46
base/shadow/shadow-4.1.5-nscd-ignore-exit-1.patch

@ -0,0 +1,46 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../shadow/shadow-4.1.5-nscd-ignore-exit-1.patch
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
From 357ff92218a68f2ea74b9d08867c662571012bbe Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Sun, 12 Feb 2012 23:37:04 -0500
Subject: [PATCH 3/3] nscd: ignore exit 1 code
If nscd is installed but not in use, then running `nscd -i` will exit(1).
We shouldn't warn in this case since this is not abnormal behavior.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
lib/nscd.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/lib/nscd.c b/lib/nscd.c
index ea1dc55..7adb58f 100644
--- a/lib/nscd.c
+++ b/lib/nscd.c
@@ -39,6 +39,9 @@ int nscd_flush_cache (const char *service)
/* nscd is not installed, or it is installed but uses an
interpreter that is missing. Probably the former. */
return 0;
+ } else if (code == 1) {
+ /* nscd is installed, but it isn't active. */
+ return 0;
} else if (code != 0) {
(void) fprintf (stderr, _("%s: nscd exited with status %d\n"),
Prog, code);
--
1.7.8.4
Loading…
Cancel
Save