diff options
author | George Lebl <jirka@5z.com> | 2004-01-15 20:45:24 +0000 |
---|---|---|
committer | George Lebl <jirka@src.gnome.org> | 2004-01-15 20:45:24 +0000 |
commit | 033a75282965093d0ffeb25d4a62c592d9015ce8 (patch) | |
tree | 9a95278e276a11bbd9d0d7c74879bd03383ab0d4 /daemon | |
parent | 7884d1eb81d38b6d68c1e4c23b74559d932bd94f (diff) | |
download | gdm-033a75282965093d0ffeb25d4a62c592d9015ce8.tar.gz |
Apply patch from Vincent Berger <vincent.berger@ext.bull.net> to re-fix
Thu Jan 15 12:45:02 2004 George Lebl <jirka@5z.com>
* configure.in, daemon/verify-(crypt|shadow).c:
Apply patch from Vincent Berger <vincent.berger@ext.bull.net>
to re-fix #123766 by clearing the ADMCHG token.
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/verify-crypt.c | 37 | ||||
-rw-r--r-- | daemon/verify-shadow.c | 38 |
2 files changed, 75 insertions, 0 deletions
diff --git a/daemon/verify-crypt.c b/daemon/verify-crypt.c index ac1792fa..885f9820 100644 --- a/daemon/verify-crypt.c +++ b/daemon/verify-crypt.c @@ -25,6 +25,10 @@ #include <sys/types.h> #include <unistd.h> +#if defined(CAN_CLEAR_ADMCHG) && defined(HAVE_USERSEC_H) +# include <usersec.h> +#endif /* CAN_CLEAR_ADMCHG && HAVE_USERSEC_H */ + #ifdef HAVE_CRYPT # include <crypt.h> #endif /* HAVE_CRYPT */ @@ -321,6 +325,39 @@ authenticate_again: return NULL; } +#if defined(CAN_CLEAR_ADMCHG) + /* The password is changed by root, clear the ADM_CHG + flag in the passwd file */ + ret = setpwdb (S_READ | S_WRITE); + if (!ret) { + upwd = getuserpw (login); + if (upwd == NULL) { + ret = -1; + } else { + upwd->upw_flags &= ~PW_ADMCHG; + ret = putuserpw (upwd); + if (!ret) { + ret = endpwdb (); + } + } + } + + if (ret) { + gdm_error_box (d, GTK_MESSAGE_WARNING, + _("Your password has been changed but " + "you may have to change it again, " + "please try again later or contact " + "your system administrator.")); + } + +#else /* !CAN_CLEAR_ADMCHG */ + gdm_error_box (d, GTK_MESSAGE_WARNING, + _("Your password has been changed but you " + "may have to change it again, please try again " + "later or contact your system administrator.")); + +#endif /* CAN_CLEAR_ADMCHG */ + break; case 2 : diff --git a/daemon/verify-shadow.c b/daemon/verify-shadow.c index 5334a47d..17b56f9f 100644 --- a/daemon/verify-shadow.c +++ b/daemon/verify-shadow.c @@ -26,6 +26,10 @@ #include <sys/types.h> #include <unistd.h> +#if defined(CAN_CLEAR_ADMCHG) && defined(HAVE_USERSEC_H) +# include <usersec.h> +#endif /* CAN_CLEAR_ADMCHG && HAVE_USERSEC_H */ + #ifdef HAVE_CRYPT # include <crypt.h> #endif /* HAVE_CRYPT */ @@ -339,6 +343,40 @@ authenticate_again: return NULL; } +#if defined(CAN_CLEAR_ADMCHG) + /* The password is changed by root, clear the ADM_CHG + flag in the passwd file */ + ret = setpwdb (S_READ | S_WRITE); + if (!ret) { + upwd = getuserpw (login); + if (upwd == NULL) { + ret = -1; + } + else { + upwd->upw_flags &= ~PW_ADMCHG; + ret = putuserpw (upwd); + if (!ret) { + ret = endpwdb (); + } + } + } + + if (ret) { + gdm_error_box (d, GTK_MESSAGE_WARNING, + _("Your password has been changed but " + "you may have to change it again, " + "please try again later or contact " + "your system administrator.")); + } + +#else /* !CAN_CLEAR_ADMCHG */ + gdm_error_box (d, GTK_MESSAGE_WARNING, + _("Your password has been changed but you " + "may have to change it again, please try again " + "later or contact your system administrator.")); + +#endif /* CAN_CLEAR_ADMCHG */ + break; case 2 : |