summaryrefslogtreecommitdiff
path: root/examples/VFS/skel.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/VFS/skel.c')
-rw-r--r--examples/VFS/skel.c212
1 files changed, 138 insertions, 74 deletions
diff --git a/examples/VFS/skel.c b/examples/VFS/skel.c
index 90f16f952f..d1ec5b9180 100644
--- a/examples/VFS/skel.c
+++ b/examples/VFS/skel.c
@@ -35,36 +35,53 @@
#include <errno.h>
#include <string.h>
+#include <includes.h>
#include <vfs.h>
/* Function prototypes */
-int skel_connect(struct vfs_connection_struct *conn, char *svc, char *user);
-void skel_disconnect(void);
-SMB_BIG_UINT skel_disk_free(char *path, BOOL smallquery, SMB_BIG_UINT *bsize,
- SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
-
-DIR *skel_opendir(char *fname);
-struct dirent *skel_readdir(DIR *dirp);
-int skel_mkdir(char *path, mode_t mode);
-int skel_rmdir(char *path);
-int skel_closedir(DIR *dir);
-
-int skel_open(char *fname, int flags, mode_t mode);
-int skel_close(int fd);
-ssize_t skel_read(int fd, char *data, size_t n);
-ssize_t skel_write(int fd, char *data, size_t n);
-SMB_OFF_T skel_lseek(int filedes, SMB_OFF_T offset, int whence);
-int skel_rename(char *old, char *new);
-int skel_fsync(int fd);
-int skel_stat(char *fname, SMB_STRUCT_STAT *sbuf);
-int skel_fstat(int fd, SMB_STRUCT_STAT *sbuf);
-int skel_lstat(char *path, SMB_STRUCT_STAT *sbuf);
-int skel_unlink(char *path);
-int skel_chmod(char *path, mode_t mode);
-int skel_utime(char *path, struct utimbuf *times);
-int skel_ftruncate(int fd, SMB_OFF_T offset);
-BOOL skel_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type);
+ /* Disk operations */
+
+ int skel_connect(struct connection_struct *conn, char *service, char *user); void skel_disconnect(struct connection_struct *conn);
+ SMB_BIG_UINT skel_disk_free(struct connection_struct *conn, char *path, BOOL small_query, SMB_BIG_UINT *bsize,
+ SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
+
+ /* Directory operations */
+
+ DIR *skel_opendir(struct connection_struct *conn, char *fname);
+ struct dirent *skel_readdir(struct connection_struct *conn, DIR *dirp);
+ int skel_mkdir(struct connection_struct *conn, char *path, mode_t mode);
+ int skel_rmdir(struct connection_struct *conn, char *path);
+ int skel_closedir(struct connection_struct *conn, DIR *dir);
+
+ /* File operations */
+
+ int skel_open(struct connection_struct *conn, char *fname, int flags, mode_t mode);
+ int skel_close(struct files_struct *fsp, int fd);
+ ssize_t skel_read(struct files_struct *fsp, int fd, char *data, size_t n);
+ ssize_t skel_write(struct files_struct *fsp, int fd, char *data, size_t n);
+ SMB_OFF_T skel_lseek(struct files_struct *fsp, int filedes, SMB_OFF_T offset, int whence);
+ int skel_rename(struct connection_struct *conn, char *old, char *new);
+ int skel_fsync(struct files_struct *fsp, int fd);
+ int skel_stat(struct connection_struct *conn, char *fname, SMB_STRUCT_STAT *sbuf);
+ int skel_fstat(struct files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf);
+ int skel_lstat(struct connection_struct *conn, char *path, SMB_STRUCT_STAT *sbuf);
+ int skel_unlink(struct connection_struct *conn, char *path);
+ int skel_chmod(struct connection_struct *conn, char *path, mode_t mode);
+ int skel_chown(struct connection_struct *conn, char *path, uid_t uid, gid_t gid);
+ int skel_chdir(struct connection_struct *conn, char *path);
+ char *skel_getwd(struct connection_struct *conn, char *buf);
+ int skel_utime(struct connection_struct *conn, char *path, struct utimbuf *times);
+ int skel_ftruncate(struct files_struct *fsp, int fd, SMB_OFF_T offset);
+ BOOL skel_lock(struct files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type);
+
+ /* NT file access control list operations */
+
+ size_t skel_fget_nt_acl(struct files_struct *fsp, int fd, struct security_descriptor_info **ppdesc);
+ size_t skel_get_nt_acl(struct files_struct *fsp, char *name, struct security_descriptor_info **ppdesc);
+ BOOL skel_fset_nt_acl(struct files_struct *fsp, int fd, uint32 security_info_sent, struct security_descriptor_info *psd);
+ BOOL skel_set_nt_acl(struct files_struct *fsp, char *name, uint32 security_info_sent, struct security_descriptor_info *psd);
+
/* VFS operations structure */
@@ -98,9 +115,19 @@ struct vfs_ops skel_ops = {
skel_lstat,
skel_unlink,
skel_chmod,
+ skel_chown,
+ skel_chdir,
+ skel_getwd,
skel_utime,
skel_ftruncate,
- skel_lock
+ skel_lock,
+
+ /* NT File ACL operations */
+
+ skel_fget_nt_acl,
+ skel_get_nt_acl,
+ skel_fset_nt_acl,
+ skel_set_nt_acl
};
/* VFS initialisation - return vfs_ops function pointer structure */
@@ -114,119 +141,156 @@ struct vfs_ops *vfs_init(void)
extern struct vfs_ops default_vfs_ops; /* For passthrough operation */
-int skel_connect(struct vfs_connection_struct *conn, char *svc, char *user)
+int skel_connect(struct connection_struct *conn, char *service, char *user)
{
- return default_vfs_ops.connect(conn, svc, user);
+ return default_vfs_ops.connect(conn, service, user);
}
-void skel_disconnect(void)
+void skel_disconnect(struct connection_struct *conn)
{
- default_vfs_ops.disconnect();
+ default_vfs_ops.disconnect(conn);
}
-SMB_BIG_UINT skel_disk_free(char *path, BOOL small_query, SMB_BIG_UINT *bsize,
- SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+SMB_BIG_UINT skel_disk_free(struct connection_struct *conn, char *path,
+ BOOL small_query, SMB_BIG_UINT *bsize,
+ SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
{
- return default_vfs_ops.disk_free(path, small_query, bsize,
+ return default_vfs_ops.disk_free(conn, path, small_query, bsize,
dfree, dsize);
}
-DIR *skel_opendir(char *fname)
+DIR *skel_opendir(struct connection_struct *conn, char *fname)
{
- return default_vfs_ops.opendir(fname);
+ return default_vfs_ops.opendir(conn, fname);
}
-struct dirent *skel_readdir(DIR *dirp)
+struct dirent *skel_readdir(struct connection_struct *conn, DIR *dirp)
{
- return default_vfs_ops.readdir(dirp);
+ return default_vfs_ops.readdir(conn, dirp);
}
-int skel_mkdir(char *path, mode_t mode)
+int skel_mkdir(struct connection_struct *conn, char *path, mode_t mode)
{
- return default_vfs_ops.mkdir(path, mode);
+ return default_vfs_ops.mkdir(conn, path, mode);
}
-int skel_rmdir(char *path)
+int skel_rmdir(struct connection_struct *conn, char *path)
{
- return default_vfs_ops.rmdir(path);
+ return default_vfs_ops.rmdir(conn, path);
}
-int skel_closedir(DIR *dir)
+int skel_closedir(struct connection_struct *conn, DIR *dir)
{
- return default_vfs_ops.closedir(dir);
+ return default_vfs_ops.closedir(conn, dir);
}
-int skel_open(char *fname, int flags, mode_t mode)
+int skel_open(struct connection_struct *conn, char *fname, int flags, mode_t mode)
{
- return default_vfs_ops.open(fname, flags, mode);
+ return default_vfs_ops.open(conn, fname, flags, mode);
}
-int skel_close(int fd)
+int skel_close(struct files_struct *fsp, int fd)
{
- return default_vfs_ops.close(fd);
+ return default_vfs_ops.close(fsp, fd);
}
-ssize_t skel_read(int fd, char *data, size_t n)
+ssize_t skel_read(struct files_struct *fsp, int fd, char *data, size_t n)
{
- return default_vfs_ops.read(fd, data, n);
+ return default_vfs_ops.read(fsp, fd, data, n);
}
-ssize_t skel_write(int fd, char *data, size_t n)
+ssize_t skel_write(struct files_struct *fsp, int fd, char *data, size_t n)
{
- return default_vfs_ops.write(fd, data, n);
+ return default_vfs_ops.write(fsp, fd, data, n);
}
-SMB_OFF_T skel_lseek(int filedes, SMB_OFF_T offset, int whence)
+SMB_OFF_T skel_lseek(struct files_struct *fsp, int filedes, SMB_OFF_T offset, int whence)
{
- return default_vfs_ops.lseek(filedes, offset, whence);
+ return default_vfs_ops.lseek(fsp, filedes, offset, whence);
}
-int skel_rename(char *old, char *new)
+int skel_rename(struct connection_struct *conn, char *old, char *new)
{
- return default_vfs_ops.rename(old, new);
+ return default_vfs_ops.rename(conn, old, new);
}
-int skel_fsync(int fd)
+int skel_fsync(struct files_struct *fsp, int fd)
{
- return default_vfs_ops.fsync(fd);
+ return default_vfs_ops.fsync(fsp, fd);
}
-int skel_stat(char *fname, SMB_STRUCT_STAT *sbuf)
+int skel_stat(struct connection_struct *conn, char *fname, SMB_STRUCT_STAT *sbuf)
{
- return default_vfs_ops.stat(fname, sbuf);
+ return default_vfs_ops.stat(conn, fname, sbuf);
}
-int skel_fstat(int fd, SMB_STRUCT_STAT *sbuf)
+int skel_fstat(struct files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf)
{
- return default_vfs_ops.fstat(fd, sbuf);
+ return default_vfs_ops.fstat(fsp, fd, sbuf);
}
-int skel_lstat(char *path, SMB_STRUCT_STAT *sbuf)
+int skel_lstat(struct connection_struct *conn, char *path, SMB_STRUCT_STAT *sbuf)
{
- return default_vfs_ops.lstat(path, sbuf);
+ return default_vfs_ops.lstat(conn, path, sbuf);
}
-int skel_unlink(char *path)
+int skel_unlink(struct connection_struct *conn, char *path)
{
- return default_vfs_ops.unlink(path);
+ return default_vfs_ops.unlink(conn, path);
}
-int skel_chmod(char *path, mode_t mode)
+int skel_chmod(struct connection_struct *conn, char *path, mode_t mode)
{
- return default_vfs_ops.chmod(path, mode);
+ return default_vfs_ops.chmod(conn, path, mode);
}
-int skel_utime(char *path, struct utimbuf *times)
+int skel_chown(struct connection_struct *conn, char *path, uid_t uid, gid_t gid)
{
- return default_vfs_ops.utime(path, times);
+ return default_vfs_ops.chown(conn, path, uid, gid);
}
-int skel_ftruncate(int fd, SMB_OFF_T offset)
+int skel_chdir(struct connection_struct *conn, char *path)
{
- return default_vfs_ops.ftruncate(fd, offset);
+ return default_vfs_ops.chdir(conn, path);
}
-BOOL skel_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
+char *skel_getwd(struct connection_struct *conn, char *buf)
{
- return default_vfs_ops.lock(fd, op, offset, count, type);
+ return default_vfs_ops.getwd(conn, buf);
}
+
+int skel_utime(struct connection_struct *conn, char *path, struct utimbuf *times)
+{
+ return default_vfs_ops.utime(conn, path, times);
+}
+
+int skel_ftruncate(struct files_struct *fsp, int fd, SMB_OFF_T offset)
+{
+ return default_vfs_ops.ftruncate(fsp, fd, offset);
+}
+
+BOOL skel_lock(struct files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
+{
+ return default_vfs_ops.lock(fsp, fd, op, offset, count, type);
+}
+
+size_t skel_fget_nt_acl(struct files_struct *fsp, int fd, struct security_descriptor_info **ppdesc)
+{
+ return default_vfs_ops.fget_nt_acl(fsp, fd, ppdesc);
+}
+
+size_t skel_get_nt_acl(struct files_struct *fsp, char *name, struct security_descriptor_info **ppdesc)
+{
+ return default_vfs_ops.get_nt_acl(fsp, name, ppdesc);
+}
+
+BOOL skel_fset_nt_acl(struct files_struct *fsp, int fd, uint32 security_info_sent, struct security_descriptor_info *psd)
+{
+ return default_vfs_ops.fset_nt_acl(fsp, fd, security_info_sent, psd);
+}
+
+BOOL skel_set_nt_acl(struct files_struct *fsp, char *name, uint32 security_info_sent, struct security_descriptor_info *psd)
+{
+ return default_vfs_ops.set_nt_acl(fsp, name, security_info_sent, psd);
+}
+