summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoshuashire <joshuashire@hotmail.com>2014-01-24 12:29:21 -0700
committerArthur de Jong <arthur@arthurdejong.org>2014-01-25 17:40:48 +0100
commit2181ccadc22f3e670b34bc531e7e8a7d33731a95 (patch)
tree542b5a179e09a7bb9a8a301df2205ced5a3c1c2c
parentc6c317ec9efb8190bdc1834091c4761b60637e7f (diff)
Update shadow.c to resolve pwdLastSet issue
We read the date into the buffer to the specified length to get it to the Unix time (i.e. seconds) from its AD value of nanoseconds, then convert it to days for shadow. If we use date rather than buffer we end up trying to convert the original nanosecond value.
-rw-r--r--nslcd/shadow.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nslcd/shadow.c b/nslcd/shadow.c
index a70efdc..b5cf021 100644
--- a/nslcd/shadow.c
+++ b/nslcd/shadow.c
@@ -132,7 +132,7 @@ static long to_date(const char *dn, const char *date, const char *attr)
strncpy(buffer, date, l);
buffer[l] = '\0';
errno = 0;
- value = strtol(date, &tmp, 10);
+ value = strtol(buffer, &tmp, 10);
if ((*date == '\0') || (*tmp != '\0'))
{
log_log(LOG_WARNING, "%s: %s: non-numeric", dn, attr);