From: mathiaz@ubuntu.com Date: Fri, 18 Apr 2025 10:02:55 +0000 (+0300) Subject: Enable net usershares by default at build time X-Git-Tag: archive/raspbian/2%4.22.1+dfsg-1+rpi1^2~17 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2be55e0f041e864dfff7b4d654ffae46d61d7a5c;p=samba.git Enable net usershares by default at build time Enable net usershares by default at build time, with a limit of 100, and update the corresponding documentation. Bug-Debian: http://bugs.debian.org/443230 Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/samba/+bug/128548 Forwarded: not-needed Gbp-Pq: Name usershare.patch --- 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/lib/param/loadparm.c b/lib/param/loadparm.c index 7d7c7493..a846df1f 100644 --- a/lib/param/loadparm.c +++ b/lib/param/loadparm.c @@ -3056,6 +3056,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 71a40e55..0ad9563d 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -860,7 +860,7 @@ void loadparm_s3_init_globals(struct loadparm_context *lp_ctx, 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. */