Mercurial > hg > toybox
changeset 637:9aeea680acc7
Use "_password" instead of "_passwd" for names in lib/password.c.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 21 Jul 2012 18:38:36 -0500 |
parents | 42ae383499c5 |
children | 92200901cfe1 |
files | lib/lib.h lib/password.c toys/login.c toys/passwd.c |
diffstat | 4 files changed, 10 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/lib.h Sat Jul 21 18:37:26 2012 -0500 +++ b/lib/lib.h Sat Jul 21 18:38:36 2012 -0500 @@ -170,6 +170,6 @@ mode_t string_to_mode(char *mode_str, mode_t base); // password helper functions -int read_passwd(char * buff, int buflen, char* mesg); -int update_passwd(char *filename, char* username, char* encrypted); +int read_password(char * buff, int buflen, char* mesg); +int update_password(char *filename, char* username, char* encrypted);
--- a/lib/password.c Sat Jul 21 18:37:26 2012 -0500 +++ b/lib/password.c Sat Jul 21 18:38:36 2012 -0500 @@ -8,7 +8,7 @@ #include <time.h> -int read_passwd(char * buff, int buflen, char* mesg) +int read_password(char * buff, int buflen, char* mesg) { int i = 0; struct termios termio, oldtermio; @@ -52,7 +52,7 @@ return current_ptr; } -int update_passwd(char *filename, char* username, char* encrypted) +int update_password(char *filename, char* username, char* encrypted) { char *filenamesfx = NULL, *namesfx = NULL; char *shadow = NULL, *sfx = NULL;
--- a/toys/login.c Sat Jul 21 18:37:26 2012 -0500 +++ b/toys/login.c Sat Jul 21 18:38:36 2012 -0500 @@ -71,7 +71,7 @@ { char * pass; - if (read_passwd(toybuf, sizeof(toybuf), "Password: ")) + if (read_password(toybuf, sizeof(toybuf), "Password: ")) return 1; if (!pwd) return 1;
--- a/toys/passwd.c Sat Jul 21 18:37:26 2012 -0500 +++ b/toys/passwd.c Sat Jul 21 18:38:36 2012 -0500 @@ -144,12 +144,12 @@ { char *newp = NULL; - if(read_passwd(toybuf, sizeof(toybuf), "New password:")) + if(read_password(toybuf, sizeof(toybuf), "New password:")) return NULL; //may be due to Ctrl-C newp = xstrdup(toybuf); strength_check(newp, oldp, user); - if(read_passwd(toybuf, sizeof(toybuf), "Retype password:")) { + if(read_password(toybuf, sizeof(toybuf), "Retype password:")) { free(newp); return NULL; //may be due to Ctrl-C } @@ -210,7 +210,7 @@ if(myuid != 0) { /*Validate user */ - if(read_passwd(toybuf, sizeof(toybuf), "Origial password:")) { + if(read_password(toybuf, sizeof(toybuf), "Origial password:")) { if(!toys.optargs[0]) free(name); return; } @@ -259,9 +259,9 @@ /*Update the passwd */ if(pw->pw_passwd[0] == 'x') - ret = update_passwd("/etc/shadow", name, encrypted); + ret = update_password("/etc/shadow", name, encrypted); else - ret = update_passwd("/etc/passwd", name, encrypted); + ret = update_password("/etc/passwd", name, encrypted); if((toys.optflags & (FLAG_l | FLAG_u | FLAG_d))) free(encrypted);