From c92881d6d83f37d762d5ee3fd75fd02fd4ed5e08 Mon Sep 17 00:00:00 2001 From: "mathiaz@ubuntu.com" Date: Thu, 5 Jun 2025 19:12:34 +0300 Subject: [PATCH] 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 --- docs-xml/smbdotconf/misc/usersharemaxshares.xml | 2 +- lib/param/loadparm.c | 2 ++ source3/param/loadparm.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) 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. */ -- 2.30.2