From: nekral-guest Date: Sun, 18 Sep 2011 20:26:27 +0000 (+0000) Subject: * src/grpconv.c: Fail if not called correctly. X-Git-Tag: 4.1.5~106 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2b5ba27ff8bf26033ee7fbbf25c7db4723685b33;p=thirdparty%2Fshadow.git * src/grpconv.c: Fail if not called correctly. * src/grpconv.c: At the end of main, the passwd and shadow files are locked. No need to check before unlocking. No need to set the lock as false neither since there cannot be anymore failures. --- diff --git a/ChangeLog b/ChangeLog index 0719280ab..a640db71b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-09-18 Nicolas François + + * src/grpconv.c: Fail if not called correctly. + * src/grpconv.c: At the end of main, the passwd and shadow files + are locked. No need to check before unlocking. No need to set the + lock as false neither since there cannot be anymore failures. + 2011-09-18 Nicolas François * src/chage.c: EPOCH is not needed, it's converted to -1 by diff --git a/src/grpconv.c b/src/grpconv.c index 86038bdee..c0375a4dd 100644 --- a/src/grpconv.c +++ b/src/grpconv.c @@ -1,6 +1,7 @@ /* * Copyright (c) 1996 - 2000, Marek Michałkiewicz * Copyright (c) 2002 - 2006, Tomasz Kłoczko + * Copyright (c) 2011 , Nicolas François * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -91,6 +92,7 @@ int main (int argc, char **argv) if (1 != argc) { (void) fputs (_("Usage: grpconv\n"), stderr); + fail_exit (2); } Prog = Basename (argv[0]); @@ -209,13 +211,11 @@ int main (int argc, char **argv) SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ())); /* continue */ } - sgr_locked = false; if (gr_unlock () == 0) { fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ()); SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ())); /* continue */ } - gr_locked = false; nscd_flush_cache ("group");