<netAPI> [Guenther-sir] NetShareAdd not working samba 3.5.8
okmanoj at indiatimes.com
okmanoj at indiatimes.com
Tue May 3 00:20:01 MDT 2011
Dear Samba members.
CC: Guenther-sir
I am trying to create test application in linux which will dynamically add samba file share to local Linux.
I am using samba "config backend = registry"
My reg conf looks like
[root at manoj bin]# /home/manoj/project/installed/samba-3.5.8/bin/net conf list
[global]
map to guest = bad user
client NTLMv2 auth = yes
guest account = root
encrypt passwords = yes
max log size = 25000
local master = no
deadtime = 1
server string = SMB Server %h
netbios name = LINUXPC
workgroup = workgroup
log file = /home/manoj/project/log/samba_%m.log
log level = 100
add share command = /home/manoj/project/installed/samba-3.5.8/bin/net conf addshare
When I ran samba test binary share_add "127.0.0.1" "FS3" "/home"
It returned "WERR_ACCESS_DENIED"
While debugging i found in logs
[2011/05/03 14:14:29.411181, 10] rpc_server/srv_srvsvc_nt.c:1866(_srvsvc_NetShareAdd)
_srvsvc_NetShareAdd: Running [/home/manoj/project/installed/samba-3.5.8/bin/net conf addshare "/home/manoj/project/config/smb.conf" "fs3" "/home" "Test share created via NetApi" 0]
[2011/05/03 14:14:29.428509, 3] rpc_server/srv_srvsvc_nt.c:1887(_srvsvc_NetShareAdd)
_srvsvc_NetShareAdd: Running [/home/manoj/project/installed/samba-3.5.8/bin/net conf addshare "/home/manoj/project/config/smb.conf" "fs3" "/home" "Test share created via NetApi" 0] returned (255)
[2011/05/03 14:14:29.428650, 1] ../librpc/ndr/ndr.c:251(ndr_print_function_debug)
srvsvc_NetShareAdd: struct srvsvc_NetShareAdd
out: struct srvsvc_NetShareAdd
parm_error : *
parm_error : 0x00000000 (0)
result : WERR_ACCESS_DENIED
means "/home/manoj/project/installed/samba-3.5.8/bin/net conf addshare "/home/manoj/project/config/smb.conf" "fs3" "/home" "Test share created via NetApi" 0"
however correct format for "net conf addshare" is /home/manoj/project/installed/samba-3.5.8/bin/net conf addshare "fs5" "/home" "writeable=n" "guest_ok=y" "Test share created via NetApi"
confog file path and max connection is not required also "writeable=n" "guest_ok=y" is must parameter.
IF i modify rpc_server/srv_srvsvc_nt.c to
#if 0 /*Samba original source*/
command = talloc_asprintf(ctx,
"%s \"%s\" \"%s\" \"%s\" \"%s\" %d",
lp_add_share_cmd(),
get_dyn_CONFIGFILE(),
share_name,
path,
comment ? comment : "",
max_connections);
#endif
/*Samba modified source: removed conf file name, added writable and guest param*/
command = talloc_asprintf(ctx,
"%s \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"",
lp_add_share_cmd(),
share_name,
path,
"writeable=n","guest_ok=y",
comment ? comment : "");
addition of share to local m/c (Linux box FC 13) is working fine.
I believe samba source will NOT have this basic problem, May be I am doing something wrong.
Please guide me.
Do let me know if more information is required.
Regards
Manoj
More information about the samba-technical
mailing list