passdb enhancement?

René Nieuwenhuizen R.Nieuwenhuizen at cpb.nl
Wed Oct 1 04:43:44 GMT 2003


Hi Samba-Team,

When tdbsam is used and profile path is reset to '' I would expect to 
get the logon path as set in smb.conf. This doesn't happen: I just get 
an empty logon path returned. With the following patch the logon path as 
defined in smb.conf is returned when the logon path is set to '' with 
pdbedit.

The reason for wanting the profile path from smb.conf  to be returned is 
this: I want roaming profiles on our desktops but on the terminal server 
we need some sort of local profile. Since this is only possible with 
windows 2000 service pack 4 we had the following sollution: the logon 
path is include from a client-IP-specific global includefile:

--------------------- smb.conf ------------------------
[globals]
....
include = /usr/local/samba/globals-client-IP-specific/%I.conf
....
-------------------- smb.conf -------------------------

In globals-client-IP-specific we have two specific logon path include 
files (ws.conf and ts.conf). Than we symlinked based on client-IP address.

-------------------- ws.conf ---------------------
logon path = \\%L\profile\%U\roaming\%a
-------------------- ws.conf ---------------------

-------------------- ts.conf ---------------------
logon path = \\%L\profile\%U\%I\%a
-------------------- ts.conf ---------------------

As long as the logon path is set to '' in the tdbsam with pdbedit the 
logon path is taken from smb.conf.

Does this sound reasonable?

------------------------------ SNIP 
------------------------------------------------------
--- passdb.c.orig       Wed Sep 24 19:16:13 2003
+++ passdb.c    Wed Oct  1 05:49:17 2003
@@ -1377,7 +1377,7 @@
        pdb_set_nt_username(sampass, nt_username, PDB_SET);
        pdb_set_fullname(sampass, fullname, PDB_SET);
 
-       if (homedir) {
+       if (homedir && strcmp(homedir, "")) {
                pdb_set_homedir(sampass, homedir, PDB_SET);
        }
        else {
@@ -1386,23 +1386,23 @@
                        PDB_DEFAULT);
        }
 
-       if (dir_drive)
+       if (dir_drive && strcmp(dir_drive, "")) {
                pdb_set_dir_drive(sampass, dir_drive, PDB_SET);
-       else {
+       } else {
                pdb_set_dir_drive(sampass,
                        talloc_sub_basic(sampass->mem_ctx,  username, 
lp_logon_drive()),
                        PDB_DEFAULT);
        }
 
-       if (logon_script)
+       if (logon_script && strcmp(logon_script, "")) {
                pdb_set_logon_script(sampass, logon_script, PDB_SET);
-       else {
+       } else {
                pdb_set_logon_script(sampass,
                        talloc_sub_basic(sampass->mem_ctx, username, 
lp_logon_script()),
                        PDB_DEFAULT);
        }
 
-       if (profile_path) {
+       if (profile_path && strcmp(profile_path, "")) {
                pdb_set_profile_path(sampass, profile_path, PDB_SET);
        } else {
                pdb_set_profile_path(sampass,
---------------------------------- SNIP 
-----------------------------------------------------------


-- 
René Nieuwenhuizen
Afdeling Informatietechnologie
Centraal Planbureau

Bezoekadres: Van Stolkweg 14, 2585 JR Den Haag
Postadres: Postbus 80510, 2508 GM Den Haag

T (070) 3383 342
F (070) 3383 350
I http://www.cpb.nl/nl/general/org/afdelingen/it/


--
================================================================================
Aan dit bericht kunnen geen rechten worden ontleend.
Het bericht is alleen bestemd voor de geadresseerde.
Indien dit bericht niet voor u is bestemd, verzoeken wij u dit onmiddellijk aan
ons te melden en de inhoud van het bericht te vernietigen.

This message shall not constitute any obligations.
This message is intended solely for the addressee.
If you have received this message in error, please inform us immediately and
delete its contents.
================================================================================



More information about the samba-technical mailing list