smbdotconf: mark "veto files" with substitution="1"
authorRalph Boehme <slow@samba.org>
Mon, 4 Nov 2019 11:29:44 +0000 (12:29 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 27 Nov 2019 10:25:33 +0000 (10:25 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
docs-xml/smbdotconf/filename/vetofiles.xml
source3/modules/vfs_fruit.c
source3/smbd/close.c
source3/smbd/service.c

index acbc3dcffb3be2eeb1d68f66fbfeb3ab5ca5ae78..11bb51e6c76d7a9c1ee27fa021dd9eba32203d50 100644 (file)
@@ -1,6 +1,7 @@
 <samba:parameter name="veto files"
                  context="S"
                  type="string"
+                 substitution="1"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
  <description>
        <para>
index 02aaa34da885d12066623868edce79f4a4dbda7d..265abdcb304ab5f5b2f5664e7f7d378b5632cc4a 100644 (file)
@@ -1254,6 +1254,8 @@ static int fruit_connect(vfs_handle_struct *handle,
        int rc;
        char *list = NULL, *newlist = NULL;
        struct fruit_config_data *config;
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
 
        DEBUG(10, ("fruit_connect\n"));
 
@@ -1271,7 +1273,7 @@ static int fruit_connect(vfs_handle_struct *handle,
                                struct fruit_config_data, return -1);
 
        if (config->veto_appledouble) {
-               list = lp_veto_files(talloc_tos(), SNUM(handle->conn));
+               list = lp_veto_files(talloc_tos(), lp_sub, SNUM(handle->conn));
 
                if (list) {
                        if (strstr(list, "/" ADOUBLE_NAME_PREFIX "*/") == NULL) {
index 18defc1ac5c87ff8be1517ae4e8472af1cac58be..6b63ea2c64eee076f44ccd2fb7c0f5da09cb0768 100644 (file)
@@ -927,6 +927,8 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, files_struct *fsp)
 {
        connection_struct *conn = fsp->conn;
        struct smb_filename *smb_dname = fsp->fsp_name;
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        int ret;
 
        SMB_ASSERT(!is_ntfs_stream_smb_fname(smb_dname));
@@ -961,7 +963,7 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, files_struct *fsp)
                return NT_STATUS_OK;
        }
 
-       if(((errno == ENOTEMPTY)||(errno == EEXIST)) && *lp_veto_files(talloc_tos(), SNUM(conn))) {
+       if(((errno == ENOTEMPTY)||(errno == EEXIST)) && *lp_veto_files(talloc_tos(), lp_sub, SNUM(conn))) {
                /*
                 * Check to see if the only thing in this directory are
                 * vetoed files/directories. If so then delete them and
index f82bc0d5d1311e21433a41fe5bcb37f38b7ef251..54979f77ffbfc6243a8dbe75b2e69c20132ed87b 100644 (file)
@@ -824,7 +824,7 @@ static NTSTATUS make_connection_snum(struct smbXsrv_connection *xconn,
        /* Add veto/hide lists */
        if (!IS_IPC(conn) && !IS_PRINT(conn)) {
                set_namearray( &conn->veto_list,
-                              lp_veto_files(talloc_tos(), snum));
+                              lp_veto_files(talloc_tos(), lp_sub, snum));
                set_namearray( &conn->hide_list,
                               lp_hide_files(talloc_tos(), lp_sub, snum));
                set_namearray( &conn->veto_oplock_list,