fix proposal for 43674

Dorr H. Clark dclark at applmath.scu.edu
Fri May 2 02:34:32 PDT 2003


The problem in 43674 occurs because the implementation 
presumes the cooperation of the user, which is normally 
a sub-optimal strategy for system security.  
If the user chooses not to cooperate, login is not aware.  

Our proposed fix checks whether the user has actually made 
the requested password change before proceeding.  
If they attempt the ^C exploit listed in 43674, 
they are prompted again.

NOTE:  This patch is compatible with 4.7-STABLE !

--- /usr/src/usr.bin/login/login.c      Wed Mar 13 10:45:33 2002
+++ login.c     Mon Apr 28 20:45:24 2003
@@ -704,12 +704,15 @@
        (void)signal(SIGQUIT, SIG_DFL);
        (void)signal(SIGINT, SIG_DFL);
        (void)signal(SIGTSTP, SIG_IGN);
-
-       if (changepass) {
+       while (changepass) {
                if (system(_PATH_CHPASS) != 0)
                        sleepexit(1);
+               pwd = getpwnam(username);
+               if(!pwd->pw_change)
+                       changepass = 0;
+               else
+                       printf("\nSorry!Your password is expired.You have
to
enter a new password.\n\n");
        }
-
        /*
         * Login shells have a leading '-' in front of argv[0]
         */

Kuang-Wu "Kerwin" Hsu, engineer
Dorr H. Clark, advisor
COEN 284 - Operating Systems Case Study 
Santa Clara University, 
Santa Clara CA.





More information about the freebsd-bugs mailing list