summaryrefslogtreecommitdiff
path: root/source3/smbd/vfs-wrap.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-03-19 02:32:39 +0000
committerJeremy Allison <jra@samba.org>2002-03-19 02:32:39 +0000
commitffadd471b9664018b3010ab5d74e6d05b8886e66 (patch)
treeeaf1c0c83d1f11f2eb6f68d1201f745722f33dfe /source3/smbd/vfs-wrap.c
parentcdc9931bb2f53272159b04ef7b1b057ce837ed4b (diff)
downloadsamba-ffadd471b9664018b3010ab5d74e6d05b8886e66.tar.gz
samba-ffadd471b9664018b3010ab5d74e6d05b8886e66.tar.bz2
samba-ffadd471b9664018b3010ab5d74e6d05b8886e66.zip
Sync up vfs changes from 2.2.x.
Jeremy. (This used to be commit ad1e858d8e72adf924ff435eab8da3e60842e2e6)
Diffstat (limited to 'source3/smbd/vfs-wrap.c')
-rw-r--r--source3/smbd/vfs-wrap.c166
1 files changed, 10 insertions, 156 deletions
diff --git a/source3/smbd/vfs-wrap.c b/source3/smbd/vfs-wrap.c
index 73b070d3f8..1d94e18e5b 100644
--- a/source3/smbd/vfs-wrap.c
+++ b/source3/smbd/vfs-wrap.c
@@ -22,8 +22,6 @@
/* Check for NULL pointer parameters in vfswrap_* functions */
-#define VFS_CHECK_NULL
-
/* We don't want to have NULL function pointers lying around. Someone
is sure to try and execute them. These stubs are used to prevent
this possibility. */
@@ -44,14 +42,6 @@ SMB_BIG_UINT vfswrap_disk_free(connection_struct *conn, const char *path, BOOL s
{
SMB_BIG_UINT result;
-#ifdef VFS_CHECK_NULL
- if ((path == NULL) || (bsize == NULL) || (dfree == NULL) ||
- (dsize == NULL)) {
-
- smb_panic("NULL pointer passed to vfswrap_disk_free() function\n");
- }
-#endif
-
result = sys_disk_free(path, small_query, bsize, dfree, dsize);
return result;
}
@@ -63,13 +53,6 @@ DIR *vfswrap_opendir(connection_struct *conn, const char *fname)
DIR *result;
START_PROFILE(syscall_opendir);
-
-#ifdef VFS_CHECK_NULL
- if (fname == NULL) {
- smb_panic("NULL pointer passed to vfswrap_opendir()\n");
- }
-#endif
-
result = opendir(fname);
END_PROFILE(syscall_opendir);
return result;
@@ -80,13 +63,6 @@ struct dirent *vfswrap_readdir(connection_struct *conn, DIR *dirp)
struct dirent *result;
START_PROFILE(syscall_readdir);
-
-#ifdef VFS_CHECK_NULL
- if (dirp == NULL) {
- smb_panic("NULL pointer passed to vfswrap_readdir()\n");
- }
-#endif
-
result = readdir(dirp);
END_PROFILE(syscall_readdir);
return result;
@@ -99,12 +75,6 @@ int vfswrap_mkdir(connection_struct *conn, const char *path, mode_t mode)
START_PROFILE(syscall_mkdir);
-#ifdef VFS_CHECK_NULL
- if (path == NULL) {
- smb_panic("NULL pointer passed to vfswrap_mkdir()\n");
- }
-#endif
-
if (lp_inherit_acls(SNUM(conn)) && (has_dacl = directory_has_default_acl(conn, parent_dirname(path))))
mode = 0777;
@@ -134,13 +104,6 @@ int vfswrap_rmdir(connection_struct *conn, const char *path)
int result;
START_PROFILE(syscall_rmdir);
-
-#ifdef VFS_CHECK_NULL
- if (path == NULL) {
- smb_panic("NULL pointer passed to vfswrap_rmdir()\n");
- }
-#endif
-
result = rmdir(path);
END_PROFILE(syscall_rmdir);
return result;
@@ -151,13 +114,6 @@ int vfswrap_closedir(connection_struct *conn, DIR *dirp)
int result;
START_PROFILE(syscall_closedir);
-
-#ifdef VFS_CHECK_NULL
- if (dirp == NULL) {
- smb_panic("NULL pointer passed to vfswrap_closedir()\n");
- }
-#endif
-
result = closedir(dirp);
END_PROFILE(syscall_closedir);
return result;
@@ -170,13 +126,6 @@ int vfswrap_open(connection_struct *conn, const char *fname, int flags, mode_t m
int result;
START_PROFILE(syscall_open);
-
-#ifdef VFS_CHECK_NULL
- if (fname == NULL) {
- smb_panic("NULL pointer passed to vfswrap_open()\n");
- }
-#endif
-
result = sys_open(fname, flags, mode);
END_PROFILE(syscall_open);
return result;
@@ -198,13 +147,6 @@ ssize_t vfswrap_read(files_struct *fsp, int fd, void *data, size_t n)
ssize_t result;
START_PROFILE_BYTES(syscall_read, n);
-
-#ifdef VFS_CHECK_NULL
- if (data == NULL) {
- smb_panic("NULL pointer passed to vfswrap_read()\n");
- }
-#endif
-
result = read(fd, data, n);
END_PROFILE(syscall_read);
return result;
@@ -215,13 +157,6 @@ ssize_t vfswrap_write(files_struct *fsp, int fd, const void *data, size_t n)
ssize_t result;
START_PROFILE_BYTES(syscall_write, n);
-
-#ifdef VFS_CHECK_NULL
- if (data == NULL) {
- smb_panic("NULL pointer passed to vfswrap_write()\n");
- }
-#endif
-
result = write(fd, data, n);
END_PROFILE(syscall_write);
return result;
@@ -256,13 +191,6 @@ int vfswrap_rename(connection_struct *conn, const char *old, const char *new)
int result;
START_PROFILE(syscall_rename);
-
-#ifdef VFS_CHECK_NULL
- if ((old == NULL) || (new == NULL)) {
- smb_panic("NULL pointer passed to vfswrap_rename()\n");
- }
-#endif
-
result = rename(old, new);
END_PROFILE(syscall_rename);
return result;
@@ -288,13 +216,6 @@ int vfswrap_stat(connection_struct *conn, const char *fname, SMB_STRUCT_STAT *sb
int result;
START_PROFILE(syscall_stat);
-
-#ifdef VFS_CHECK_NULL
- if ((fname == NULL) || (sbuf == NULL)) {
- smb_panic("NULL pointer passed to vfswrap_stat()\n");
- }
-#endif
-
result = sys_stat(fname, sbuf);
END_PROFILE(syscall_stat);
return result;
@@ -305,13 +226,6 @@ int vfswrap_fstat(files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf)
int result;
START_PROFILE(syscall_fstat);
-
-#ifdef VFS_CHECK_NULL
- if (sbuf == NULL) {
- smb_panic("NULL pointer passed to vfswrap_fstat()\n");
- }
-#endif
-
result = sys_fstat(fd, sbuf);
END_PROFILE(syscall_fstat);
return result;
@@ -322,13 +236,6 @@ int vfswrap_lstat(connection_struct *conn, const char *path, SMB_STRUCT_STAT *sb
int result;
START_PROFILE(syscall_lstat);
-
-#ifdef VFS_CHECK_NULL
- if ((path == NULL) || (sbuf == NULL)) {
- smb_panic("NULL pointer passed to vfswrap_lstat()\n");
- }
-#endif
-
result = sys_lstat(path, sbuf);
END_PROFILE(syscall_lstat);
return result;
@@ -339,13 +246,6 @@ int vfswrap_unlink(connection_struct *conn, const char *path)
int result;
START_PROFILE(syscall_unlink);
-
-#ifdef VFS_CHECK_NULL
- if (path == NULL) {
- smb_panic("NULL pointer passed to vfswrap_unlink()\n");
- }
-#endif
-
result = unlink(path);
END_PROFILE(syscall_unlink);
return result;
@@ -357,12 +257,6 @@ int vfswrap_chmod(connection_struct *conn, const char *path, mode_t mode)
START_PROFILE(syscall_chmod);
-#ifdef VFS_CHECK_NULL
- if (path == NULL) {
- smb_panic("NULL pointer passed to vfswrap_chmod()\n");
- }
-#endif
-
/*
* We need to do this due to the fact that the default POSIX ACL
* chmod modifies the ACL *mask* for the group owner, not the
@@ -418,13 +312,6 @@ int vfswrap_chown(connection_struct *conn, const char *path, uid_t uid, gid_t gi
int result;
START_PROFILE(syscall_chown);
-
-#ifdef VFS_CHECK_NULL
- if (path == NULL) {
- smb_panic("NULL pointer passed to vfswrap_chown()\n");
- }
-#endif
-
result = sys_chown(path, uid, gid);
END_PROFILE(syscall_chown);
return result;
@@ -446,13 +333,6 @@ int vfswrap_chdir(connection_struct *conn, const char *path)
int result;
START_PROFILE(syscall_chdir);
-
-#ifdef VFS_CHECK_NULL
- if (path == NULL) {
- smb_panic("NULL pointer passed to vfswrap_chdir()\n");
- }
-#endif
-
result = chdir(path);
END_PROFILE(syscall_chdir);
return result;
@@ -463,13 +343,6 @@ char *vfswrap_getwd(connection_struct *conn, char *path)
char *result;
START_PROFILE(syscall_getwd);
-
-#ifdef VFS_CHECK_NULL
- if (path == NULL) {
- smb_panic("NULL pointer passed to vfswrap_getwd()\n");
- }
-#endif
-
result = sys_getwd(path);
END_PROFILE(syscall_getwd);
return result;
@@ -480,13 +353,6 @@ int vfswrap_utime(connection_struct *conn, const char *path, struct utimbuf *tim
int result;
START_PROFILE(syscall_utime);
-
-#ifdef VFS_CHECK_NULL
- if ((path == NULL) || (times == NULL)) {
- smb_panic("NULL pointer passed to vfswrap_utime()\n");
- }
-#endif
-
result = utime(path, times);
END_PROFILE(syscall_utime);
return result;
@@ -642,12 +508,6 @@ int vfswrap_symlink(connection_struct *conn, const char *oldpath, const char *ne
int result;
START_PROFILE(syscall_symlink);
-
-#ifdef VFS_CHECK_NULL
- if ((oldpath == NULL) || (newpath == NULL))
- smb_panic("NULL pointer passed to vfswrap_symlink()\n");
-#endif
-
result = sys_symlink(oldpath, newpath);
END_PROFILE(syscall_symlink);
return result;
@@ -658,12 +518,6 @@ int vfswrap_readlink(connection_struct *conn, const char *path, char *buf, size_
int result;
START_PROFILE(syscall_readlink);
-
-#ifdef VFS_CHECK_NULL
- if ((path == NULL) || (buf == NULL))
- smb_panic("NULL pointer passed to vfswrap_readlink()\n");
-#endif
-
result = sys_readlink(path, buf, bufsiz);
END_PROFILE(syscall_readlink);
return result;
@@ -674,11 +528,6 @@ int vfswrap_link(connection_struct *conn, const char *oldpath, const char *newpa
int result;
START_PROFILE(syscall_link);
-
-#ifdef VFS_CHECK_NULL
- if ((oldpath == NULL) || (newpath == NULL))
- smb_panic("NULL pointer passed to vfswrap_link()\n");
-#endif
result = sys_link(oldpath, newpath);
END_PROFILE(syscall_link);
return result;
@@ -689,16 +538,21 @@ int vfswrap_mknod(connection_struct *conn, const char *pathname, mode_t mode, SM
int result;
START_PROFILE(syscall_mknod);
-
-#ifdef VFS_CHECK_NULL
- if (pathname == NULL)
- smb_panic("NULL pointer passed to vfswrap_mknod()\n");
-#endif
result = sys_mknod(pathname, mode, dev);
END_PROFILE(syscall_mknod);
return result;
}
+char *vfswrap_realpath(connection_struct *conn, const char *path, char *resolved_path)
+{
+ char *result;
+
+ START_PROFILE(syscall_realpath);
+ result = sys_realpath(path, resolved_path);
+ END_PROFILE(syscall_realpath);
+ return result;
+}
+
size_t vfswrap_fget_nt_acl(files_struct *fsp, int fd, SEC_DESC **ppdesc)
{
size_t result;