LCOV - code coverage report
Current view: top level - source3/modules - vfs_offline.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 7 7 100.0 %
Date: 2021-09-23 10:06:22 Functions: 4 4 100.0 %

          Line data    Source code
       1             : /*
       2             :   Unix SMB/CIFS implementation.
       3             :   Samba VFS module for marking all files as offline.
       4             : 
       5             :   (c) Uri Simchoni, 2015
       6             : 
       7             :    This program is free software; you can redistribute it and/or modify
       8             :    it under the terms of the GNU General Public License as published by
       9             :    the Free Software Foundation; either version 3 of the License, or
      10             :    (at your option) any later version.
      11             : 
      12             :    This program is distributed in the hope that it will be useful,
      13             :    but WITHOUT ANY WARRANTY; without even the implied warranty of
      14             :    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      15             :    GNU General Public License for more details.
      16             : 
      17             :    You should have received a copy of the GNU General Public License
      18             :    along with this program.  If not, see <http://www.gnu.org/licenses/>.
      19             :  */
      20             : 
      21             : #include "includes.h"
      22             : 
      23           2 : static uint32_t offline_fs_capabilities(struct vfs_handle_struct *handle,
      24             :                                         enum timestamp_set_resolution *p_ts_res)
      25             : {
      26           2 :         return SMB_VFS_NEXT_FS_CAPABILITIES(handle, p_ts_res) |
      27             :                FILE_SUPPORTS_REMOTE_STORAGE;
      28             : }
      29             : 
      30          22 : static NTSTATUS offline_fget_dos_attributes(struct vfs_handle_struct *handle,
      31             :                                             struct files_struct *fsp,
      32             :                                             uint32_t *dosmode)
      33             : {
      34          22 :         *dosmode |= FILE_ATTRIBUTE_OFFLINE;
      35          22 :         return SMB_VFS_NEXT_FGET_DOS_ATTRIBUTES(handle, fsp, dosmode);
      36             : }
      37             : 
      38             : static struct vfs_fn_pointers offline_fns = {
      39             :     .fs_capabilities_fn = offline_fs_capabilities,
      40             :         .get_dos_attributes_send_fn = vfs_not_implemented_get_dos_attributes_send,
      41             :         .get_dos_attributes_recv_fn = vfs_not_implemented_get_dos_attributes_recv,
      42             :         .fget_dos_attributes_fn = offline_fget_dos_attributes,
      43             : };
      44             : 
      45             : static_decl_vfs;
      46          22 : NTSTATUS vfs_offline_init(TALLOC_CTX *ctx)
      47             : {
      48          22 :         return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "offline",
      49             :                                 &offline_fns);
      50             : }

Generated by: LCOV version 1.13