summaryrefslogtreecommitdiff
path: root/net/nss_ldap/files/patch-ldap-pwd.c
diff options
context:
space:
mode:
authorAndrey Slusar <anray@FreeBSD.org>2006-05-24 10:48:59 +0000
committerAndrey Slusar <anray@FreeBSD.org>2006-05-24 10:48:59 +0000
commitfbecc92707ffa33319466395d5dfff03fcd7edbe (patch)
treeaf106afddf63e3d3410c264e950bc04f14ca6c42 /net/nss_ldap/files/patch-ldap-pwd.c
parentUpdate to 8.1-407 (diff)
- Now it is possible to use ldap as source for hosts database.
Only gethosbyname, gethostbyname2, gethostbyaddr are implemented. Behavior of getpwXXX functions is made traditional for BSD. When uid=0 they return user password, otherwise returned password is "x". Also, in previous version of the port functions setpwent/endpwent and setgrent/endgrent were mixed. Now they are not. - Assign maintainership to submitter. Submitted by: Artem Kazakov <kazakov@gmail.com>
Notes
Notes: svn path=/head/; revision=163254
Diffstat (limited to 'net/nss_ldap/files/patch-ldap-pwd.c')
-rw-r--r--net/nss_ldap/files/patch-ldap-pwd.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/net/nss_ldap/files/patch-ldap-pwd.c b/net/nss_ldap/files/patch-ldap-pwd.c
new file mode 100644
index 000000000000..e6eb878b4988
--- /dev/null
+++ b/net/nss_ldap/files/patch-ldap-pwd.c
@@ -0,0 +1,29 @@
+--- ldap-pwd.c.orig Fri Feb 24 11:02:50 2006
++++ ldap-pwd.c Thu May 11 14:52:42 2006
+@@ -21,7 +21,10 @@
+ static char rcsId[] =
+ "$Id: ldap-pwd.c,v 2.46 2006/01/11 18:03:49 lukeh Exp $";
+
++#include <sys/types.h>
++#include <unistd.h>
+ #include "config.h"
++
+
+ #ifdef HAVE_PORT_BEFORE_H
+ #include <port_before.h>
+@@ -90,9 +93,13 @@
+ size_t tmplen;
+ char *tmp;
+
+- if (_nss_ldap_oc_check (e, "shadowAccount") == NSS_SUCCESS)
+- {
++/* if (_nss_ldap_oc_check (e, "shadowAccount") == NSS_SUCCESS)
++ * {
++ */
+ /* don't include password for shadowAccount */
++ if (getuid() != 0)
++ {
++ /* don't include password for non-root users */
+ if (buflen < 3)
+ return NSS_TRYAGAIN;
+