From cab563c7d244549db189c70e1c9231c20c7fea8a Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sun, 30 Sep 2018 18:11:22 +0000 Subject: Fix (hopefully) nsss_unix_shadow_get() --- AUTHORS | 3 +++ NEWS | 6 ++++++ doc/index.html | 2 +- doc/upgrade.html | 6 ++++++ package/info | 2 +- src/libnsss/nsss_unix_shadow_get.c | 21 ++++++++++++++------- 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 +Contributors: + John Regan + Thanks to: A. Wilcox Elizabeth Meyers 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 s6-ipcserver).

Download

    -
  • The current released version of nsss is 0.0.1.0.
  • +
  • The current released version of nsss is 0.0.1.1.
  • Alternatively, you can checkout a copy of the nsss git repository: 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 @@

    What has changed in nsss

    +

    in 0.0.1.1

    + +

    + No functional changes. +

    +

    in 0.0.1.0

    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 #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 ; } -- cgit v1.2.3