From: mathiaz@ubuntu.com Date: Mon, 6 Jan 2025 18:20:31 +0000 (+0300) Subject: Enable net usershares by default at build time X-Git-Tag: archive/raspbian/2%4.22.0+dfsg-1+rpi1^2^2^2~23 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=587630a230c750f5c97f0d63e807ce22978928ac;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 ed5160d5..d427db99 100644 --- a/lib/param/loadparm.c +++ b/lib/param/loadparm.c @@ -3055,6 +3055,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 f9bc1c42..ab712b51 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -858,7 +858,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. */