Use "_password" instead of "_passwd" for names in lib/password.c.
authorRob Landley <rob@landley.net>
Sat, 21 Jul 2012 23:38:36 +0000 (18:38 -0500)
committerRob Landley <rob@landley.net>
Sat, 21 Jul 2012 23:38:36 +0000 (18:38 -0500)
lib/lib.h
lib/password.c
toys/login.c
toys/passwd.c

index de2e214..992d7d2 100644 (file)
--- a/lib/lib.h
+++ b/lib/lib.h
@@ -170,6 +170,6 @@ char *num_to_sig(int sig);
 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);
 
index 2b11144..8221a02 100644 (file)
@@ -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 @@ static char *get_nextcolon(const char *line, char delim)
     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;
index 78fa55f..ac04adb 100644 (file)
@@ -71,7 +71,7 @@ int verify_password(char * pwd)
 {
        char * pass;
 
-       if (read_passwd(toybuf, sizeof(toybuf), "Password: "))
+       if (read_password(toybuf, sizeof(toybuf), "Password: "))
                return 1;
        if (!pwd)
                return 1;
index 501ce95..122cd94 100644 (file)
@@ -144,12 +144,12 @@ static char *new_password(char *oldp, char *user)
 {
     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 @@ void passwd_main(void)
         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 @@ void passwd_main(void)
 
     /*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);