Revert "s3/service: convert lp_force_user() to const"
authorDavid Disseldorp <ddiss@samba.org>
Sun, 8 Jul 2018 23:36:11 +0000 (01:36 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 9 Jul 2018 19:30:58 +0000 (21:30 +0200)
This reverts commit c58194e3d296f4e14e7689bdf192c561635ae161.
As mentioned by Andrew, we shouldn't break environments where
"force user" has been configured to use substituted variables.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
docs-xml/smbdotconf/security/forceuser.xml
source3/smbd/service.c

index 3316afe14ac1a76aff2f67a43ef93236f22b2225..ff5c7a2f3f11202d62b514fc8b7c7d3ddc6c4df4 100644 (file)
@@ -1,6 +1,5 @@
 <samba:parameter name="force user"
                  type="string"
-                 constant="1"
                  context="S"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
index 2fa7c608a2b9865ee0ea899f61a58154c334699d..df72172d9b015d1a295daa71073e8bcc6a2448a6 100644 (file)
@@ -372,7 +372,7 @@ NTSTATUS set_conn_force_user_group(connection_struct *conn, int snum)
 {
        NTSTATUS status;
 
-       if (*lp_force_user(snum)) {
+       if (*lp_force_user(talloc_tos(), snum)) {
 
                /*
                 * Replace conn->session_info with a completely faked up one
@@ -384,7 +384,7 @@ NTSTATUS set_conn_force_user_group(connection_struct *conn, int snum)
                struct auth_session_info *forced_serverinfo;
                bool guest;
 
-               fuser = talloc_string_sub(conn, lp_force_user(snum), "%S",
+               fuser = talloc_string_sub(conn, lp_force_user(talloc_tos(), snum), "%S",
                                          lp_const_servicename(snum));
                if (fuser == NULL) {
                        return NT_STATUS_NO_MEMORY;