File libuser-0.56.13-ldap-password.patch of Package libuser-python27

Allow specifying the LDAP password in a config file.

2010-02-08  Miloslav Trmač  <mitr@redhat.com>

	* docs/libuser.conf.5.in ([ldap]): Document the "password" option.

2010-02-08  Rob Myers  <rob.myers@gtri.gatech.edu>

	* modules/ldap.c (libuser_ldap_init): Allow specifying the LDAP password
	in a config file.

diff -r 140c73bcf984 -r 92d35fb46a4d docs/libuser.conf.5.in
--- a/docs/libuser.conf.5.in	Mon Feb 08 12:38:31 2010 +0100
+++ b/docs/libuser.conf.5.in	Mon Feb 08 12:58:31 2010 +0100
@@ -1,6 +1,6 @@
 '\" t
 .\" A man page for libuser.conf -*- nroff -*-
-.\" Copyright (C) 2005, 2008 Red Hat, Inc.
+.\" Copyright (C) 2005, 2008, 2010 Red Hat, Inc.
 .\"
 .\" This is free software; you can redistribute it and/or modify it under
 .\" the terms of the GNU Library General Public License as published by
@@ -17,7 +17,7 @@
 .\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 .\"
 .\" Author: Miloslav Trmac <mitr@redhat.com>
-.TH libuser.conf 5 "Jan 7 2008" libuser
+.TH libuser.conf 5 2010-02-08 libuser
 
 .SH NAME
 libuser.conf \- configuration for libuser and libuser utilities
@@ -368,6 +368,11 @@
 Default value is the name of the invoking user.
 
 .TP
+.B password
+The password used for a simple bind by default.  If not specified, there is
+no default and the user must supply the password each time.
+
+.TP
 .B authuser
 The SASLv2 authorization user, if non-empty.
 Default value is empty.
diff -r 140c73bcf984 -r 92d35fb46a4d modules/ldap.c
--- a/modules/ldap.c	Mon Feb 08 12:38:31 2010 +0100
+++ b/modules/ldap.c	Mon Feb 08 12:58:31 2010 +0100
@@ -2495,6 +2495,8 @@
 
 	ctx->prompts[LU_LDAP_PASSWORD].key = "ldap/password";
 	ctx->prompts[LU_LDAP_PASSWORD].prompt = N_("LDAP Bind Password");
+	ctx->prompts[LU_LDAP_PASSWORD].default_value =
+		lu_cfg_read_single(context, "ldap/password", NULL);
 	ctx->prompts[LU_LDAP_PASSWORD].visible = FALSE;
 
 	ctx->prompts[LU_LDAP_AUTHUSER].key = "ldap/user";
openSUSE Build Service is sponsored by