Move sys_symlink() to libreplace.
[ira/wip.git] / source3 / modules / vfs_default.c
index 31ebb6352a179d5631c588aab69b9714e068d7f7..37b0fc392b5f94f02f69be363a413c0675503a82 100644 (file)
@@ -40,10 +40,10 @@ static void vfswrap_disconnect(vfs_handle_struct *handle)
 
 /* Disk operations */
 
-static SMB_BIG_UINT vfswrap_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 vfswrap_disk_free(vfs_handle_struct *handle,  const char *path, bool small_query, uint64_t *bsize,
+                              uint64_t *dfree, uint64_t *dsize)
 {
-       SMB_BIG_UINT result;
+       uint64_t result;
 
        result = sys_disk_free(handle->conn, path, small_query, bsize, dfree, dsize);
        return result;
@@ -208,13 +208,12 @@ static int vfswrap_open(vfs_handle_struct *handle,  const char *fname,
        return result;
 }
 
-static int vfswrap_close(vfs_handle_struct *handle, files_struct *fsp, int fd)
+static int vfswrap_close(vfs_handle_struct *handle, files_struct *fsp)
 {
        int result;
 
        START_PROFILE(syscall_close);
-
-       result = close(fd);
+       result = fd_close_posix(fsp);
        END_PROFILE(syscall_close);
        return result;
 }
@@ -597,7 +596,7 @@ static int vfswrap_chown(vfs_handle_struct *handle, const char *path, uid_t uid,
        int result;
 
        START_PROFILE(syscall_chown);
-       result = sys_chown(path, uid, gid);
+       result = chown(path, uid, gid);
        END_PROFILE(syscall_chown);
        return result;
 }
@@ -658,18 +657,22 @@ static int vfswrap_ntimes(vfs_handle_struct *handle, const char *path, const str
 
        START_PROFILE(syscall_ntimes);
 #if defined(HAVE_UTIMES)
-       {
+       if (ts != NULL) {
                struct timeval tv[2];
                tv[0] = convert_timespec_to_timeval(ts[0]);
                tv[1] = convert_timespec_to_timeval(ts[1]);
                result = utimes(path, tv);
+       } else {
+               result = utimes(path, NULL);
        }
 #elif defined(HAVE_UTIME)
-       {
+       if (ts != NULL) {
                struct utimbuf times;
                times.actime = convert_timespec_to_time_t(ts[0]);
                times.modtime = convert_timespec_to_time_t(ts[1]);
                result = utime(path, times);
+       } else {
+               result = utime(path, NULL);
        }
 #else
        errno = ENOSYS;
@@ -866,7 +869,7 @@ static int vfswrap_symlink(vfs_handle_struct *handle,  const char *oldpath, cons
        int result;
 
        START_PROFILE(syscall_symlink);
-       result = sys_symlink(oldpath, newpath);
+       result = symlink(oldpath, newpath);
        END_PROFILE(syscall_symlink);
        return result;
 }
@@ -876,7 +879,7 @@ static int vfswrap_readlink(vfs_handle_struct *handle,  const char *path, char *
        int result;
 
        START_PROFILE(syscall_readlink);
-       result = sys_readlink(path, buf, bufsiz);
+       result = readlink(path, buf, bufsiz);
        END_PROFILE(syscall_readlink);
        return result;
 }
@@ -886,7 +889,7 @@ static int vfswrap_link(vfs_handle_struct *handle,  const char *oldpath, const c
        int result;
 
        START_PROFILE(syscall_link);
-       result = sys_link(oldpath, newpath);
+       result = link(oldpath, newpath);
        END_PROFILE(syscall_link);
        return result;
 }
@@ -1033,7 +1036,7 @@ static NTSTATUS vfswrap_get_nt_acl(vfs_handle_struct *handle,
        return result;
 }
 
-static NTSTATUS vfswrap_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd)
+static NTSTATUS vfswrap_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32 security_info_sent, const SEC_DESC *psd)
 {
        NTSTATUS result;
 
@@ -1043,16 +1046,6 @@ static NTSTATUS vfswrap_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp
        return result;
 }
 
-static NTSTATUS vfswrap_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info_sent, SEC_DESC *psd)
-{
-       NTSTATUS result;
-
-       START_PROFILE(set_nt_acl);
-       result = set_nt_acl(fsp, security_info_sent, psd);
-       END_PROFILE(set_nt_acl);
-       return result;
-}
-
 static int vfswrap_chmod_acl(vfs_handle_struct *handle,  const char *name, mode_t mode)
 {
 #ifdef HAVE_NO_ACL
@@ -1447,8 +1440,6 @@ static vfs_op_tuple vfs_default_ops[] = {
         SMB_VFS_LAYER_OPAQUE},
        {SMB_VFS_OP(vfswrap_fset_nt_acl),       SMB_VFS_OP_FSET_NT_ACL,
         SMB_VFS_LAYER_OPAQUE},
-       {SMB_VFS_OP(vfswrap_set_nt_acl),        SMB_VFS_OP_SET_NT_ACL,
-        SMB_VFS_LAYER_OPAQUE},
 
        /* POSIX ACL operations. */