diff options
Diffstat (limited to 'sys-libs/pam/files/Linux-PAM-1.0.0-set-item.patch')
-rw-r--r-- | sys-libs/pam/files/Linux-PAM-1.0.0-set-item.patch | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/sys-libs/pam/files/Linux-PAM-1.0.0-set-item.patch b/sys-libs/pam/files/Linux-PAM-1.0.0-set-item.patch new file mode 100644 index 000000000000..4a08ee0be9ad --- /dev/null +++ b/sys-libs/pam/files/Linux-PAM-1.0.0-set-item.patch @@ -0,0 +1,67 @@ +Bug #216702, allow changing password from user. + +Index: pam_item.c +=================================================================== +RCS file: /cvsroot/pam/Linux-PAM/libpam/pam_item.c,v +retrieving revision 1.16 +diff -u -p -r1.16 pam_item.c +--- libpam/pam_item.c 3 Mar 2008 13:23:45 -0000 1.16 ++++ libpam/pam_item.c 7 Apr 2008 09:04:50 -0000 +@@ -11,13 +11,15 @@ + #include <string.h> + #include <syslog.h> + +-#define TRY_SET(X, Y) \ +-{ \ +- char *_TMP_ = _pam_strdup(Y); \ +- if (_TMP_ == NULL && (Y) != NULL) \ +- return PAM_BUF_ERR; \ +- free(X); \ +- (X) = _TMP_; \ ++#define TRY_SET(X, Y) \ ++{ \ ++ if ((X) != (Y)) { \ ++ char *_TMP_ = _pam_strdup(Y); \ ++ if (_TMP_ == NULL && (Y) != NULL) \ ++ return PAM_BUF_ERR; \ ++ free(X); \ ++ (X) = _TMP_; \ ++ } \ + } + + /* functions */ +@@ -76,8 +78,10 @@ int pam_set_item (pam_handle_t *pamh, in + * modules. + */ + if (__PAM_FROM_MODULE(pamh)) { +- _pam_overwrite(pamh->authtok); +- TRY_SET(pamh->authtok, item); ++ if (pamh->authtok != item) { ++ _pam_overwrite(pamh->authtok); ++ TRY_SET(pamh->authtok, item); ++ } + } else { + retval = PAM_BAD_ITEM; + } +@@ -90,8 +94,10 @@ int pam_set_item (pam_handle_t *pamh, in + * modules. + */ + if (__PAM_FROM_MODULE(pamh)) { +- _pam_overwrite(pamh->oldauthtok); +- TRY_SET(pamh->oldauthtok, item); ++ if (pamh->oldauthtok != item) { ++ _pam_overwrite(pamh->oldauthtok); ++ TRY_SET(pamh->oldauthtok, item); ++ } + } else { + retval = PAM_BAD_ITEM; + } +@@ -130,6 +136,8 @@ int pam_set_item (pam_handle_t *pamh, in + break; + + case PAM_XAUTHDATA: ++ if (&pamh->xauth == item) ++ break; + if (pamh->xauth.namelen) { + _pam_overwrite(pamh->xauth.name); + free(pamh->xauth.name); |