From 30ee286b1cacd7b6cda5960b774d18f7a8b8f776 Mon Sep 17 00:00:00 2001 From: "mathiaz@ubuntu.com" Date: Mon, 8 Jul 2024 16:40:49 +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 6ef29ed9..d75c75bc 100644 --- a/lib/param/loadparm.c +++ b/lib/param/loadparm.c @@ -3052,6 +3052,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 797baa66..4e2e78b6 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -857,7 +857,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