homes bug - two different solutions

Michael Collin Nielsen michael at
Wed Jul 14 19:01:51 GMT 2004


I'm running samba-3.0.4 on a solaris 8 box and is investigating a setup 
where samba acts as a domain member in a windows 2000 domain with 
windows XP sp1 clients.

I have added AD policies to install printers  as the clients starts and 
I have added AD policies to redirect the users Desktop, Application Data 
and Documents to dubfolders of the homes share, eg Desktop -> 

This all works nice and dandy... But sometimes access to the homes share 
fail, this seems quite random, but it seems to happen quite often when 
the PC is rebootet in between logins.

I have looked into the source, and can see from debug that I added to 
the code, that it seems that this could be a logics bug in the 
register_vuid function, but then again - It might be a logics error 40 
cm from my screen :-)

Here is what I this is hapening:
The computer is started and the guest user connects to samba and instals 
printers, my testuser then logs in, and register_vuid registers a homes 
share in his session and in the global service table. The user then logs 
off, and the computer is rebootet. After the reboot, the test user again 
connects to samba, register_vuid again tries to register a homes share, 
but now the service is already registered in the global service table, 
and therefore register_vuid does not register the homes share in the 
user session, and sets vuser->homes_snum = -1

How to solve:
I'm not familiar with the logics of this, and can't quite find the 
logics in how the homes share is related to the current user, but I 
guess one solution could be to check if a globally registred service 
with the same name exists (as it is now: 
lp_servicenumber(vuser->, and if it does excist then use 
the id of that service in the vuser->homes_snum.
A different approach could be to register the service again, and rely on 
the underlaying functions to update the excisting service.

I dont know which is the better solution, so I've tested both, and can't 
really see any difference, but some of you good people probably know 
which is the better solution :-)

I have made two diffs against samba-3.0.4 source:
password-reuse-service.diff is the patch that reuses the servicenumber
password-update-service.diff is the patch that updates the service
They are available at:

Hope you will take look at these :-)



PS: I can reproduce the error this way:
I log in a my fresh test-user on a fresh mashine - Now folder 
redirection to the homes share is OK
I reboot windows, and while the computer reboots I delete the test-users 
roaming profile.
I then log in as the test-user again and now windows complains that 
we're offline.

    Michael Collin Nielsen  mailto:michael at
    Sysadm in Faculty of Humanities, Aalborg University

More information about the samba-technical mailing list