aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-04-24 21:52:57 +0000
committerCorinna Vinschen <corinna@vinschen.de>2001-04-24 21:52:57 +0000
commitb7cf6a2f5b7ba5236d5c105029d37f74b9a463a6 (patch)
treeeb6f819681c256307d66700c5c0fb04267569646
parent3c73ae1c1e7007777e5c8e6a089d3494092fd69e (diff)
downloadnewlib-b7cf6a2f5b7ba5236d5c105029d37f74b9a463a6.zip
newlib-b7cf6a2f5b7ba5236d5c105029d37f74b9a463a6.tar.gz
newlib-b7cf6a2f5b7ba5236d5c105029d37f74b9a463a6.tar.bz2
* passwd.cc (getpwnam_r): Add pw_passwd handling as well.
(getpwuid_r): Ditto.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/passwd.cc10
2 files changed, 13 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 582f637..974298c 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+Tue Apr 24 23:51:00 2001 Corinna Vinschen <corinna@vinschen.de>
+
+ * passwd.cc (getpwnam_r): Add pw_passwd handling as well.
+ (getpwuid_r): Ditto.
+
Tue Apr 24 23:43:00 2001 Corinna Vinschen <corinna@vinschen.de>
* passwd.cc (getpwnam_r): Use correct offsets into buffer.
diff --git a/winsup/cygwin/passwd.cc b/winsup/cygwin/passwd.cc
index 405d8d8..8440864 100644
--- a/winsup/cygwin/passwd.cc
+++ b/winsup/cygwin/passwd.cc
@@ -231,7 +231,8 @@ getpwuid_r (uid_t uid, struct passwd *pwd, char *buffer, size_t bufsize, struct
/* check needed buffer size. */
size_t needsize = strlen (temppw->pw_name) + strlen (temppw->pw_dir) +
- strlen (temppw->pw_shell) + strlen (temppw->pw_gecos) + 4;
+ strlen (temppw->pw_shell) + strlen (temppw->pw_gecos) +
+ strlen (temppw->pw_passwd) + 5;
if (needsize > bufsize)
return ERANGE;
@@ -243,10 +244,12 @@ getpwuid_r (uid_t uid, struct passwd *pwd, char *buffer, size_t bufsize, struct
pwd->pw_dir = pwd->pw_name + strlen (temppw->pw_name) + 1;
pwd->pw_shell = pwd->pw_dir + strlen (temppw->pw_dir) + 1;
pwd->pw_gecos = pwd->pw_shell + strlen (temppw->pw_shell) + 1;
+ pwd->pw_passwd = pwd->pw_gecos + strlen (temppw->pw_gecos) + 1;
strcpy (pwd->pw_name, temppw->pw_name);
strcpy (pwd->pw_dir, temppw->pw_dir);
strcpy (pwd->pw_shell, temppw->pw_shell);
strcpy (pwd->pw_gecos, temppw->pw_gecos);
+ strcpy (pwd->pw_passwd, temppw->pw_passwd);
return 0;
}
@@ -286,7 +289,8 @@ getpwnam_r (const char *nam, struct passwd *pwd, char *buffer, size_t bufsize, s
/* check needed buffer size. */
size_t needsize = strlen (temppw->pw_name) + strlen (temppw->pw_dir) +
- strlen (temppw->pw_shell) + strlen (temppw->pw_gecos) + 4;
+ strlen (temppw->pw_shell) + strlen (temppw->pw_gecos) +
+ strlen (temppw->pw_passwd) + 5;
if (needsize > bufsize)
return ERANGE;
@@ -298,10 +302,12 @@ getpwnam_r (const char *nam, struct passwd *pwd, char *buffer, size_t bufsize, s
pwd->pw_dir = pwd->pw_name + strlen (temppw->pw_name) + 1;
pwd->pw_shell = pwd->pw_dir + strlen (temppw->pw_dir) + 1;
pwd->pw_gecos = pwd->pw_shell + strlen (temppw->pw_shell) + 1;
+ pwd->pw_passwd = pwd->pw_gecos + strlen (temppw->pw_gecos) + 1;
strcpy (pwd->pw_name, temppw->pw_name);
strcpy (pwd->pw_dir, temppw->pw_dir);
strcpy (pwd->pw_shell, temppw->pw_shell);
strcpy (pwd->pw_gecos, temppw->pw_gecos);
+ strcpy (pwd->pw_passwd, temppw->pw_passwd);
return 0;
}