# [solved] samba troubles with adding users

## going_mad

Hello!

something strange and never happened with other gentoo/samba installations:

emerged samba (the current ebuild in portage) as always, I can start it, testparm finds everything's ok. I can see the samba machine running from the client in the same domain network (MYDOMAIN). 

when I try to add users or convert them from the unix list it fails. Obviously I cannot access the MYDOMAIN folders at all!

take a look:

Failed to convert user : /usr/bin/pdbedit failed :

Failed to open /var/lib/samba/private/secrets.tdb

Failed to open /var/lib/samba/private/secrets.tdb

pdb_generate_sam_sid: Failed to store generated machine SID.

PANIC: Could not generate a machine SID

BACKTRACE: 1 stack frames:

 #0 /usr/bin/pdbedit(smb_panic2+0xff) [0x80a0d2f]

I also tried to use a smb.conf running in another machine, nothing changes.

I simply cannot add users, no way. If I try to delete secrets.tdb the system complains with a permission denied (I'm logged as root)

This is the working (in another machine) smb.conf:

[global]

	workgroup = MYDOMAIN

	interfaces = eth1

#	bind interfaces only = Yes

#	map to guest = Bad User

	guest account = all

#	default service = homes

#	comment = Media files

	valid users = user1, user2

#	printer admin = @ntadmin, root, administrator

[homes]

#	comment = Home Directories

#	valid users = %S

#	read only = No

#	browseable = No

[user1]

	guest ok = yes

	writeable = yes

	public = yes

	path = /mnt/drive2/Media/movies/user1

[user2]

	guest ok = yes

	writeable = yes

	public = yes

	path = /mnt/drive2/Media/movies

Any hints to solve this?

Thanks for any help

G_MLast edited by going_mad on Wed Apr 20, 2005 10:42 am; edited 1 time in total

----------

## diastelo

What use flags did you compile Samba with and what version do you have installed? Also, what version of GCC did you use and what architecture are you running?

----------

## going_mad

These are the info you asked for:

samba ver.: 3.0.10

gcc ver. : 3.3.5-r1

USE flags; "-gtk -gnome qt kde dvd alsa cdr avi xmms samba java jpeg mozilla mysql x86"

cpu is an athlon xp

fs is reiserfs

everything else is working quite well, dunno what the hell is gojng on...

G_M

----------

## diastelo

Can you add the users manually with pdbedit itself? You should be able to find all the options to the tool in its man page. Try something like the following:

```
pdbedit -a -u username
```

If you really want to try deleting secrets.tdb, I'd try stopping smbd. It's possible that the file is in use or locked.

I don't have a secrets.tdb file over here to look at, but look for the program tdbdump and run it on the secrets.tdb file. You should check it against the secrets.tdb file on another machine that is working. Most of it should be readable.

I assume you are trying to authenticate against an LDAP server? I didn't see it included as a USE flag, but perhaps it should be.

----------

## going_mad

First of all thanks for your reply!

well, in the meanwhile I tried to unmerge samba, rename the /etc/samba directory to /etc/samba_old, then emerged samba with the USE flags found in http://www.gentoo.org/doc/en/quick-samba-howto.xml (and, yes, I also emerged clamav before samba)

USE="oav readline cups pam -python -ldap -kerberos -xml -acl -mysql libclamav" emerge net-fs/samba

everything seems ok, also testparm says so. but everything is all the same when trying to add users to samba. Same error.

pdbedit shows the same error as always and I cannot open secrets.tdb with tdbdump ("failed to open secrets.tdb")

Don't know if this is of interest but it takes a lot of time to access the /var/lib/samba and /var/lib/samba/private directories

G_M

----------

## diastelo

I'm afraid I might be at the end of any helpful information I can impart. Something is obviously broken, but I can't see where it might have happened. I'd recommend unmerging everything, deleting what you can, and starting over. After that, you might try backporting. I'll let you know if I come up with any ideas on my end. I wish you luck.

----------

## going_mad

Finally I found that the hard disk was corrupted!  :Shocked: 

Other problems appeared and finally I had to change it with a new one.

G_M

----------

