Due a hidden side-effect of find_service() function when adding a new share via MMC (Microsoft Console: rclick on My Computer-> Manage -> Action -> Connect to another computer-> Enter samba server name -> System tools -> rclick on Shares -> New share...) entered share name is distorted (converted to lowercase). In such view mixed-case share names are impossible (they are always lowercased). For example, when adding new share 'MyShareWithCapitalLetters' via MMC, the following command-line is running: [2010/11/08 13:05:12.022746, 10, pid=13966] rpc_server/srv_srvsvc_nt.c:2019(_srvsvc_NetShareAdd) _srvsvc_NetShareAdd: Running [./tools/add_share "smb.conf" "mysharewithcapitalletters" "/my_share" "Test share with capitals in the name" "0"] Attached patch can fix this problem: --- source3/rpc_server/srv_srvsvc_nt.c +++ source3/rpc_server/srv_srvsvc_nt.c @@ -1737,7 +1737,7 @@ WERROR _srvsvc_NetShareAdd(pipes_struct struct srvsvc_NetShareAdd *r) { char *command = NULL; - char *share_name = NULL; + char *share_name = NULL, *share_name_copy = NULL; char *comment = NULL; char *pathname = NULL; int type; @@ -1827,7 +1827,17 @@ WERROR _srvsvc_NetShareAdd(pipes_struct return WERR_ACCESS_DENIED; } - snum = find_service(share_name); + /* Dell 2010 / Samba upgrade project / MMC-related small fixes: + Before call to find_service make a copy of share_name + because find_service() modifies its parameter - + it converts share_name to to canonical form (all lowercase letters). + NB: find_service() converts share_name as a size-effect only if the service was not found; + so this fix is not applicable for _srvsvc_NetShareSetInfo because no translation there. */ + + if ((share_name_copy = talloc_strdup(ctx, share_name)) == NULL) { + return WERR_NOMEM; + } + snum = find_service(share_name_copy); /* Share already exists. */ if (snum >= 0) {
*** This bug has been marked as a duplicate of bug 7781 ***