Extend NTIMES to allow setting create_time
[metze/samba/wip.git] / source3 / modules / vfs_cap.c
index 56ab48f9e2304cf5f38c11dc82792a0f7a0232ff..ac85d3a8043d65c33a255ebf15c1e883d7766d15 100644 (file)
 static char *capencode(TALLOC_CTX *ctx, const char *from);
 static char *capdecode(TALLOC_CTX *ctx, const char *from);
 
-static SMB_BIG_UINT cap_disk_free(vfs_handle_struct *handle, const char *path,
-       bool small_query, SMB_BIG_UINT *bsize,
-       SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+static uint64_t cap_disk_free(vfs_handle_struct *handle, const char *path,
+       bool small_query, uint64_t *bsize,
+       uint64_t *dfree, uint64_t *dsize)
 {
        char *cappath = capencode(talloc_tos(), path);
 
        if (!cappath) {
                errno = ENOMEM;
-               return (SMB_BIG_UINT)-1;
+               return (uint64_t)-1;
        }
        return SMB_VFS_NEXT_DISK_FREE(handle, cappath, small_query, bsize,
                                        dfree, dsize);
@@ -208,7 +208,8 @@ static int cap_chdir(vfs_handle_struct *handle, const char *path)
        return SMB_VFS_NEXT_CHDIR(handle, cappath);
 }
 
-static int cap_ntimes(vfs_handle_struct *handle, const char *path, const struct timespec ts[2])
+static int cap_ntimes(vfs_handle_struct *handle, const char *path,
+                     struct smb_file_time *ft)
 {
        char *cappath = capencode(talloc_tos(), path);
 
@@ -216,7 +217,7 @@ static int cap_ntimes(vfs_handle_struct *handle, const char *path, const struct
                errno = ENOMEM;
                return -1;
        }
-       return SMB_VFS_NEXT_NTIMES(handle, cappath, ts);
+       return SMB_VFS_NEXT_NTIMES(handle, cappath, ft);
 }
 
 
@@ -278,17 +279,6 @@ static char *cap_realpath(vfs_handle_struct *handle, const char *path, char *res
        return SMB_VFS_NEXT_REALPATH(handle, path, resolved_path);
 }
 
-static NTSTATUS cap_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *path, uint32 security_info_sent, struct security_descriptor *psd)
-{
-       char *cappath = capencode(talloc_tos(), path);
-
-       if (!cappath) {
-               errno = ENOMEM;
-               return NT_STATUS_NO_MEMORY;
-       }
-       return SMB_VFS_NEXT_SET_NT_ACL(handle, fsp, cappath, security_info_sent, psd);
-}
-
 static int cap_chmod_acl(vfs_handle_struct *handle, const char *path, mode_t mode)
 {
        char *cappath = capencode(talloc_tos(), path);
@@ -420,7 +410,7 @@ static int cap_lremovexattr(vfs_handle_struct *handle, const char *path, const c
         return SMB_VFS_NEXT_LREMOVEXATTR(handle, cappath, capname);
 }
 
-static int cap_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *path)
+static int cap_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *path)
 {
        char *cappath = capencode(talloc_tos(), path);
 
@@ -428,7 +418,7 @@ static int cap_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp,
                errno = ENOMEM;
                return -1;
        }
-        return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, fd, cappath);
+        return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, cappath);
 }
 
 static int cap_setxattr(vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags)
@@ -455,7 +445,7 @@ static int cap_lsetxattr(vfs_handle_struct *handle, const char *path, const char
         return SMB_VFS_NEXT_LSETXATTR(handle, cappath, capname, value, size, flags);
 }
 
-static int cap_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *path, const void *value, size_t size, int flags)
+static int cap_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *path, const void *value, size_t size, int flags)
 {
        char *cappath = capencode(talloc_tos(), path);
 
@@ -463,7 +453,7 @@ static int cap_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp,int
                errno = ENOMEM;
                return -1;
        }
-        return SMB_VFS_NEXT_FSETXATTR(handle, fsp, fd, cappath, value, size, flags);
+        return SMB_VFS_NEXT_FSETXATTR(handle, fsp, cappath, value, size, flags);
 }
 
 /* VFS operations structure */
@@ -499,10 +489,6 @@ static vfs_op_tuple cap_op_tuples[] = {
        {SMB_VFS_OP(cap_mknod),                 SMB_VFS_OP_MKNOD,               SMB_VFS_LAYER_TRANSPARENT},
        {SMB_VFS_OP(cap_realpath),                      SMB_VFS_OP_REALPATH,            SMB_VFS_LAYER_TRANSPARENT},
 
-       /* NT File ACL operations */
-
-       {SMB_VFS_OP(cap_set_nt_acl),                    SMB_VFS_OP_SET_NT_ACL,          SMB_VFS_LAYER_TRANSPARENT},
-
        /* POSIX ACL operations */
 
        {SMB_VFS_OP(cap_chmod_acl),                     SMB_VFS_OP_CHMOD_ACL,           SMB_VFS_LAYER_TRANSPARENT},