selftest/Samba4: make use of get_cmd_env_vars() to setup all relevant env variables
[samba.git] / source3 / modules / vfs_tsmsm.c
index 27b213696736cf341d04c728d0ab78b9643f31a9..89191f7e3ae55be0d38083365fc33754efcacc3e 100644 (file)
@@ -197,7 +197,7 @@ static bool tsmsm_is_offline(struct vfs_handle_struct *handle,
         * become_root() is just as good anyway (tridge) 
         */
 
-       /* Also, AIX has DMAPI but no POSIX capablities support. In this case,
+       /* Also, AIX has DMAPI but no POSIX capabilities support. In this case,
         * we need to be root to do DMAPI manipulations.
         */
        become_root();
@@ -268,20 +268,6 @@ done:
        return offline;
 }
 
-static NTSTATUS tsmsm_get_dos_attributes(struct vfs_handle_struct *handle,
-                                        struct smb_filename *fname,
-                                        uint32_t *dosmode)
-{
-       bool offline;
-
-       offline = tsmsm_is_offline(handle, fname, &fname->st);
-       if (offline) {
-               *dosmode |= FILE_ATTRIBUTE_OFFLINE;
-       }
-
-       return SMB_VFS_NEXT_GET_DOS_ATTRIBUTES(handle, fname, dosmode);
-}
-
 static NTSTATUS tsmsm_fget_dos_attributes(struct vfs_handle_struct *handle,
                                          files_struct *fsp,
                                          uint32_t *dosmode)
@@ -519,7 +505,7 @@ static NTSTATUS tsmsm_set_offline(struct vfs_handle_struct *handle,
        /* Now, call the script */
        command = talloc_asprintf(tsmd, "%s offline \"%s\"", tsmd->hsmscript, path);
        if(!command) {
-               DEBUG(1, ("tsmsm_set_offline: can't allocate memory to run hsm script"));
+               DEBUG(1, ("tsmsm_set_offline: can't allocate memory to run hsm script\n"));
                return NT_STATUS_NO_MEMORY;
        }
        DEBUG(10, ("tsmsm_set_offline: Running [%s]\n", command));
@@ -533,37 +519,6 @@ static NTSTATUS tsmsm_set_offline(struct vfs_handle_struct *handle,
        return NT_STATUS_OK;
 }
 
-static NTSTATUS tsmsm_set_dos_attributes(struct vfs_handle_struct *handle,
-                                        const struct smb_filename *smb_fname,
-                                        uint32_t dosmode)
-{
-       NTSTATUS status;
-       uint32_t old_dosmode;
-       struct smb_filename *fname = NULL;
-
-       /* dos_mode() doesn't like const smb_fname */
-       fname = cp_smb_filename(talloc_tos(), smb_fname);
-       if (fname == NULL) {
-               return NT_STATUS_NO_MEMORY;
-       }
-
-       old_dosmode = dos_mode(handle->conn, fname);
-       TALLOC_FREE(fname);
-
-       status = SMB_VFS_NEXT_SET_DOS_ATTRIBUTES(handle, smb_fname, dosmode);
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
-
-       if (!(old_dosmode & FILE_ATTRIBUTE_OFFLINE) &&
-           (dosmode & FILE_ATTRIBUTE_OFFLINE))
-       {
-               return NT_STATUS_OK;
-       }
-
-       return tsmsm_set_offline(handle, smb_fname);
-}
-
 static NTSTATUS tsmsm_fset_dos_attributes(struct vfs_handle_struct *handle,
                                          struct files_struct *fsp,
                                          uint32_t dosmode)
@@ -571,7 +526,7 @@ static NTSTATUS tsmsm_fset_dos_attributes(struct vfs_handle_struct *handle,
        NTSTATUS status;
        uint32_t old_dosmode;
 
-       old_dosmode = dos_mode(handle->conn, fsp->fsp_name);
+       old_dosmode = fdos_mode(fsp);
 
        status = SMB_VFS_NEXT_FSET_DOS_ATTRIBUTES(handle, fsp, dosmode);
        if (!NT_STATUS_IS_OK(status)) {
@@ -604,9 +559,7 @@ static struct vfs_fn_pointers tsmsm_fns = {
        .pwrite_send_fn = tsmsm_pwrite_send,
        .pwrite_recv_fn = tsmsm_pwrite_recv,
        .sendfile_fn = tsmsm_sendfile,
-       .set_dos_attributes_fn = tsmsm_set_dos_attributes,
        .fset_dos_attributes_fn = tsmsm_fset_dos_attributes,
-       .get_dos_attributes_fn = tsmsm_get_dos_attributes,
        .get_dos_attributes_send_fn = vfs_not_implemented_get_dos_attributes_send,
        .get_dos_attributes_recv_fn = vfs_not_implemented_get_dos_attributes_recv,
        .fget_dos_attributes_fn = tsmsm_fget_dos_attributes,