smbd: remove "only user" and "username" parameters
authorUri Simchoni <uri@samba.org>
Wed, 6 Apr 2016 05:50:27 +0000 (08:50 +0300)
committerJeremy Allison <jra@samba.org>
Thu, 5 May 2016 23:32:24 +0000 (01:32 +0200)
These have long been superseded by "valid users"

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
docs-xml/smbdotconf/security/onlyuser.xml [deleted file]
docs-xml/smbdotconf/security/username.xml [deleted file]
source3/param/loadparm.c
source3/smbd/share_access.c

diff --git a/docs-xml/smbdotconf/security/onlyuser.xml b/docs-xml/smbdotconf/security/onlyuser.xml
deleted file mode 100644 (file)
index 3b62ba6..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<samba:parameter name="only user"
-                 type="boolean"
-                 context="S"
-                 deprecated="1"
-                 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
-<description>
-    <para>To restrict a service to a particular set of users you
-    can use the <smbconfoption name="valid users"/> parameter.</para>
-
-    <para>This parameter is deprecated</para>
-
-    <para>However, it currently operates only in conjunction with
-    <smbconfoption name="username"/>.  The supported way to restrict
-    a service to a particular set of users is the
-    <smbconfoption name="valid users"/> parameter.</para>
-
-</description>
-
-<related>user</related>
-
-<value type="default">no</value>
-</samba:parameter>
diff --git a/docs-xml/smbdotconf/security/username.xml b/docs-xml/smbdotconf/security/username.xml
deleted file mode 100644 (file)
index a04a997..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<samba:parameter name="username"
-                 context="S"
-                 type="string"
-                 deprecated="1"
-                 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
-<synonym>user</synonym>
-<synonym>users</synonym>
-<description>
-    <para>To restrict a service to a particular set of users you 
-    can use the <smbconfoption name="valid users"/> parameter.</para>
-
-    <para>This parameter is deprecated</para>
-
-    <para>However, it currently operates only in conjunction with
-    <smbconfoption name="only user"/>.  The supported way to restrict
-    a service to a particular set of users is the
-    <smbconfoption name="valid users"/> parameter.</para>
-
-</description>
-
-<value type="default"><comment>The guest account if a guest service, 
-               else &lt;empty string&gt;.</comment></value>
-
-<value type="example">fred, mary, jack, jane, @users, @pcgroup</value>
-</samba:parameter>
index c6a3cf6e3874608831cc5336146e23770b0ab36a..c17c099d4072f6368dc35305abfed6cc201648c4 100644 (file)
@@ -118,7 +118,6 @@ static struct loadparm_service sDefault =
        .usershare_last_mod = {0, 0},
        .szService = NULL,
        .path = NULL,
-       .username = NULL,
        .invalid_users = NULL,
        .valid_users = NULL,
        .admin_users = NULL,
@@ -202,7 +201,6 @@ static struct loadparm_service sDefault =
        .oplocks = true,
        .kernel_oplocks = false,
        .level2_oplocks = true,
-       .only_user = false,
        .mangled_names = true,
        .wide_links = false,
        .follow_symlinks = true,
@@ -1571,7 +1569,6 @@ static bool lp_add_ipc(const char *ipc_name, bool guest_ok)
        }
 
        lpcfg_string_set(ServicePtrs[i], &ServicePtrs[i]->path, tmpdir());
-       lpcfg_string_set(ServicePtrs[i], &ServicePtrs[i]->username, "");
        lpcfg_string_set(ServicePtrs[i], &ServicePtrs[i]->comment, comment);
        lpcfg_string_set(ServicePtrs[i], &ServicePtrs[i]->fstype, "IPC");
        ServicePtrs[i]->max_connections = 0;
index 8b165e6c864df20ca94fca3390bc37c74cd428c1..fa56063ca2bd71c05569eed71b268cf36b20ffd4 100644 (file)
@@ -183,7 +183,7 @@ bool token_contains_name_in_list(const char *username,
 /*
  * Check whether the user described by "token" has access to share snum.
  *
- * This looks at "invalid users", "valid users" and "only user/username"
+ * This looks at "invalid users" and "valid users".
  *
  * Please note that the user name and share names passed in here mainly for
  * the substitution routines that expand the parameter values, the decision
@@ -217,22 +217,6 @@ bool user_ok_token(const char *username, const char *domain,
                }
        }
 
-       if (lp_only_user(snum)) {
-               const char *list[2];
-               list[0] = lp_username(talloc_tos(), snum);
-               list[1] = NULL;
-               if ((list[0] == NULL) || (*list[0] == '\0')) {
-                       DEBUG(0, ("'only user = yes' and no 'username ='\n"));
-                       return False;
-               }
-               if (!token_contains_name_in_list(NULL, domain,
-                                                lp_servicename(talloc_tos(), snum),
-                                                token, list)) {
-                       DEBUG(10, ("%s != 'username'\n", username));
-                       return False;
-               }
-       }
-
        DEBUG(10, ("user_ok_token: share %s is ok for unix user %s\n",
                   lp_servicename(talloc_tos(), snum), username));
 
@@ -243,7 +227,7 @@ bool user_ok_token(const char *username, const char *domain,
  * Check whether the user described by "token" is restricted to read-only
  * access on share snum.
  *
- * This looks at "invalid users", "valid users" and "only user/username"
+ * This looks at "read list", "write list" and "read only".
  *
  * Please note that the user name and share names passed in here mainly for
  * the substitution routines that expand the parameter values, the decision