]> sourceware.org Git - newlib-cygwin.git/commitdiff
* autoload.cc (NetGetDCName): Change to make this an optional load function.
authorChristopher Faylor <me@cgf.cx>
Sat, 29 Jun 2002 22:05:30 +0000 (22:05 +0000)
committerChristopher Faylor <me@cgf.cx>
Sat, 29 Jun 2002 22:05:30 +0000 (22:05 +0000)
* cygheap.h (cygheap_user::logsrv): Return NULL when operation fails.
(cygheap_user::winname): Ditto.
(cygheap_user::domain): Ditto.
* uinfo.cc (cygheap_user::env_logsrv): Save results in temp variable.
(cygheap_user::env_userprofile): Ditto.

winsup/cygwin/ChangeLog
winsup/cygwin/autoload.cc
winsup/cygwin/cygheap.h
winsup/cygwin/uinfo.cc

index f314e864fedb27770c151a45d01daef7fefd9243..87ac1a3fe19d000ea25226623fe5ee5541906577 100644 (file)
@@ -1,3 +1,13 @@
+2002-06-29  Christopher Faylor  <cgf@redhat.com>
+
+       * autoload.cc (NetGetDCName): Change to make this an optional load
+       function.
+       * cygheap.h (cygheap_user::logsrv): Return NULL when operation fails.
+       (cygheap_user::winname): Ditto.
+       (cygheap_user::domain): Ditto.
+       * uinfo.cc (cygheap_user::env_logsrv): Save results in temp variable.
+       (cygheap_user::env_userprofile): Ditto.
+
 2002-06-29  Christopher Faylor  <cgf@redhat.com>
 
        * environ.cc (spenv::retrieve): Detect return of env_dontadd from
index d910b43ed1f2818d90bedab9e07d074e48bc7ed9..d37b19975f2435591db6c1b5edea89f17c75f06b 100644 (file)
@@ -371,7 +371,7 @@ LoadDLLfunc (SetSecurityDescriptorOwner, 12, advapi32)
 LoadDLLfunc (SetTokenInformation, 16, advapi32)
 
 LoadDLLfunc (NetApiBufferFree, 4, netapi32)
-LoadDLLfunc (NetGetDCName, 12, netapi32)
+LoadDLLfuncEx (NetGetDCName, 12, netapi32, 1)
 LoadDLLfunc (NetLocalGroupEnum, 28, netapi32)
 LoadDLLfunc (NetLocalGroupGetMembers, 32, netapi32)
 LoadDLLfunc (NetUserGetGroups, 28, netapi32)
index 63585d91a501289aab75ae35fafb45742e32880d..d2e06bfefa036539fa169a3c7027ccb8afb65f97 100644 (file)
@@ -144,15 +144,18 @@ public:
 
   const char *logsrv ()
   {
-    return env_logsrv ("LOGONSERVER=", sizeof ("LOGONSERVER=") - 1);
+    const char *p = env_logsrv ("LOGONSERVER=", sizeof ("LOGONSERVER=") - 1);
+    return (p == almost_null) ? NULL : p;
   }
   const char *winname ()
   {
-    return env_name ("USERNAME=", sizeof ("USERNAME=") - 1);
+    const char *p = env_name ("USERNAME=", sizeof ("USERNAME=") - 1);
+    return (p == almost_null) ? NULL : p;
   }
   const char *domain ()
   {
-    return env_domain ("USERDOMAIN=", sizeof ("USERDOMAIN=") - 1);
+    const char *p = env_domain ("USERDOMAIN=", sizeof ("USERDOMAIN=") - 1);
+    return (p == almost_null) ? NULL : p;
   }
   BOOL set_sid (PSID new_sid);
   BOOL set_orig_sid ();
index ae500049ebd31194b1949d2eec809af4cc74e09e..2b506bde9a61eeaea5f4b0f869a3fa8e10d592e8 100644 (file)
@@ -319,12 +319,14 @@ cygheap_user::env_logsrv (const char *name, size_t namelen)
   if (test_uid (plogsrv, name, namelen))
     return plogsrv;
 
-  if (!domain () || strcasematch (winname (), "SYSTEM"))
+  const char *mydomain = domain ();
+  const char *myname = winname ();
+  if (!mydomain || strcasematch (myname, "SYSTEM"))
     return almost_null;
 
   char logsrv[INTERNET_MAX_HOST_NAME_LENGTH + 3];
   cfree_and_set (plogsrv, almost_null);
-  if (get_logon_server (domain (), logsrv, NULL))
+  if (get_logon_server (mydomain, logsrv, NULL))
     plogsrv = cstrdup (logsrv);
   return plogsrv;
 }
@@ -363,7 +365,8 @@ cygheap_user::env_userprofile (const char *name, size_t namelen)
   char userprofile_env_buf[MAX_PATH + 1];
   cfree_and_set (puserprof, almost_null);
   /* FIXME: Should this just be setting a puserprofile like everything else? */
-  if (!strcasematch (winname (), "SYSTEM")
+  const char *myname = winname ();
+  if (myname && strcasematch (myname, "SYSTEM")
       && get_registry_hive_path (sid (), userprofile_env_buf))
     puserprof = cstrdup (userprofile_env_buf);
 
This page took 0.039868 seconds and 5 git commands to generate.