smbpasswd delete users

Jeremy Allison jallison at
Tue Jun 9 20:49:10 GMT 1998

CAE Samba Admin wrote:

>         smbpasswd seems to be missing a rather key function...  Is it
> still undocumented or can smbpasswd delete users from the smbpasswd file.
> Is this functionality left out on purpose?  I have the need to delete
> users out of the file, as I assume most people do.  However, besides the
> inconvienence of using text editors/filters, I have concerns about one of
> these programs editing the smbpasswd file while samba is trying to access
> it or someone is changing a password.  Do you plan on implementing a
> delete function to smbpasswd very soon?  If not, how do I go about locking
> the smbpasswd file?

True, it's missing. It needs a function to create
a new smbpasswd file, then lock the original exclusively,
then go through all the current smbpasswd entries, writing
all but the entry targeted for delete. Finally, it needs to
do a rename of the old file, and a move into place of the
new file.

This means some slightly fiddly locking code to ensure
that all other smbd's see a consistant view of the smbpasswd
db at all times (or at least retry when they don't). It's
more fiddly than doing an add (which is just appending
a record), which is why it isn't written yet.

Moving to a gdbm based smbpasswd file would make this
much easier, and currently I was waiting until this
work to do the delete functionality.

But if you want to write it now, be my guest :-).


	Jeremy Allison,
	Samba Team.

Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.

More information about the samba-ntdom mailing list