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

Re: ldappasswd -T



On 09/21/2011 05:48 PM, David Dumortier wrote:
Hello,

I tried to set a password with the -T option.
It failed so I tried -d 11 to see the dump in hexa.
I discovered that a 0xa is append to the password.
Is it a bug ? if so please confirm I will open a bugreport.

slappasswd hashes the contents of the file, whatever it is. Usually, one should generate a file that contains a single line without a newline (0xa) at the end. For example:

$ echo "secret" > x && slappasswd -T x -h '{CLEARTEXT}' | od -c
Warning: Password file x is publicly readable/writeable
0000000   s   e   c   r   e   t  \n  \n
0000010
$ echo -n "secret" > x && slappasswd -T x -h '{CLEARTEXT}' | od -c
Warning: Password file x is publicly readable/writeable
0000000   s   e   c   r   e   t  \n
0000007

notice the extra '\n' you get when the file is terminated by a newline.

p.