Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2000-07-02 04:00:17 +0400
committerCorinna Vinschen <corinna@vinschen.de>2000-07-02 04:00:17 +0400
commit760d376e34aee0973a9143d4a85a4e737b40ff39 (patch)
tree8166a99de644cdeca241e90cd4c6c99a2633809a /winsup/cygwin/uinfo.cc
parentebbd4e8fb3078f8393567ca49d80d7fd5926f5f3 (diff)
* uinfo.cc (uinfo_init): Eliminate calls to read_etc_group()
and read_etc_passwd().
Diffstat (limited to 'winsup/cygwin/uinfo.cc')
-rw-r--r--winsup/cygwin/uinfo.cc38
1 files changed, 11 insertions, 27 deletions
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index a643d83dd..b35fbc65a 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -162,11 +162,6 @@ internal_getlogin (struct pinfo *pi)
void
uinfo_init ()
{
- void read_etc_passwd ();
- extern int passwd_in_memory_p;
- void read_etc_group ();
- extern int group_in_memory_p;
-
char *username;
struct passwd *p;
@@ -181,28 +176,17 @@ uinfo_init ()
another cygwin process without changing the user context.
So all user infos in myself as well as the environment are
(perhaps) valid. */
- if (myself->psid)
- {
- if (!passwd_in_memory_p)
- read_etc_passwd();
- if (!group_in_memory_p)
- read_etc_group ();
- }
- else if ((p = getpwnam (username = internal_getlogin (myself))) != NULL)
- {
- /* calling getpwnam assures us that /etc/password has been
- read in, but we can't be sure about /etc/group */
- if (!group_in_memory_p)
- read_etc_group ();
-
- myself->uid = p->pw_uid;
- myself->gid = p->pw_gid;
- }
- else
- {
- myself->uid = DEFAULT_UID;
- myself->gid = DEFAULT_GID;
- }
+ if (!myself->psid)
+ if ((p = getpwnam (username = internal_getlogin (myself))) != NULL)
+ {
+ myself->uid = p->pw_uid;
+ myself->gid = p->pw_gid;
+ }
+ else
+ {
+ myself->uid = DEFAULT_UID;
+ myself->gid = DEFAULT_GID;
+ }
/* Real and effective uid/gid are always identical on process start up.
This is at least true for NT/W2K. */
myself->orig_uid = myself->real_uid = myself->uid;