The branch, v3-0-test has been updated via 5cd0c8a8d2323986907c8a3cec2b7955136fe230 (commit) from a68e574edbce99ebe1a2eee11304c76520fd46b2 (commit)
http://gitweb.samba.org/?samba.git;a=shortlog;h=v3-0-test - Log ----------------------------------------------------------------- commit 5cd0c8a8d2323986907c8a3cec2b7955136fe230 Author: Andreas Schneider <[EMAIL PROTECTED]> Date: Fri Feb 22 17:06:24 2008 +0100 Add variable to define if a share should be hidden. If you create a share on a Windows machine called foo$ then this share is of the type STYPE_DISKTREE. So it is possible to administrate this kind of share. Tested on Windows NT and 2003. In samba we assume that if a share with a $ at the end must be of the type STYPE_DISKTREE_HIDDEN. This is wrong, so we need a variable in the config to define if the share should be hidden or not. ----------------------------------------------------------------------- Summary of changes: source/param/loadparm.c | 5 +++++ source/rpc_server/srv_srvsvc_nt.c | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/source/param/loadparm.c b/source/param/loadparm.c index 0bb17a2..dcd0b14 100644 --- a/source/param/loadparm.c +++ b/source/param/loadparm.c @@ -405,6 +405,7 @@ typedef struct { BOOL bRead_only; BOOL bNo_set_dir; BOOL bGuest_only; + BOOL bHidden; BOOL bGuest_ok; BOOL bPrint_ok; BOOL bMap_system; @@ -547,6 +548,7 @@ static service sDefault = { True, /* bRead_only */ True, /* bNo_set_dir */ False, /* bGuest_only */ + False, /* bHidden */ False, /* bGuest_ok */ False, /* bPrint_ok */ False, /* bMap_system */ @@ -938,6 +940,7 @@ static struct parm_struct parm_table[] = { {"inherit owner", P_BOOL, P_LOCAL, &sDefault.bInheritOwner, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL, NULL, FLAG_HIDE}, + {"hidden", P_BOOL, P_LOCAL, &sDefault.bHidden, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, {"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, {"public", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL, NULL, FLAG_HIDE}, @@ -2093,6 +2096,7 @@ FN_LOCAL_BOOL(lp_readonly, bRead_only) FN_LOCAL_BOOL(lp_no_set_dir, bNo_set_dir) FN_LOCAL_BOOL(lp_guest_ok, bGuest_ok) FN_LOCAL_BOOL(lp_guest_only, bGuest_only) +FN_LOCAL_BOOL(lp_hidden, bHidden) FN_LOCAL_BOOL(lp_print_ok, bPrint_ok) FN_LOCAL_BOOL(lp_map_hidden, bMap_hidden) FN_LOCAL_BOOL(lp_map_archive, bMap_archive) @@ -2713,6 +2717,7 @@ static BOOL lp_add_ipc(const char *ipc_name, BOOL guest_ok) ServicePtrs[i]->bAvailable = True; ServicePtrs[i]->bRead_only = True; ServicePtrs[i]->bGuest_only = False; + ServicePtrs[i]->bHidden = True; ServicePtrs[i]->bGuest_ok = guest_ok; ServicePtrs[i]->bPrint_ok = False; ServicePtrs[i]->bBrowseable = sDefault.bBrowseable; diff --git a/source/rpc_server/srv_srvsvc_nt.c b/source/rpc_server/srv_srvsvc_nt.c index d03ab66..8d58360 100644 --- a/source/rpc_server/srv_srvsvc_nt.c +++ b/source/rpc_server/srv_srvsvc_nt.c @@ -203,9 +203,6 @@ static WERROR net_enum_files( TALLOC_CTX *ctx, FILE_INFO_3 **info, ********************************************************************/ static uint32 get_share_type(int snum) { - char *net_name = lp_servicename(snum); - int len_net_name = strlen(net_name); - /* work out the share type */ uint32 type = STYPE_DISKTREE; @@ -213,7 +210,7 @@ static uint32 get_share_type(int snum) type = STYPE_PRINTQ; if (strequal(lp_fstype(snum), "IPC")) type = STYPE_IPC; - if (net_name[len_net_name-1] == '$') + if (lp_hidden(snum)) type |= STYPE_HIDDEN; return type; -- Samba Shared Repository