openldap/libraries/liblutil
Kurt Zeilenga 8de258d2e2 Patch: 'ldapmodify -y file' reads password from file (ITS#2031)
================
Written by Hallvard B. Furuseth and placed into the public domain.
This software is not subject to any license of the University of Oslo.
            ================
Adapted by Kurt Zeilenga for inclusion in OpenLDAP.  My comments are
marked with enclosed with square brackets (e.g. [Kurt's comment] below.
            ================

If I run ldapmodify & co from a script, I don't want to use '-W password'
because the password shows up in the output of 'ps' for everyone,
and I can't pipe the password to 'ldapmodify -w' because -w uses
getpassphrase() which reads from the tty instead of stdin.
So I added '-y file' which reads the password from file.  The programs
exit if the file cannot be read.

[Complete contents of file is used as password.  Use:
	echo -n "secret" > password
to create a file with "secret" as the password.  The -n avoids
adding a newline (which would invalidate the password).  Note
that echo is a builtin and hence its arguments are not visible
to 'ps'.]

I changed ldapmodify, ldapmodrdn, ldapdelete, ldapsearch, ldapcompare.
I did not bother to change ldappasswd and ldapwhoami, because they
prompt for many passwords.  [I fixed up ldapwhoami.]

Rerun autoconf after applying this patch. [Done.]

Note:  I do not know if Windows NT has fstat(), so I set HAVE_FSTAT to
undef in portable.nt.  (fstat() is used to warn if the file is publicly
readable or writeable.)  [I used fstat() to set the buffer size to
read.]

[Note: using the contents of a file extends the tools to support
passwords which could not normally be provided using getpassphrase()
or via the command line.]

Hallvard B. Furuseth <h.b.furuseth@usit.uio.no>, Aug 2002.
[Kurt D. Zeilenga <kurt@openldap.org>, Aug 2002.]
2002-08-24 05:47:17 +00:00
..
authpasswd.c Start of new operational attribute framework 2002-01-10 00:17:21 +00:00
base64.c Update copyright statements 2002-01-04 21:17:25 +00:00
csn.c Slapadd is changed to include Operational Attributes (entryUUID, entryCSN, 2002-08-21 00:11:32 +00:00
detach.c Fix == v != bug 2000-04-19 13:35:43 +00:00
entropy.c /dev/urandom re-read(2) loop 2002-06-03 16:43:57 +00:00
getopt.c Moved slap_strcopy, slap_strncopy to lutil_strcopy, lutil_strncopy 2002-07-27 00:25:16 +00:00
getpass.c Update copyright statements 2002-01-04 21:17:25 +00:00
hash.c remove lint 2000-10-18 00:29:21 +00:00
liblutil.dsp Misc sprintf/snprintf cleanup 2002-07-23 18:26:33 +00:00
lockf.c Update copyright statements 2002-01-04 21:17:25 +00:00
Makefile.in Patch: 'ldapmodify -y file' reads password from file (ITS#2031) 2002-08-24 05:47:17 +00:00
md5.c Update copyright statements 2002-01-04 21:17:25 +00:00
memcmp.c Add OpenLDAP RCSid to *.[ch] in clients, libraries, and servers. 1999-09-08 19:06:24 +00:00
ntservice.c Misc sprintf/snprintf cleanup 2002-07-23 18:26:33 +00:00
passfile.c Patch: 'ldapmodify -y file' reads password from file (ITS#2031) 2002-08-24 05:47:17 +00:00
passwd.c ITS#2016 possibly better macro test for this fix 2002-08-10 00:32:25 +00:00
passwd.dsp Update for new password codes for MSVC5 1999-12-08 06:44:22 +00:00
ptest.c Update copyright statements 2002-01-04 21:17:25 +00:00
sasl.c Misc sprintf/snprintf cleanup 2002-07-23 18:26:33 +00:00
setproctitle.c Add OpenLDAP RCSid to *.[ch] in clients, libraries, and servers. 1999-09-08 19:06:24 +00:00
sha1.c Remove sys/uio.h include 2002-05-15 05:53:10 +00:00
signal.c Update copyright statements 2002-01-04 21:17:25 +00:00
slapdmsg.bin New files added for Mingw32 support. 1999-10-28 07:22:10 +00:00
slapdmsg.h New files added for Mingw32 support. 1999-10-28 07:22:10 +00:00
slapdmsg.mc ACL CHANGES: 1999-07-21 20:54:23 +00:00
slapdmsg.rc New files added for Mingw32 support. 1999-10-28 07:22:10 +00:00
sockpair.c Update copyright statements 2002-01-04 21:17:25 +00:00
stdio.c Moved slap_strcopy, slap_strncopy to lutil_strcopy, lutil_strncopy 2002-07-27 00:25:16 +00:00
utils.c Moved slap_strcopy, slap_strncopy to lutil_strcopy, lutil_strncopy 2002-07-27 00:25:16 +00:00
uuid.c Win32 fix from Kervin Pierre 2002-05-11 18:15:07 +00:00