diff options
| author | Ken Raeburn <raeburn@mit.edu> | 2000-03-16 04:45:13 +0000 |
|---|---|---|
| committer | Ken Raeburn <raeburn@mit.edu> | 2000-03-16 04:45:13 +0000 |
| commit | c1495c19a87199b445e41328eb292f8df439a3f6 (patch) | |
| tree | bf7fcda66efb28d644319676a60a00fbff0ed280 /src | |
| parent | a14e6157d20cbf91c313762965ff32bc55b6eea8 (diff) | |
| download | krb5-c1495c19a87199b445e41328eb292f8df439a3f6.tar.gz krb5-c1495c19a87199b445e41328eb292f8df439a3f6.tar.xz krb5-c1495c19a87199b445e41328eb292f8df439a3f6.zip | |
* login.c (update_ref_count): Copy passwd info before calling getuserattr, to
keep data from getting clobbered. Patch from Mark Roth.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12119 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
| -rw-r--r-- | src/appl/bsd/ChangeLog | 7 | ||||
| -rw-r--r-- | src/appl/bsd/login.c | 12 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 9b9c7c8d0..d3314b08d 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,10 @@ +2000-03-15 Ken Raeburn <raeburn@mit.edu> + Mark D. Roth <roth@uiuc.edu> + + * login.c (update_ref_count): Copy passwd info before calling + getuserattr, to keep data from getting clobbered. Patch from Mark + Roth. + 2000-02-28 Ken Raeburn <raeburn@mit.edu> * krlogin.c (main): Don't output debugging messages if debugging diff --git a/src/appl/bsd/login.c b/src/appl/bsd/login.c index 1832aafb2..40af3ce60 100644 --- a/src/appl/bsd/login.c +++ b/src/appl/bsd/login.c @@ -2411,10 +2411,22 @@ char *strsave(sp) #ifdef _IBMR2 update_ref_count(int adj) { + struct passwd *save_pwd; static char *empty = "\0"; char *grp; int i; + /* save pwd before calling getuserattr() */ + save_pwd = (struct passwd *)malloc(sizeof(struct passwd)); + save_pwd->pw_name = strdup(pwd->pw_name); + save_pwd->pw_passwd = strdup(pwd->pw_passwd); + save_pwd->pw_uid = pwd->pw_uid; + save_pwd->pw_gid = pwd->pw_gid; + save_pwd->pw_gecos = strdup(pwd->pw_gecos); + save_pwd->pw_dir = strdup(pwd->pw_dir); + save_pwd->pw_shell = strdup(pwd->pw_shell); + pwd = save_pwd; + /* Update reference count on all user's temporary groups */ setuserdb(S_READ|S_WRITE); if (getuserattr(username, S_GROUPS, (void *)&grp, SEC_LIST) == 0) { |
