summary refs log tree commit diff
path: root/nis/nss_nisplus
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nss_nisplus')
-rw-r--r--nis/nss_nisplus/nisplus-hosts.c2
-rw-r--r--nis/nss_nisplus/nisplus-spwd.c98
2 files changed, 52 insertions, 48 deletions
diff --git a/nis/nss_nisplus/nisplus-hosts.c b/nis/nss_nisplus/nisplus-hosts.c
index 0a005406d1..e6d584dac8 100644
--- a/nis/nss_nisplus/nisplus-hosts.c
+++ b/nis/nss_nisplus/nisplus-hosts.c
@@ -66,7 +66,7 @@ LINE_PARSER
    STRING_FIELD (addr, isspace, 1);
 
    /* Parse address.  */
-   if (inet_pton (AF_INET6, p, entdata->host_addr) > 0)
+   if (inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
      {
        result->h_addrtype = AF_INET6;
        result->h_length = IN6ADDRSZ;
diff --git a/nis/nss_nisplus/nisplus-spwd.c b/nis/nss_nisplus/nisplus-spwd.c
index d426d28684..568a1c4006 100644
--- a/nis/nss_nisplus/nisplus-spwd.c
+++ b/nis/nss_nisplus/nisplus-spwd.c
@@ -44,7 +44,6 @@ _nss_nisplus_parse_spent (nis_result *result, struct spwd *sp,
 {
   char *first_unused = buffer;
   size_t room_left = buflen;
-  char *line, *cp;
 
   if (result == NULL)
     return 0;
@@ -85,52 +84,57 @@ _nss_nisplus_parse_spent (nis_result *result, struct spwd *sp,
   sp->sp_lstchg = sp->sp_min = sp->sp_max = sp->sp_warn = sp->sp_inact =
     sp->sp_expire = sp->sp_flag = -1;
 
-  line = NISENTRYVAL (0, 7, result);
-  cp = strchr (line, ':');
-  if (cp == NULL)
-    return 0;
-  *cp++ = '\0';
-  sp->sp_lstchg = atol (line);
-
-  line = cp;
-  cp = strchr (line, ':');
-  if (cp == NULL)
-    return 0;
-  *cp++ = '\0';
-  sp->sp_min = atol(line);
-
-  line = cp;
-  cp = strchr (line, ':');
-  if (cp == NULL)
-    return 0;
-  *cp++ = '\0';
-  sp->sp_max = atol(line);
-
-  line = cp;
-  cp = strchr (line, ':');
-  if (cp == NULL)
-    return 0;
-  *cp++ = '\0';
-  sp->sp_warn = atol(line);
-
-  line = cp;
-  cp = strchr (line, ':');
-  if (cp == NULL)
-    return 0;
-  *cp++ = '\0';
-  sp->sp_inact = atol(line);
-
-  line = cp;
-  cp = strchr (line, ':');
-  if (cp == NULL)
-    return 0;
-  *cp++ = '\0';
-  sp->sp_expire = atol(line);
-
-  line = cp;
-  if (line == NULL)
-    return 0;
-  sp->sp_flag = atol(line);
+  if (NISENTRYVAL (0, 7, result) > 0)
+    {
+      char *line, *cp;
+
+      line = NISENTRYVAL (0, 7, result);
+      cp = strchr (line, ':');
+      if (cp == NULL)
+	return 0;
+      *cp++ = '\0';
+      sp->sp_lstchg = atol (line);
+
+      line = cp;
+      cp = strchr (line, ':');
+      if (cp == NULL)
+	return 0;
+      *cp++ = '\0';
+      sp->sp_min = atol(line);
+
+      line = cp;
+      cp = strchr (line, ':');
+      if (cp == NULL)
+	return 0;
+      *cp++ = '\0';
+      sp->sp_max = atol(line);
+
+      line = cp;
+      cp = strchr (line, ':');
+      if (cp == NULL)
+	return 0;
+      *cp++ = '\0';
+      sp->sp_warn = atol(line);
+
+      line = cp;
+      cp = strchr (line, ':');
+      if (cp == NULL)
+	return 0;
+      *cp++ = '\0';
+      sp->sp_inact = atol(line);
+
+      line = cp;
+      cp = strchr (line, ':');
+      if (cp == NULL)
+	return 0;
+      *cp++ = '\0';
+      sp->sp_expire = atol(line);
+
+      line = cp;
+      if (line == NULL)
+	return 0;
+      sp->sp_flag = atol(line);
+    }
 
   return 1;
 }