smbd: Fix a typo in a few places
[samba.git] / source3 / modules / vfs_full_audit.c
index 25fd0cad326f8a991e5e5a23b40ed21a9f28b9aa..9fd8a7515720eec4a3ad229d180991190ec93f42 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * Auditing VFS module for samba.  Log selected file operations to syslog
  * facility.
  *
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
- *  
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *  
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
@@ -44,7 +44,7 @@
  * smbd_audit: nobody|192.168.234.1|create_file|ok|0x3|file|open|/tmp/file.txt
  *
  * where "nobody" is the connected username and "192.168.234.1" is the
- * client's IP address. 
+ * client's IP address.
  *
  * Options:
  *
@@ -110,8 +110,6 @@ typedef enum _vfs_op_type {
 
        SMB_VFS_OP_FDOPENDIR,
        SMB_VFS_OP_READDIR,
-       SMB_VFS_OP_SEEKDIR,
-       SMB_VFS_OP_TELLDIR,
        SMB_VFS_OP_REWINDDIR,
        SMB_VFS_OP_MKDIRAT,
        SMB_VFS_OP_CLOSEDIR,
@@ -134,7 +132,6 @@ typedef enum _vfs_op_type {
        SMB_VFS_OP_SENDFILE,
        SMB_VFS_OP_RECVFILE,
        SMB_VFS_OP_RENAMEAT,
-       SMB_VFS_OP_FSYNC,
        SMB_VFS_OP_FSYNC_SEND,
        SMB_VFS_OP_FSYNC_RECV,
        SMB_VFS_OP_STAT,
@@ -251,8 +248,6 @@ static struct {
        { SMB_VFS_OP_READ_DFS_PATHAT,   "read_dfs_pathat" },
        { SMB_VFS_OP_FDOPENDIR, "fdopendir" },
        { SMB_VFS_OP_READDIR,   "readdir" },
-       { SMB_VFS_OP_SEEKDIR,   "seekdir" },
-       { SMB_VFS_OP_TELLDIR,   "telldir" },
        { SMB_VFS_OP_REWINDDIR, "rewinddir" },
        { SMB_VFS_OP_MKDIRAT,   "mkdirat" },
        { SMB_VFS_OP_CLOSEDIR,  "closedir" },
@@ -272,7 +267,6 @@ static struct {
        { SMB_VFS_OP_SENDFILE,  "sendfile" },
        { SMB_VFS_OP_RECVFILE,  "recvfile" },
        { SMB_VFS_OP_RENAMEAT,  "renameat" },
-       { SMB_VFS_OP_FSYNC,     "fsync" },
        { SMB_VFS_OP_FSYNC_SEND,        "fsync_send" },
        { SMB_VFS_OP_FSYNC_RECV,        "fsync_recv" },
        { SMB_VFS_OP_STAT,      "stat" },
@@ -1021,12 +1015,11 @@ static DIR *smb_full_audit_fdopendir(vfs_handle_struct *handle,
 
 static struct dirent *smb_full_audit_readdir(vfs_handle_struct *handle,
                                             struct files_struct *dirfsp,
-                                            DIR *dirp,
-                                            SMB_STRUCT_STAT *sbuf)
+                                            DIR *dirp)
 {
        struct dirent *result;
 
-       result = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp, sbuf);
+       result = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp);
 
        /* This operation has no reasonable error condition
         * (End of dir is also failure), so always succeed.
@@ -1036,26 +1029,6 @@ static struct dirent *smb_full_audit_readdir(vfs_handle_struct *handle,
        return result;
 }
 
-static void smb_full_audit_seekdir(vfs_handle_struct *handle,
-                       DIR *dirp, long offset)
-{
-       SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset);
-
-       do_log(SMB_VFS_OP_SEEKDIR, True, handle, "");
-}
-
-static long smb_full_audit_telldir(vfs_handle_struct *handle,
-                       DIR *dirp)
-{
-       long result;
-
-       result = SMB_VFS_NEXT_TELLDIR(handle, dirp);
-
-       do_log(SMB_VFS_OP_TELLDIR, True, handle, "");
-
-       return result;
-}
-
 static void smb_full_audit_rewinddir(vfs_handle_struct *handle,
                        DIR *dirp)
 {
@@ -1102,7 +1075,7 @@ static int smb_full_audit_closedir(vfs_handle_struct *handle,
        int result;
 
        result = SMB_VFS_NEXT_CLOSEDIR(handle, dirp);
-       
+
        do_log(SMB_VFS_OP_CLOSEDIR, (result >= 0), handle, "");
 
        return result;
@@ -1203,7 +1176,7 @@ static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle,
 static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp)
 {
        int result;
-       
+
        result = SMB_VFS_NEXT_CLOSE(handle, fsp);
 
        do_log(SMB_VFS_OP_CLOSE, (result >= 0), handle, "%s",
@@ -1547,20 +1520,20 @@ static int smb_full_audit_stat(vfs_handle_struct *handle,
                               struct smb_filename *smb_fname)
 {
        int result;
-       
+
        result = SMB_VFS_NEXT_STAT(handle, smb_fname);
 
        do_log(SMB_VFS_OP_STAT, (result >= 0), handle, "%s",
               smb_fname_str_do_log(handle->conn, smb_fname));
 
-       return result;    
+       return result;
 }
 
 static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp,
                       SMB_STRUCT_STAT *sbuf)
 {
        int result;
-       
+
        result = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
 
        do_log(SMB_VFS_OP_FSTAT, (result >= 0), handle, "%s",
@@ -1573,13 +1546,13 @@ static int smb_full_audit_lstat(vfs_handle_struct *handle,
                                struct smb_filename *smb_fname)
 {
        int result;
-       
+
        result = SMB_VFS_NEXT_LSTAT(handle, smb_fname);
 
        do_log(SMB_VFS_OP_LSTAT, (result >= 0), handle, "%s",
               smb_fname_str_do_log(handle->conn, smb_fname));
 
-       return result;    
+       return result;
 }
 
 static int smb_full_audit_fstatat(
@@ -1646,7 +1619,7 @@ static int smb_full_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp,
                        mode_t mode)
 {
        int result;
-       
+
        result = SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
 
        do_log(SMB_VFS_OP_FCHMOD, (result >= 0), handle,
@@ -1705,7 +1678,7 @@ static struct smb_filename *smb_full_audit_getwd(vfs_handle_struct *handle,
        struct smb_filename *result;
 
        result = SMB_VFS_NEXT_GETWD(handle, ctx);
-       
+
        do_log(SMB_VFS_OP_GETWD, (result != NULL), handle, "%s",
                result == NULL? "" : result->base_name);
 
@@ -2115,12 +2088,14 @@ static NTSTATUS smb_full_audit_get_real_filename_at(
        return result;
 }
 
-static const char *smb_full_audit_connectpath(vfs_handle_struct *handle,
-                                       const struct smb_filename *smb_fname)
+static const char *smb_full_audit_connectpath(
+       vfs_handle_struct *handle,
+       const struct files_struct *dirfsp,
+       const struct smb_filename *smb_fname)
 {
        const char *result;
 
-       result = SMB_VFS_NEXT_CONNECTPATH(handle, smb_fname);
+       result = SMB_VFS_NEXT_CONNECTPATH(handle, dirfsp, smb_fname);
 
        do_log(SMB_VFS_OP_CONNECTPATH,
               result != NULL,
@@ -2946,8 +2921,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
        .read_dfs_pathat_fn = smb_full_audit_read_dfs_pathat,
        .fdopendir_fn = smb_full_audit_fdopendir,
        .readdir_fn = smb_full_audit_readdir,
-       .seekdir_fn = smb_full_audit_seekdir,
-       .telldir_fn = smb_full_audit_telldir,
        .rewind_dir_fn = smb_full_audit_rewinddir,
        .mkdirat_fn = smb_full_audit_mkdirat,
        .closedir_fn = smb_full_audit_closedir,
@@ -3057,6 +3030,6 @@ NTSTATUS vfs_full_audit_init(TALLOC_CTX *ctx)
                DEBUG(10, ("vfs_full_audit: Debug class number of "
                           "'full_audit': %d\n", vfs_full_audit_debug_level));
        }
-       
+
        return ret;
 }