smbpasswd -ax error

MCCALL,DON (HP-USA,ex1) don_mccall at
Tue Apr 24 20:08:17 GMT 2001

Hi Joe,
I think the intent in this test is to ensure that smbpasswd is not trying to
add (a) or delete (x) a user on a remote machine, OR when trying to join a
domain (j)...
While I agree that it doesn't make a lot of sense to be able to specify -ax
(add and delete) to smbpasswd, we don't test against it.

Specifically, the behavior of smbpasswd -ax username is the following:
if user does not exist in smbpasswd file, but DOES exist in /etc/passwd,
then ADD user.
if user DOES exist in smbpasswd file, delete user.
for instance (user test currently exists in smbpasswd file):

# smbpasswd -ax test
Deleted user test.
# smbpasswd -ax test
Added user test.
# smbpasswd -ax test
Deleted user test.

Someone more evil and twisted than me is going to have to come up with an
explanation of WHY anyone would want to do this...

Hope this helps,

-----Original Message-----
From: Joe Meslovich [mailto:joe at]
Sent: Tuesday, April 24, 2001 12:05 PM
To: samba-technical at
Subject: smbpasswd -ax error

	According to the code that I am lookig at in smbpasswd.c a passwd
change should fail when both a and x options are set. I am using the
smbpasswd compiled from a CVS download this morning. Here is an example of
what happens:

# smbpasswd -a jam002
New SMB password:
Retype new SMB password:
Added user jam002.
# smbpasswd -ax jam002
Deleted user jam002.

Shouldn't smbpasswd fail in that instance because in the code there is the
following test:

         * Ensure add/delete user and either remote machine or join domain
         * not both set.
        if((local_flags & (LOCAL_ADD_USER|LOCAL_DELETE_USER)) &&
e != NULL) || joining_domain)) {

This is the proper behavior correct?


Joe Meslovich						joe at
Associate Network/Systems Engineer	                College Box 499
Tel: (540) 828 - 5343

More information about the samba-technical mailing list