passwd: rework:

* do not make backup copy by copying (just retain old file)
* correctly fall back to /etc/passwd if user is not in shadow
* fix bug with overlong passwd entries
* be permissive on some kinds of failures
* reduce stack usage
* code size: -500 bytes
This commit is contained in:
Denis Vlasenko
2006-11-30 16:41:15 +00:00
parent b8bb27c7ea
commit ab24e18c7a
5 changed files with 288 additions and 320 deletions

View File

@@ -60,7 +60,7 @@ char *bb_askpass(int timeout, const char * prompt)
(read did not overwrite it) */
do {
if (passwd[i] == '\r' || passwd[i] == '\n')
passwd[i] = 0;
passwd[i] = '\0';
} while (passwd[i++]);
}