PDA

View Full Version : samba and tdb


maiurana
2008-08-20, 01:28 PM CDT
hi to all, this is my first post in this forum.
well, it is also the first time I install fedora, I did it in the server of the company where I work to try to migrate a windows xp server to linux (I was already a linux user :)
this migration is almost complete, all works well (web server, db server, all the stuff) except samba, which is required as there is still a win98 client :(
I did a system upgrade right after the installation, so the system is up to date, and the installed version of samba is the latest one (3.2.0-2.17.fc9).

now the problems:
looks like samba is having problems with his passwd.tdb. whenever I try to add a samba user with "smbpasswd -a" it spits out some lines like these:
lib/account_pol.c: account_policy_get(324) account_policy_get: tdb_fetch_uint32 failed for field $n....
then it says it created the user, but if I run "smbpasswd -a" again for the same user it doesn't ask me for the old password as it would be supposed to do, so I think the user was not really created. nothing change if I set the pass backend as smbpasswd instead of tdbsam.
I tried wiping out all tdb files in /var/lib/samba to make it start from scratch, but the problem occurs again.
also, I'm not able to connect to the server neither from the win98 host nor from the same machine; if I try to authenticate locally with smbclient it says NT_STATUS_LOGON_FAILURE (of course the samba user is also a unix user with the same password), while win98 asks me for the correct password because it is unable to connect to \\hostname\IPC$.
for now a workaround was to set "map to guest=Bad User", so that I'm able at least to print as guest from win98 client, but even with this I can't connect to the share from both machines.
I can see the win98 share from the fedora server, but not from nautilus' network explorer; I had to create a bookmark to connect to the server, so that after the connection I see an icon to the share on the desktop, and I can click it to browse there from nautilus.

sorry for not pasting smb.conf, I'm not in the office right now. what I can say is that I added in the default file these options:
lanman auth=yes
client lanman auth=yes
ntlm auth=no
client ntlmv2 auth=no
map to guest=Bad User

security is set to "user", homes are not exported, the only things exported are the printer (which it works as guest) and a public share.

I searched the web but didn't find anyone experiencing the same issues, so I'm stuck; any hint is much appreciated :D

there is also another problem, but I think I can get around it tomorrow:
on boot samba says it is unable to connect to cups, so the printer doesn't get loaded. it is loaded if I restart samba, so it has to be a matter of service priority on boot, i.e. samba is executed while cups is not up.

TIA and ciao from sicily.

maiurana
2008-08-21, 04:54 AM CDT
ok, some data from the machine running fedora.
first, smb.conf stripped from commented and empty lines:

[global]
workgroup = grecoelevatori
server string = Samba Server Version %v
lanman auth = yes
client lanman auth = yes
ntlm auth = no
client ntlmv2 auth = no
map to guest = Bad User
log file = /var/log/samba/log.%m
max log size = 50
security = user
passdb backend = tdbsam
load printers = yes
cups options = raw
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = yes
writable = no
printable = yes
[Ufficio]
comment = Ufficio
path = /home/barbara/Documenti/Ufficio
public = yes
writable = yes
printable = no
browseable = yes


then, some lines from console's output:


[root@barbara Scrivania]# smbpasswd -a barbara
New SMB password:
Retype new SMB password:
Added user barbara.
[root@barbara Scrivania]# exit
[barbara@barbara ~]$ smbclient -L barbara
Enter barbara's password:
Domain=[BARBARA] OS=[Unix] Server=[Samba 3.2.0-17.fc9]

Sharename Type Comment
--------- ---- -------
Ufficio Disk Ufficio
IPC$ IPC IPC Service (Samba Server Version 3.2.0-17.fc9)
SCX-4x16_Series Printer Samsung SCX-4x16 Series
Domain=[BARBARA] OS=[Unix] Server=[Samba 3.2.0-17.fc9]

Server Comment
--------- -------

Workgroup Master
--------- -------
GRECOELEVATORI BARBARA
[barbara@barbara ~]$ smbclient \\\\barbara\\Ufficio -U barbara
Enter barbara's password:
Domain=[BARBARA] OS=[Unix] Server=[Samba 3.2.0-17.fc9]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME
[barbara@barbara ~]$ smbpasswd
Old SMB password:
New SMB password:
Retype new SMB password:
cli_pipe_validate_current_pdu: RPC fault code DCERPC_FAULT_OP_RNG_ERROR received from remote machine 127.0.0.1 pipe \samr fnum 0x7672!
machine 127.0.0.1 rejected the password change: Error was : NT code 0x1c010002.
Failed to change password for barbara
[barbara@barbara ~]$ ls -l /home/barbara/Documenti
totale 4
drwxr-xr-x 28 barbara barbara 4096 1 ago 10:19 Ufficio


and finally here is what I see in /var/log/samba/log.barbara and log.win98:

[2008/08/20 15:56:44, 0] smbd/service.c:make_connection_snum(1152)
'/home/barbara/Documenti/Ufficio' does not exist or permission denied when connecting to [Ufficio] Error was Permission denied


does this happens only to me? is there someone here who has started from scratch (ie. without tdb files from older installations) samba3.2.0-2.17.fc9 and found no problems?

maiurana
2008-08-21, 04:59 AM CDT
there is also another problem, but I think I can get around it tomorrow:
on boot samba says it is unable to connect to cups, so the printer doesn't get loaded. it is loaded if I restart samba, so it has to be a matter of service priority on boot, i.e. samba is executed while cups is not up.


indeed it was so.
I found that smb and nmb services was started with S91, while cups was started with S98 :eek:
I did the opposite (editing symlinks) and now the printer is correctly loaded, but I wonder if it could be reverted in future updates.
what is the correct way to change boot order (I'm not so familiar with sysVinit, I've always used slackware).

jayanatl
2008-08-25, 06:14 AM CDT
What is the current status is the problem solved?

maiurana
2008-08-25, 06:38 AM CDT
What is the current status is the problem solved?

nope :(

I asked for help even in the fedora mailing-list, and currently I'm trying to follow some hints sent to me from there, but still nothing.
here is some console output of today, in case someone has an idea:

[root@barbara samba]# pdbedit -Lv
---------------
Unix username: barbara
NT username:
Account Flags: [U ]
User SID: S-1-5-21-4006416855-825432111-2697360864-2000
Primary Group SID: S-1-5-21-4006416855-825432111-2697360864-513
Full Name: Barbara
Home Directory: \\barbara\barbara
HomeDir Drive:
Logon Script:
Profile Path: \\barbara\barbara\profile
Domain: BARBARA
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: never
Kickoff time: never
Password last set: gio, 21 ago 2008 09:40:36 CEST
Password can change: gio, 21 ago 2008 09:40:36 CEST
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

[root@barbara samba]# chmod g+w,g+s,o+w /home/barbara/Documenti -R
[root@barbara samba]# smbclient //barbara/ufficio -U barbara
Enter barbara's password:
session setup failed: NT_STATUS_LOGON_FAILURE
[root@barbara samba]# smbclient //barbara/ufficio
Enter barbara's password:
Anonymous login successful
Domain=[GRECOELEVATORI] OS=[Unix] Server=[Samba 3.2.0-17.fc9]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME

[root@barbara samba]# ls -l /var/lib/samba
totale 424
-rw------- 1 root root 16384 20 ago 14:12 account_policy.tdb
-rw-r--r-- 1 root root 40200 25 ago 11:04 brlock.tdb
-rw-r--r-- 1 root root 170 25 ago 11:10 browse.dat
-rw-r--r-- 1 root root 90112 25 ago 11:23 connections.tdb
-rw-r--r-- 1 root root 8192 25 ago 11:22 gencache.tdb
-rw-rw-rw- 1 root root 77824 20 ago 14:10 group_mapping.ldb
-rw-r--r-- 1 root root 40200 25 ago 11:04 locking.tdb
-rw------- 1 root root 696 25 ago 11:04 messages.tdb
-rw-r--r-- 1 root root 696 25 ago 11:23 notify.tdb
-rw------- 1 root root 8192 20 ago 14:10 ntdrivers.tdb
-rw------- 1 root root 696 20 ago 14:10 ntforms.tdb
-rw------- 1 root root 20480 25 ago 11:04 ntprinters.tdb
drwxr-xr-x 2 root root 4096 18 ago 15:37 perfmon
drwxr-xr-x 2 root root 4096 20 ago 15:52 printing
drwx------ 2 root root 4096 20 ago 15:48 private
-rw------- 1 root root 36864 25 ago 11:04 registry.tdb
drwxr-xr-x 2 root root 4096 1 lug 18:25 scripts
-rw-r--r-- 1 root root 696 25 ago 11:04 sessionid.tdb
-rw------- 1 root root 16384 20 ago 14:13 share_info.tdb
-rw-r--r-- 1 root root 28672 21 ago 09:57 unexpected.tdb
drwxr-x--- 2 root wbpriv 4096 1 lug 18:25 winbindd_privileged