lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1947 - nss-pam-ldapd-0.8/nslcd

[Date Prev][Date Next] [Thread Prev][Thread Next]

nss-pam-ldapd commit: r1947 - nss-pam-ldapd-0.8/nslcd



Author: arthur
Date: Sun Apr 28 16:50:43 2013
New Revision: 1947
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=1947&view=revision

Log:
handle the case where getpwuid() returns NULL

Modified:
   nss-pam-ldapd-0.8/nslcd/cfg.c

Modified: nss-pam-ldapd-0.8/nslcd/cfg.c
==============================================================================
--- nss-pam-ldapd-0.8/nslcd/cfg.c       Sun Apr 28 16:16:28 2013        (r1946)
+++ nss-pam-ldapd-0.8/nslcd/cfg.c       Sun Apr 28 16:50:43 2013        (r1947)
@@ -459,11 +459,14 @@
   {
     /* get the name and gid from the passwd database */
     pwent=getpwuid(*var);
-    if ((gid!=NULL)&&(*gid==NOGID))
-      *gid=pwent->pw_gid;
-    if (str!=NULL)
-      *str=strdup(pwent->pw_name);
-    return;
+    if (pwent!=NULL)
+    {
+      if ((gid!=NULL)&&(*gid==NOGID))
+        *gid=pwent->pw_gid;
+      if (str!=NULL)
+        *str=strdup(pwent->pw_name);
+      return;
+    }
   }
   /* find by name */
   pwent=getpwnam(token);
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/