+2011-09-18 Nicolas François <nicolas.francois@centraliens.net>
+
+ * src/pwconv.c: Fail if not called correctly.
+ * src/pwconv.c: At the end of main, the passwd and shadow files
+ are locked. No need to check before unlocking.
+
2011-09-18 Nicolas François <nicolas.francois@centraliens.net>
* src/newusers.c: Initially set the passwd's password to '*'
/*
* Copyright (c) 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2002 - 2006, Tomasz Kłoczko
- * Copyright (c) 2009 , Nicolas François
+ * Copyright (c) 2009 - 2011, Nicolas François
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
if (1 != argc) {
(void) fputs (_("Usage: pwconv\n"), stderr);
+ fail_exit (E_USAGE);
}
Prog = Basename (argv[0]);
/* continue */
}
- if (pw_locked) {
- if (pw_unlock () == 0) {
- fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
- /* continue */
- }
+ if (pw_unlock () == 0) {
+ fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
+ SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ /* continue */
}
- if (spw_locked) {
- if (spw_unlock () == 0) {
- fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
- /* continue */
- }
+ if (spw_unlock () == 0) {
+ fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
+ SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+ /* continue */
}
nscd_flush_cache ("passwd");