summaryrefslogtreecommitdiff
path: root/nslcd
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2009-09-01 13:26:54 +0000
committerArthur de Jong <arthur@arthurdejong.org>2009-09-01 13:26:54 +0000
commitf01ae9b9db912f5a110ae6894f2217f0f40bb50a (patch)
treea16ad1a5c30d2f7de37906b619296d41b1313602 /nslcd
parentb3b84958abd26e338e47f0806644311d3867ccda (diff)
parenteac5616ac2b6f38a202f1038f8e9eedbfeb2fda5 (diff)
rename trunk to nss-pam-ldapd
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@981 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd')
-rw-r--r--nslcd/alias.c2
-rw-r--r--nslcd/attmap.c2
-rw-r--r--nslcd/attmap.h2
-rw-r--r--nslcd/cfg.c2
-rw-r--r--nslcd/cfg.h2
-rw-r--r--nslcd/common.c2
-rw-r--r--nslcd/common.h17
-rw-r--r--nslcd/ether.c2
-rw-r--r--nslcd/group.c4
-rw-r--r--nslcd/host.c2
-rw-r--r--nslcd/myldap.c2
-rw-r--r--nslcd/myldap.h2
-rw-r--r--nslcd/netgroup.c2
-rw-r--r--nslcd/network.c2
-rw-r--r--nslcd/nslcd.c8
-rw-r--r--nslcd/passwd.c20
-rw-r--r--nslcd/protocol.c2
-rw-r--r--nslcd/rpc.c2
-rw-r--r--nslcd/service.c2
-rw-r--r--nslcd/shadow.c2
20 files changed, 43 insertions, 38 deletions
diff --git a/nslcd/alias.c b/nslcd/alias.c
index ed744f1..993b520 100644
--- a/nslcd/alias.c
+++ b/nslcd/alias.c
@@ -1,7 +1,7 @@
/*
alias.c - alias entry lookup routines
Parts of this file were part of the nss_ldap library (as ldap-alias.c)
- which has been forked into the nss-ldapd library.
+ which has been forked into the nss-pam-ldapd library.
Copyright (C) 1997-2005 Luke Howard
Copyright (C) 2006 West Consulting
diff --git a/nslcd/attmap.c b/nslcd/attmap.c
index 9115c06..765d178 100644
--- a/nslcd/attmap.c
+++ b/nslcd/attmap.c
@@ -1,6 +1,6 @@
/*
attmap.c - attribute mapping values and functions
- This file is part of the nss-ldapd library.
+ This file is part of the nss-pam-ldapd library.
Copyright (C) 2007, 2008, 2009 Arthur de Jong
diff --git a/nslcd/attmap.h b/nslcd/attmap.h
index 0c350eb..7ec9177 100644
--- a/nslcd/attmap.h
+++ b/nslcd/attmap.h
@@ -1,6 +1,6 @@
/*
attmap.h - attribute mapping variables
- This file is part of the nss-ldapd library.
+ This file is part of the nss-pam-ldapd library.
Copyright (C) 2007, 2008 Arthur de Jong
diff --git a/nslcd/cfg.c b/nslcd/cfg.c
index 9051e68..bdf125b 100644
--- a/nslcd/cfg.c
+++ b/nslcd/cfg.c
@@ -1,7 +1,7 @@
/*
cfg.c - functions for configuration information
This file contains parts that were part of the nss_ldap
- library which has been forked into the nss-ldapd library.
+ library which has been forked into the nss-pam-ldapd library.
Copyright (C) 1997-2005 Luke Howard
Copyright (C) 2007 West Consulting
diff --git a/nslcd/cfg.h b/nslcd/cfg.h
index 79eef20..76b94c0 100644
--- a/nslcd/cfg.h
+++ b/nslcd/cfg.h
@@ -1,7 +1,7 @@
/*
cfg.h - definition of configuration information
This file contains parts that were part of the nss_ldap
- library which has been forked into the nss-ldapd library.
+ library which has been forked into the nss-pam-ldapd library.
Copyright (C) 1997-2005 Luke Howard
Copyright (C) 2007 West Consulting
diff --git a/nslcd/common.c b/nslcd/common.c
index 033dc3c..13d62b1 100644
--- a/nslcd/common.c
+++ b/nslcd/common.c
@@ -1,6 +1,6 @@
/*
common.c - common server code routines
- This file is part of the nss-ldapd library.
+ This file is part of the nss-pam-ldapd library.
Copyright (C) 2006 West Consulting
Copyright (C) 2006, 2007, 2008, 2009 Arthur de Jong
diff --git a/nslcd/common.h b/nslcd/common.h
index 37ddc9a..eabbfaa 100644
--- a/nslcd/common.h
+++ b/nslcd/common.h
@@ -1,6 +1,6 @@
/*
common.h - common server code routines
- This file is part of the nss-ldapd library.
+ This file is part of the nss-pam-ldapd library.
Copyright (C) 2006 West Consulting
Copyright (C) 2006, 2007, 2008, 2009 Arthur de Jong
@@ -124,9 +124,9 @@ int nslcd_netgroup_byname(TFILE *fp,MYLDAP_SESSION *session);
int nslcd_network_byname(TFILE *fp,MYLDAP_SESSION *session);
int nslcd_network_byaddr(TFILE *fp,MYLDAP_SESSION *session);
int nslcd_network_all(TFILE *fp,MYLDAP_SESSION *session);
-int nslcd_passwd_byname(TFILE *fp,MYLDAP_SESSION *session);
-int nslcd_passwd_byuid(TFILE *fp,MYLDAP_SESSION *session);
-int nslcd_passwd_all(TFILE *fp,MYLDAP_SESSION *session);
+int nslcd_passwd_byname(TFILE *fp,MYLDAP_SESSION *session,uid_t calleruid);
+int nslcd_passwd_byuid(TFILE *fp,MYLDAP_SESSION *session,uid_t calleruid);
+int nslcd_passwd_all(TFILE *fp,MYLDAP_SESSION *session,uid_t calleruid);
int nslcd_protocol_byname(TFILE *fp,MYLDAP_SESSION *session);
int nslcd_protocol_bynumber(TFILE *fp,MYLDAP_SESSION *session);
int nslcd_protocol_all(TFILE *fp,MYLDAP_SESSION *session);
@@ -144,9 +144,14 @@ int nslcd_pam_sess_o(TFILE *fp,MYLDAP_SESSION *session);
int nslcd_pam_sess_c(TFILE *fp,MYLDAP_SESSION *session);
int nslcd_pam_pwmod(TFILE *fp,MYLDAP_SESSION *session);
-/* macro for generating service handling code */
+/* macros for generating service handling code */
#define NSLCD_HANDLE(db,fn,readfn,logcall,action,mkfilter,writefn) \
- int nslcd_##db##_##fn(TFILE *fp,MYLDAP_SESSION *session) \
+ NSLCD_HANDLE_PARAMS(db,fn,,readfn,logcall,action,mkfilter,writefn)
+#define COMMA ,
+#define NSLCD_HANDLE_UID(db,fn,readfn,logcall,action,mkfilter,writefn) \
+ NSLCD_HANDLE_PARAMS(db,fn,COMMA uid_t calleruid,readfn,logcall,action,mkfilter,writefn)
+#define NSLCD_HANDLE_PARAMS(db,fn,params,readfn,logcall,action,mkfilter,writefn) \
+ int nslcd_##db##_##fn(TFILE *fp,MYLDAP_SESSION *session params ) \
{ \
/* define common variables */ \
int32_t tmpint32; \
diff --git a/nslcd/ether.c b/nslcd/ether.c
index 4a1d6a0..3c9c86b 100644
--- a/nslcd/ether.c
+++ b/nslcd/ether.c
@@ -1,7 +1,7 @@
/*
ether.c - ethernet address entry lookup routines
Parts of this file were part of the nss_ldap library (as ldap-ethers.c)
- which has been forked into the nss-ldapd library.
+ which has been forked into the nss-pam-ldapd library.
Copyright (C) 1997-2005 Luke Howard
Copyright (C) 2006 West Consulting
diff --git a/nslcd/group.c b/nslcd/group.c
index 1926a33..0558651 100644
--- a/nslcd/group.c
+++ b/nslcd/group.c
@@ -1,7 +1,7 @@
/*
group.c - group entry lookup routines
Parts of this file were part of the nss_ldap library (as ldap-grp.c) which
- has been forked into the nss-ldapd library.
+ has been forked into the nss-pam-ldapd library.
Copyright (C) 1997-2006 Luke Howard
Copyright (C) 2006 West Consulting
@@ -259,7 +259,7 @@ static int write_group(TFILE *fp,MYLDAP_ENTRY *entry,const char *reqname,
myldap_get_dn(entry),attmap_group_gidNumber);
return 0;
}
- for (numgids=0;(gidvalues[numgids]!=NULL)&&(numgids<=MAXGIDS_PER_ENTRY);numgids++)
+ for (numgids=0;(gidvalues[numgids]!=NULL)&&(numgids<MAXGIDS_PER_ENTRY);numgids++)
{
gids[numgids]=(gid_t)strtol(gidvalues[numgids],&tmp,0);
if ((*(gidvalues[numgids])=='\0')||(*tmp!='\0'))
diff --git a/nslcd/host.c b/nslcd/host.c
index 63826d5..5907c05 100644
--- a/nslcd/host.c
+++ b/nslcd/host.c
@@ -1,7 +1,7 @@
/*
host.c - host name lookup routines
Parts of this file were part of the nss_ldap library (as ldap-hosts.c)
- which has been forked into the nss-ldapd library.
+ which has been forked into the nss-pam-ldapd library.
Copyright (C) 1997-2005 Luke Howard
Copyright (C) 2006 West Consulting
diff --git a/nslcd/myldap.c b/nslcd/myldap.c
index 5e35718..9e36699 100644
--- a/nslcd/myldap.c
+++ b/nslcd/myldap.c
@@ -1,7 +1,7 @@
/*
myldap.c - simple interface to do LDAP requests
Parts of this file were part of the nss_ldap library (as ldap-nss.c)
- which has been forked into the nss-ldapd library.
+ which has been forked into the nss-pam-ldapd library.
Copyright (C) 1997-2006 Luke Howard
Copyright (C) 2006, 2007 West Consulting
diff --git a/nslcd/myldap.h b/nslcd/myldap.h
index a83a86a..55cf1da 100644
--- a/nslcd/myldap.h
+++ b/nslcd/myldap.h
@@ -1,6 +1,6 @@
/*
myldap.h - simple interface to do LDAP requests
- This file is part of the nss-ldapd library.
+ This file is part of the nss-pam-ldapd library.
Copyright (C) 2007, 2008, 2009 Arthur de Jong
diff --git a/nslcd/netgroup.c b/nslcd/netgroup.c
index 58078f8..9acc79f 100644
--- a/nslcd/netgroup.c
+++ b/nslcd/netgroup.c
@@ -1,7 +1,7 @@
/*
netgroup.c - netgroup lookup routines
Parts of this file were part of the nss_ldap library (as ldap-netgrp.c)
- which has been forked into the nss-ldapd library.
+ which has been forked into the nss-pam-ldapd library.
Copyright (C) 1997-2005 Luke Howard
Copyright (C) 2006 West Consulting
diff --git a/nslcd/network.c b/nslcd/network.c
index c2bcce2..73e88d2 100644
--- a/nslcd/network.c
+++ b/nslcd/network.c
@@ -1,7 +1,7 @@
/*
network.c - network address entry lookup routines
Parts of this file were part of the nss_ldap library (as ldap-network.c)
- which has been forked into the nss-ldapd library.
+ which has been forked into the nss-pam-ldapd library.
Copyright (C) 1997-2005 Luke Howard
Copyright (C) 2006 West Consulting
diff --git a/nslcd/nslcd.c b/nslcd/nslcd.c
index d95c09f..5ed9608 100644
--- a/nslcd/nslcd.c
+++ b/nslcd/nslcd.c
@@ -398,9 +398,9 @@ static void handleconnection(int sock,MYLDAP_SESSION *session)
case NSLCD_ACTION_NETWORK_BYNAME: (void)nslcd_network_byname(fp,session); break;
case NSLCD_ACTION_NETWORK_BYADDR: (void)nslcd_network_byaddr(fp,session); break;
case NSLCD_ACTION_NETWORK_ALL: (void)nslcd_network_all(fp,session); break;
- case NSLCD_ACTION_PASSWD_BYNAME: (void)nslcd_passwd_byname(fp,session); break;
- case NSLCD_ACTION_PASSWD_BYUID: (void)nslcd_passwd_byuid(fp,session); break;
- case NSLCD_ACTION_PASSWD_ALL: (void)nslcd_passwd_all(fp,session); break;
+ case NSLCD_ACTION_PASSWD_BYNAME: (void)nslcd_passwd_byname(fp,session,uid); break;
+ case NSLCD_ACTION_PASSWD_BYUID: (void)nslcd_passwd_byuid(fp,session,uid); break;
+ case NSLCD_ACTION_PASSWD_ALL: (void)nslcd_passwd_all(fp,session,uid); break;
case NSLCD_ACTION_PROTOCOL_BYNAME: (void)nslcd_protocol_byname(fp,session); break;
case NSLCD_ACTION_PROTOCOL_BYNUMBER:(void)nslcd_protocol_bynumber(fp,session); break;
case NSLCD_ACTION_PROTOCOL_ALL: (void)nslcd_protocol_all(fp,session); break;
@@ -562,7 +562,7 @@ int main(int argc,char *argv[])
if (myldap_set_debuglevel(nslcd_debugging)!=LDAP_SUCCESS)
exit(EXIT_FAILURE);
/* read configuration file */
- cfg_init(NSS_LDAP_PATH_CONF);
+ cfg_init(NSLCD_CONF_PATH);
/* daemonize */
if ((!nslcd_debugging)&&(daemon(0,0)<0))
{
diff --git a/nslcd/passwd.c b/nslcd/passwd.c
index 3896aea..911df52 100644
--- a/nslcd/passwd.c
+++ b/nslcd/passwd.c
@@ -1,7 +1,7 @@
/*
passwd.c - password entry lookup routines
Parts of this file were part of the nss_ldap library (as ldap-pwd.c)
- which has been forked into the nss-ldapd library.
+ which has been forked into the nss-pam-ldapd library.
Copyright (C) 1997-2005 Luke Howard
Copyright (C) 2006 West Consulting
@@ -292,7 +292,7 @@ char *uid2dn(MYLDAP_SESSION *session,const char *uid,char *buf,size_t buflen)
#define MAXUIDS_PER_ENTRY 5
static int write_passwd(TFILE *fp,MYLDAP_ENTRY *entry,const char *requser,
- const uid_t *requid)
+ const uid_t *requid,uid_t calleruid)
{
int32_t tmpint32;
const char **tmpvalues;
@@ -323,7 +323,7 @@ static int write_passwd(TFILE *fp,MYLDAP_ENTRY *entry,const char *requser,
else
{
passwd=get_userpassword(entry,attmap_passwd_userPassword);
- if (passwd==NULL)
+ if ((passwd==NULL)||(calleruid!=0))
passwd=default_passwd_userPassword;
}
/* get the uids for this entry */
@@ -341,7 +341,7 @@ static int write_passwd(TFILE *fp,MYLDAP_ENTRY *entry,const char *requser,
myldap_get_dn(entry),attmap_passwd_uidNumber);
return 0;
}
- for (numuids=0;(numuids<=MAXUIDS_PER_ENTRY)&&(tmpvalues[numuids]!=NULL);numuids++)
+ for (numuids=0;(numuids<MAXUIDS_PER_ENTRY)&&(tmpvalues[numuids]!=NULL);numuids++)
{
uids[numuids]=(uid_t)strtol(tmpvalues[numuids],&tmp,0);
if ((*(tmpvalues[numuids])=='\0')||(*tmp!='\0'))
@@ -451,7 +451,7 @@ static int write_passwd(TFILE *fp,MYLDAP_ENTRY *entry,const char *requser,
return 0;
}
-NSLCD_HANDLE(
+NSLCD_HANDLE_UID(
passwd,byname,
char name[256];
char filter[1024];
@@ -463,10 +463,10 @@ NSLCD_HANDLE(
log_log(LOG_DEBUG,"nslcd_passwd_byname(%s)",name);,
NSLCD_ACTION_PASSWD_BYNAME,
mkfilter_passwd_byname(name,filter,sizeof(filter)),
- write_passwd(fp,entry,name,NULL)
+ write_passwd(fp,entry,name,NULL,calleruid)
)
-NSLCD_HANDLE(
+NSLCD_HANDLE_UID(
passwd,byuid,
uid_t uid;
char filter[1024];
@@ -474,15 +474,15 @@ NSLCD_HANDLE(
log_log(LOG_DEBUG,"nslcd_passwd_byuid(%d)",(int)uid);,
NSLCD_ACTION_PASSWD_BYUID,
mkfilter_passwd_byuid(uid,filter,sizeof(filter)),
- write_passwd(fp,entry,NULL,&uid)
+ write_passwd(fp,entry,NULL,&uid,calleruid)
)
-NSLCD_HANDLE(
+NSLCD_HANDLE_UID(
passwd,all,
const char *filter;
/* no parameters to read */,
log_log(LOG_DEBUG,"nslcd_passwd_all()");,
NSLCD_ACTION_PASSWD_ALL,
(filter=passwd_filter,0),
- write_passwd(fp,entry,NULL,NULL)
+ write_passwd(fp,entry,NULL,NULL,calleruid)
)
diff --git a/nslcd/protocol.c b/nslcd/protocol.c
index fadb66f..a47b7b2 100644
--- a/nslcd/protocol.c
+++ b/nslcd/protocol.c
@@ -1,7 +1,7 @@
/*
protocol.c - network address entry lookup routines
Parts of this file were part of the nss_ldap library (as ldap-proto.c)
- which has been forked into the nss-ldapd library.
+ which has been forked into the nss-pam-ldapd library.
Copyright (C) 1997-2005 Luke Howard
Copyright (C) 2006 West Consulting
diff --git a/nslcd/rpc.c b/nslcd/rpc.c
index 9958d48..7783994 100644
--- a/nslcd/rpc.c
+++ b/nslcd/rpc.c
@@ -1,7 +1,7 @@
/*
rpc.c - rpc name lookup routines
Parts of this file were part of the nss_ldap library (as ldap-rpc.c) which
- has been forked into the nss-ldapd library.
+ has been forked into the nss-pam-ldapd library.
Copyright (C) 1997-2005 Luke Howard
Copyright (C) 2006 West Consulting
diff --git a/nslcd/service.c b/nslcd/service.c
index cb9cf4f..f3980a7 100644
--- a/nslcd/service.c
+++ b/nslcd/service.c
@@ -1,7 +1,7 @@
/*
service.c - service entry lookup routines
Parts of this file were part of the nss_ldap library (as ldap-service.c)
- which has been forked into the nss-ldapd library.
+ which has been forked into the nss-pam-ldapd library.
Copyright (C) 1997-2005 Luke Howard
Copyright (C) 2006 West Consulting
diff --git a/nslcd/shadow.c b/nslcd/shadow.c
index 44c63db..0966356 100644
--- a/nslcd/shadow.c
+++ b/nslcd/shadow.c
@@ -1,7 +1,7 @@
/*
shadow.c - service entry lookup routines
Parts of this file were part of the nss_ldap library (as ldap-spwd.c)
- which has been forked into the nss-ldapd library.
+ which has been forked into the nss-pam-ldapd library.
Copyright (C) 1997-2005 Luke Howard
Copyright (C) 2006 West Consulting