From ae99674e9b54dc15d000f99cd9fab30560b7317e Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sat, 26 Jan 2008 17:41:20 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20build=20failures=20with=20--disable-shado?= =?UTF-8?q?wgrp.=20Thanks=20to=20J=C3=BCrgen=20Daubert=20for=20the=20patch?= =?UTF-8?q?.=20*=20libmisc/salt.c:=20Include=20,=20needed=20for?= =?UTF-8?q?=20stderr=20and=20printf=20=20=20functions.=20*=20lib/encrypt.c?= =?UTF-8?q?:=20Include=20,=20needed=20for=20perror,=20stderr=20an?= =?UTF-8?q?d=20=20=20printf=20functions=20*=20src/usermod.c:=20sgr=5Flocke?= =?UTF-8?q?d=20exists=20only=20if=20SHADOWGRP=20is=20defined.=20*=20src/ch?= =?UTF-8?q?gpasswd.c:=20Only=20check=20is=20the=20gshadow=20file=20exists?= =?UTF-8?q?=20if=20=20=20SHADOWGRP=20is=20defined.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChangeLog | 12 ++++++++++++ lib/encrypt.c | 3 +++ lib/groupio.c | 4 +++- libmisc/salt.c | 1 + src/chgpasswd.c | 2 ++ src/usermod.c | 2 ++ 6 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c2c15998..1bf0a642 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-01-26 Nicolas François + + Fix build failures with --disable-shadowgrp. Thanks to Jürgen + Daubert for the patch. + * libmisc/salt.c: Include , needed for stderr and printf + functions. + * lib/encrypt.c: Include , needed for perror, stderr and + printf functions + * src/usermod.c: sgr_locked exists only if SHADOWGRP is defined. + * src/chgpasswd.c: Only check is the gshadow file exists if + SHADOWGRP is defined. + 2008-01-24 Nicolas François * src/gpasswd.c, src/chfn.c, src/chage.c, src/chsh.c, src/grpck.c, diff --git a/lib/encrypt.c b/lib/encrypt.c index 9a880e83..6b6d270b 100644 --- a/lib/encrypt.c +++ b/lib/encrypt.c @@ -32,8 +32,11 @@ #ident "$Id$" #include +#include + #include "prototypes.h" #include "defines.h" + char *pw_encrypt (const char *clear, const char *salt) { static char cipher[128]; diff --git a/lib/groupio.c b/lib/groupio.c index 7d84dd97..9d9b3d30 100644 --- a/lib/groupio.c +++ b/lib/groupio.c @@ -3,6 +3,8 @@ #ident "$Id$" +#include + #include "prototypes.h" #include "defines.h" #include "commonio.h" @@ -230,7 +232,7 @@ static int group_open_hook (void) * same name, password and gid. * * It merge the members of the second entry in the first one, and return - * the modified first entry on success, or NUll on failure (with errno + * the modified first entry on success, or NULL on failure (with errno * set). */ static struct commonio_entry *merge_group_entries (struct commonio_entry *gr1, diff --git a/libmisc/salt.c b/libmisc/salt.c index 30ac920f..c61d3e19 100644 --- a/libmisc/salt.c +++ b/libmisc/salt.c @@ -13,6 +13,7 @@ #include #include +#include #include #include "prototypes.h" #include "defines.h" diff --git a/src/chgpasswd.c b/src/chgpasswd.c index f2bde98d..77176feb 100644 --- a/src/chgpasswd.c +++ b/src/chgpasswd.c @@ -342,7 +342,9 @@ int main (int argc, char **argv) check_perms (); +#ifdef SHADOWGRP is_shadow_grp = sgr_file_present (); +#endif open_files (); diff --git a/src/usermod.c b/src/usermod.c index 509f365c..d7ff6fdf 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -1113,7 +1113,9 @@ static void close_files (void) pw_locked = 0; spw_locked = 0; gr_locked = 0; +#ifdef SHADOWGRP sgr_locked = 0; +#endif /* * Close the DBM and/or flat files