Package: samba / 2:4.5.16+dfsg-1+deb9u2

usershare.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Description: 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.
Author: Mathias Gug <mathiaz@ubuntu.com>,
Author: Steve Langasek <vorlon@debian.org>
Bug-Debian: http://bugs.debian.org/443230
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/samba/+bug/128548
Forwarded: not-needed

Index: samba/docs/manpages/net.8
===================================================================
--- samba.orig/docs/manpages/net.8
+++ samba/docs/manpages/net.8
@@ -1063,9 +1063,9 @@ Something we failed to parse\&. Default
 .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
Index: samba/source3/param/loadparm.c
===================================================================
--- samba.orig/source3/param/loadparm.c
+++ samba/source3/param/loadparm.c
@@ -842,7 +842,7 @@ static void init_globals(struct loadparm
 	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. */
Index: samba/docs-xml/smbdotconf/misc/usersharemaxshares.xml
===================================================================
--- samba.orig/docs-xml/smbdotconf/misc/usersharemaxshares.xml
+++ samba/docs-xml/smbdotconf/misc/usersharemaxshares.xml
@@ -9,5 +9,5 @@
 	</para>
 
 </description>
-<value type="default">0</value>
+<value type="default">100</value>
 </samba:parameter>
Index: samba/lib/param/loadparm.c
===================================================================
--- samba.orig/lib/param/loadparm.c
+++ samba/lib/param/loadparm.c
@@ -2878,6 +2878,8 @@ struct loadparm_context *loadparm_init(T
 
 	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");