[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: Alternative to slappasswd

> -----Original Message-----
> From: owner-openldap-software@OpenLDAP.org
> [mailto:owner-openldap-software@OpenLDAP.org]On Behalf Of David Smith

> >>I am looking for an alternative to slappasswd that:

> >slappasswd -s <password>
> >
> >Maybe not stdin ... but easy enough to script.

> I need stdin. Putting the password on the command line is a security
> risk for my application.

If your operating system supports the /dev/fd filesystem you can always use
	echo MySecret | slappasswd -T /dev/fd/0

If not, you can probably use mknod to create a fifo and get the same effect.
	umask 077; mknod MyPipe p;	echo MySecret > MyPipe &
	slappasswd -T MyPipe

Note that when slappasswd reads from a file it preserves everything it reads;
if you write a bunch of text terminated by a newline character, the newline
will be part of the password. So the above examples might be better with
	echo -n MySecret

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support