RE pdb_ldap.c, ldapsam_add_sam_account, existing poxisaccount

John Allman samba.20.kaldorg at
Thu May 26 14:57:49 GMT 2005

spu at wrote:
> I forgot some details.
> the script add the sambasamaccount.
> could you send me the smbldap-useradd script for see what version you use ?
> some smbldap script not add the sambasamaccount, because normally samba
> must add it (and is this part which don't work).
> the last version seems to add the sambasamaccount attributes and old
> version too.
Ah! smbldap-useradd in 0.8.7 certainly does not seem to add the
sambasamaccount attributes. I just downloaded the latest 0.9.0 and that
doesn't seem to either. Not with -w, which as i understand it is the way
it should be used. -w just makes the posixaccount and expects samba to
do the rest...

if (defined($Options{'w'}) or defined($Options{'i'})) {

  #print "About to create machine $userName:\n";

  if (!add_posix_machine
($userName,$userUidNumber,$userGidNumber,$Options{'t'})) {
    die "$0: error while adding posix account\n";

  if (defined($Options{'i'})) {

  exit 0;

Should the add machine script set up the samba attributes? It seems a
bit mad. Surely samba should be finding that the user exists but doesn't
have the samba attributes and then it should modify the user? That's
what the code in my original post appears to be trying to do...


More information about the samba-technical mailing list