diff --git a/docs-xml/smbdotconf/misc/usersharemaxshares.xml b/docs-xml/smbdotconf/misc/usersharemaxshares.xml index 0d69bb82..e9858571 100644 --- a/docs-xml/smbdotconf/misc/usersharemaxshares.xml +++ b/docs-xml/smbdotconf/misc/usersharemaxshares.xml @@ -9,5 +9,5 @@ -0 +100 diff --git a/docs/manpages/net.8 b/docs/manpages/net.8 index ef6bd74d..80b76900 100644 --- a/docs/manpages/net.8 +++ b/docs/manpages/net.8 @@ -1270,9 +1270,9 @@ Something we failed to parse\&. Default action is to "edit" it in interactive an .RE .SS "USERSHARE" .PP -Starting with version 3\&.0\&.23, a Samba server now supports the ability for non\-root users to add user defined shares to be exported using the "net usershare" commands\&. +Starting with version 3\&.0\&.23, a Samba server now supports the ability for non\-root users to add user-defined shares to be exported using the "net usershare" commands\&. .PP -To set this up, first set up your smb\&.conf by adding to the [global] section: usershare path = /usr/local/samba/lib/usershares Next create the directory /usr/local/samba/lib/usershares, change the owner to root and set the group owner to the UNIX group who should have the ability to create usershares, for example a group called "serverops"\&. Set the permissions on /usr/local/samba/lib/usershares to 01770\&. (Owner and group all access, no access for others, plus the sticky bit, which means that a file in that directory can be renamed or deleted only by the owner of the file)\&. Finally, tell smbd how many usershares you will allow by adding to the [global] section of smb\&.conf a line such as : usershare max shares = 100\&. To allow 100 usershare definitions\&. Now, members of the UNIX group "serverops" can create user defined shares on demand using the commands below\&. +Members of the UNIX group "sambashare" can create user-defined shares on demand using the commands below\&. .PP The usershare commands are: .RS 4 diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c index 883d4167..a447eb5f 100644 --- a/lib/param/loadparm.c +++ b/lib/param/loadparm.c @@ -2985,6 +2985,8 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx) lpcfg_do_global_parameter(lp_ctx, "init logon delay", "100"); + lpcfg_do_global_parameter(lp_ctx, "usershare max shares", "100"); + lpcfg_do_global_parameter(lp_ctx, "usershare owner only", "yes"); lpcfg_do_global_parameter(lp_ctx, "-valid", "yes"); diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index a8d5fdc5..c21777b5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -850,7 +850,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals) lpcfg_string_set(Globals.ctx, &Globals.usershare_path, s); TALLOC_FREE(s); lpcfg_string_set(Globals.ctx, &Globals.usershare_template_share, ""); - Globals.usershare_max_shares = 0; + Globals.usershare_max_shares = 100; /* By default disallow sharing of directories not owned by the sharer. */ Globals.usershare_owner_only = true; /* By default disallow guest access to usershares. */