about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2018-09-30 18:11:22 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2018-09-30 18:11:22 +0000
commitcab563c7d244549db189c70e1c9231c20c7fea8a (patch)
treee0daaa333a3bf0a03dae764546a45b5dfe755819
parenta312ef9c0b720cafc45f54e64e91967db3c99cbe (diff)
downloadnsss-cab563c7d244549db189c70e1c9231c20c7fea8a.tar.gz
nsss-cab563c7d244549db189c70e1c9231c20c7fea8a.tar.xz
nsss-cab563c7d244549db189c70e1c9231c20c7fea8a.zip
Fix (hopefully) nsss_unix_shadow_get()
-rw-r--r--AUTHORS3
-rw-r--r--NEWS6
-rw-r--r--doc/index.html2
-rw-r--r--doc/upgrade.html6
-rw-r--r--package/info2
-rw-r--r--src/libnsss/nsss_unix_shadow_get.c21
6 files changed, 31 insertions, 9 deletions
diff --git a/AUTHORS b/AUTHORS
index ddbbded..cd38fb3 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,6 +1,9 @@
 Main author:
   Laurent Bercot <ska-skaware@skarnet.org>
 
+Contributors:
+  John Regan <john@jrjrtech.com>
+
 Thanks to:
   A. Wilcox <AWilcox@Wilcox-Tech.com>
   Elizabeth Meyers <elizabeth@interlinked.me>
diff --git a/NEWS b/NEWS
index 6ca3afb..50b6ede 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,11 @@
 Changelog for nsss.
 
+In 0.0.1.1
+----------
+
+ - Bugfixes.
+
+
 In 0.0.1.0
 ----------
 
diff --git a/doc/index.html b/doc/index.html
index 5e54afb..13b14a9 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -100,7 +100,7 @@ for <a href="//skarnet.org/software/s6/s6-ipcserver">s6-ipcserver</a>). </li>
 <h3> Download </h3>
 
 <ul>
- <li> The current released version of nsss is <a href="nsss-0.0.1.0.tar.gz">0.0.1.0</a>. </li>
+ <li> The current released version of nsss is <a href="nsss-0.0.1.1.tar.gz">0.0.1.1</a>. </li>
  <li> Alternatively, you can checkout a copy of the
 <a href="//git.skarnet.org/cgi-bin/cgit.cgi/nsss/">nsss
 git repository</a>:
diff --git a/doc/upgrade.html b/doc/upgrade.html
index 5ff9e3b..b72212a 100644
--- a/doc/upgrade.html
+++ b/doc/upgrade.html
@@ -18,6 +18,12 @@
 
 <h1> What has changed in nsss </h1>
 
+<h2> in 0.0.1.1 </h2>
+
+<p>
+ No functional changes.
+</p>
+
 <h2> in 0.0.1.0 </h2>
 
 <p>
diff --git a/package/info b/package/info
index 2242df4..b48dfba 100644
--- a/package/info
+++ b/package/info
@@ -1,4 +1,4 @@
 package=nsss
-version=0.0.1.0
+version=0.0.1.1
 category=admin
 package_macro_name=NSSS
diff --git a/src/libnsss/nsss_unix_shadow_get.c b/src/libnsss/nsss_unix_shadow_get.c
index 0d87088..1245834 100644
--- a/src/libnsss/nsss_unix_shadow_get.c
+++ b/src/libnsss/nsss_unix_shadow_get.c
@@ -7,6 +7,13 @@
 #include <nsss/nsss-unix.h>
 #include "nsss-unix-internal.h"
 
+static int lscan (char const *s, long *l)
+{
+  if (*s) return !!ulong0_scan(s, (unsigned long *)l) ;
+  *l = -1 ;
+  return 1 ;
+}
+
 static inline int shadow_parseline (struct spwd *sp, char *s, size_t max)
 {
   struct spwd sp2 ;
@@ -15,19 +22,19 @@ static inline int shadow_parseline (struct spwd *sp, char *s, size_t max)
   if (!nsss_unix_field(&sp2.sp_namp, &s)) return 0 ;
   if (!nsss_unix_field(&sp2.sp_pwdp, &s)) return 0 ;
   if (!nsss_unix_field(&p, &s)) return 0 ;
-  if (!ulong0_scan(p, (unsigned long *)&sp2.sp_lstchg)) return 0 ;
+  if (!lscan(p, &sp2.sp_lstchg)) return 0 ;
   if (!nsss_unix_field(&p, &s)) return 0 ;
-  if (!ulong0_scan(p, (unsigned long *)&sp2.sp_min)) return 0 ;
+  if (!lscan(p, &sp2.sp_min)) return 0 ;
   if (!nsss_unix_field(&p, &s)) return 0 ;
-  if (!ulong0_scan(p, (unsigned long *)&sp2.sp_max)) return 0 ;
+  if (!lscan(p, &sp2.sp_max)) return 0 ;
   if (!nsss_unix_field(&p, &s)) return 0 ;
-  if (!ulong0_scan(p, (unsigned long *)&sp2.sp_warn)) return 0 ;
+  if (!lscan(p, &sp2.sp_warn)) return 0 ;
   if (!nsss_unix_field(&p, &s)) return 0 ;
-  if (!ulong0_scan(p, (unsigned long *)&sp2.sp_inact)) return 0 ;
+  if (!lscan(p, &sp2.sp_inact)) return 0 ;
   if (!nsss_unix_field(&p, &s)) return 0 ;
-  if (!ulong0_scan(p, (unsigned long *)&sp2.sp_expire)) return 0 ;
+  if (!lscan(p, &sp2.sp_expire)) return 0 ;
   if (!nsss_unix_field(&p, &s)) return 0 ;
-  if (!ulong0_scan(p, &sp2.sp_flag)) return 0 ;
+  if (!lscan(p, (long *)&sp2.sp_flag)) return 0 ;
   *sp = sp2 ;
   return 1 ;
 }