Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nslcd/shadow.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2007-07-26 13:58:47 +0200
committerArthur de Jong <arthur@arthurdejong.org>2007-07-26 13:58:47 +0200
commite89ff82e87617f17091212a512f11666b931623a (patch)
tree3bae7b0e1dab8e3e4abb9e2baa12f267324de502 /nslcd/shadow.c
parent04782c6e4f74a7620363ddbc072f094f6ccda425 (diff)
move some shadow specific functions to shadow.c
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@329 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd/shadow.c')
-rw-r--r--nslcd/shadow.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/nslcd/shadow.c b/nslcd/shadow.c
index e453ba0..53e9baa 100644
--- a/nslcd/shadow.c
+++ b/nslcd/shadow.c
@@ -49,6 +49,40 @@
#include "common.h"
#include "log.h"
#include "attmap.h"
+#include "cfg.h"
+
+static int
+_nss_ldap_shadow_date (const char *val)
+{
+ int date;
+
+ if (nslcd_cfg->ldc_shadow_type == LS_AD_SHADOW)
+ {
+ date = atoll (val) / 864000000000LL - 134774LL;
+ date = (date > 99999) ? 99999 : date;
+ }
+ else
+ {
+ date = atol (val);
+ }
+
+ return date;
+}
+
+#ifndef UF_DONT_EXPIRE_PASSWD
+#define UF_DONT_EXPIRE_PASSWD 0x10000
+#endif
+
+static void
+_nss_ldap_shadow_handle_flag (struct spwd *sp)
+{
+ if (nslcd_cfg->ldc_shadow_type == LS_AD_SHADOW)
+ {
+ if (sp->sp_flag & UF_DONT_EXPIRE_PASSWD)
+ sp->sp_max = 99999;
+ sp->sp_flag = 0;
+ }
+}
static enum nss_status _nss_ldap_parse_sp(LDAPMessage *e,
struct ldap_state UNUSED(*pvt),