smbpasswd and password synchronisation

travis at deakin.edu.au travis at deakin.edu.au
Wed Sep 29 09:46:36 GMT 1999


G'day all,

I'm from Deakin University's IT department and I am currently trying to 
synchronise our passwords across our million and one applications/os's, etc. 

I'm trying to 'butcher' smbpasswd so that given a plaintext password for a 
user I can store a lanman and an nt encrypted password value in our database
and replicate it out to our samba pdc servers.

Unfortunately my code is not producing the output I would expect.

What I want to be able to do is when a user changes their existing password
I also set up their password so it can be used with our samba pdc's (at the
same time as we synchronise the passwords for all of the other services we
have).  As the ldap code is not mature enough I was hoping that I would be
able to just generate samba password files and then later use the hash values
I have in my database to populate some distributed ldap servers.

What I would expect is the following:

For a password of: abc123

lanman hex 	= 78BCCAEE08C90E29AAD3B435B51404EE
nt hex 		= F9E37E83B83C47A93C2F09F66408631B

But my program is giving me:

nt hex 		= 78FFFFFF08FF0E29FFFFFF35FF1404FFFFFFEE
lanman hex 	= FFFF7EFFFF3C47FF3C2F09FF6408631B

Can someone please point me in the right direction for this?

Here is the source of my very simple program, it compiles with the same
requirements as smbpasswd:

#include <stdio.h>

main()
{
        char passwd[30];
        char lanman[40];
        char nt[40];
        char lanman_hex[40];
        char nt_hex[40];

        scanf("%s", passwd);
        //printf("passwd = %s\n", passwd);

        nt_lm_owf_gen(passwd, nt, lanman);

        /*
        printf("nt = %s\n", nt);
        printf("lanman = %s\n", lanman);
        */

        pdb_sethexpwd(nt_hex, nt);
        pdb_sethexpwd(lanman_hex, lanman);

        printf("nt_hex = %s\n", nt_hex);
        printf("lanman_hex = %s\n", lanman_hex);
}

Thanks,

Travis Freeland

Systems Section Leader
ITS
Deakin University


More information about the samba-technical mailing list