summaryrefslogtreecommitdiff
path: root/source4/ntvfs
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-04-08 03:45:06 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-04-08 03:45:06 +0200
commitb5d84a74d146cfe0d2e0c336a88bd269ad61cded (patch)
tree8acad6b634cfe312144f92f8a0fb6ab44b47cd19 /source4/ntvfs
parent237f1cca028881a57f961884f427673907c1535a (diff)
parent1f474f4a545752f7ac0ad402d01d1e768b973dbe (diff)
downloadsamba-b5d84a74d146cfe0d2e0c336a88bd269ad61cded.tar.gz
samba-b5d84a74d146cfe0d2e0c336a88bd269ad61cded.tar.bz2
samba-b5d84a74d146cfe0d2e0c336a88bd269ad61cded.zip
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-gmake3
Conflicts: source/auth/credentials/config.mk source/auth/gensec/config.mk source/build/smb_build/makefile.pm source/heimdal_build/config.mk source/lib/events/config.mk source/lib/nss_wrapper/config.mk source/lib/policy/config.mk source/lib/registry/config.mk source/lib/socket_wrapper/config.mk source/lib/tdb/config.mk source/lib/tls/config.mk source/lib/util/config.mk source/libcli/config.mk source/libcli/ldap/config.mk source/libnet/config.mk source/librpc/config.mk source/param/config.mk source/rpc_server/config.mk source/scripting/ejs/config.mk source/smbd/process_model.mk (This used to be commit 760378e0294dd0cd4523a83448328478632d7e3d)
Diffstat (limited to 'source4/ntvfs')
-rw-r--r--source4/ntvfs/cifs/vfs_cifs.c1
-rw-r--r--source4/ntvfs/common/init.c2
-rw-r--r--source4/ntvfs/common/opendb.c28
-rw-r--r--source4/ntvfs/config.mk2
-rw-r--r--source4/ntvfs/ntvfs_base.c8
-rw-r--r--source4/ntvfs/ntvfs_generic.c20
-rw-r--r--source4/ntvfs/ntvfs_interface.c138
-rw-r--r--source4/ntvfs/ntvfs_util.c20
-rw-r--r--source4/ntvfs/posix/pvfs_acl.c104
-rw-r--r--source4/ntvfs/posix/pvfs_acl_nfs4.c106
-rw-r--r--source4/ntvfs/posix/pvfs_xattr.c4
-rw-r--r--source4/ntvfs/posix/vfs_posix.c6
-rw-r--r--source4/ntvfs/posix/vfs_posix.h3
-rw-r--r--source4/ntvfs/unixuid/vfs_unixuid.c72
14 files changed, 330 insertions, 184 deletions
diff --git a/source4/ntvfs/cifs/vfs_cifs.c b/source4/ntvfs/cifs/vfs_cifs.c
index 3c090b5f5c..2feb1a0efe 100644
--- a/source4/ntvfs/cifs/vfs_cifs.c
+++ b/source4/ntvfs/cifs/vfs_cifs.c
@@ -26,6 +26,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "libcli/smb_composite/smb_composite.h"
#include "auth/auth.h"
#include "auth/credentials/credentials.h"
diff --git a/source4/ntvfs/common/init.c b/source4/ntvfs/common/init.c
index 1889bef23d..e0f5a9d2aa 100644
--- a/source4/ntvfs/common/init.c
+++ b/source4/ntvfs/common/init.c
@@ -26,7 +26,7 @@
#include "includes.h"
#include "ntvfs/sysdep/sys_notify.h"
-_PUBLIC_ NTSTATUS ntvfs_common_init(void)
+NTSTATUS ntvfs_common_init(void)
{
return sys_notify_init();
}
diff --git a/source4/ntvfs/common/opendb.c b/source4/ntvfs/common/opendb.c
index 676706e03f..2913ea8431 100644
--- a/source4/ntvfs/common/opendb.c
+++ b/source4/ntvfs/common/opendb.c
@@ -58,7 +58,7 @@ void odb_set_ops(const struct opendb_ops *new_ops)
talloc_free(). We need the messaging_ctx to allow for pending open
notifications.
*/
-_PUBLIC_ struct odb_context *odb_init(TALLOC_CTX *mem_ctx,
+struct odb_context *odb_init(TALLOC_CTX *mem_ctx,
struct ntvfs_context *ntvfs_ctx)
{
if (ops == NULL) {
@@ -75,13 +75,13 @@ _PUBLIC_ struct odb_context *odb_init(TALLOC_CTX *mem_ctx,
get a lock on a entry in the odb. This call returns a lock handle,
which the caller should unlock using talloc_free().
*/
-_PUBLIC_ struct odb_lock *odb_lock(TALLOC_CTX *mem_ctx,
+struct odb_lock *odb_lock(TALLOC_CTX *mem_ctx,
struct odb_context *odb, DATA_BLOB *file_key)
{
return ops->odb_lock(mem_ctx, odb, file_key);
}
-_PUBLIC_ DATA_BLOB odb_get_key(TALLOC_CTX *mem_ctx, struct odb_lock *lck)
+DATA_BLOB odb_get_key(TALLOC_CTX *mem_ctx, struct odb_lock *lck)
{
return ops->odb_get_key(mem_ctx, lck);
}
@@ -95,7 +95,7 @@ _PUBLIC_ DATA_BLOB odb_get_key(TALLOC_CTX *mem_ctx, struct odb_lock *lck)
Note that the path is only used by the delete on close logic, not
for comparing with other filenames
*/
-_PUBLIC_ NTSTATUS odb_open_file(struct odb_lock *lck,
+NTSTATUS odb_open_file(struct odb_lock *lck,
void *file_handle, const char *path,
int *fd, bool allow_level_II_oplock,
uint32_t oplock_level, uint32_t *oplock_granted)
@@ -109,7 +109,7 @@ _PUBLIC_ NTSTATUS odb_open_file(struct odb_lock *lck,
/*
register a pending open file in the open files database
*/
-_PUBLIC_ NTSTATUS odb_open_file_pending(struct odb_lock *lck, void *private)
+NTSTATUS odb_open_file_pending(struct odb_lock *lck, void *private)
{
return ops->odb_open_file_pending(lck, private);
}
@@ -118,7 +118,7 @@ _PUBLIC_ NTSTATUS odb_open_file_pending(struct odb_lock *lck, void *private)
/*
remove a opendb entry
*/
-_PUBLIC_ NTSTATUS odb_close_file(struct odb_lock *lck, void *file_handle,
+NTSTATUS odb_close_file(struct odb_lock *lck, void *file_handle,
const char **delete_path)
{
return ops->odb_close_file(lck, file_handle, delete_path);
@@ -128,7 +128,7 @@ _PUBLIC_ NTSTATUS odb_close_file(struct odb_lock *lck, void *file_handle,
/*
remove a pending opendb entry
*/
-_PUBLIC_ NTSTATUS odb_remove_pending(struct odb_lock *lck, void *private)
+NTSTATUS odb_remove_pending(struct odb_lock *lck, void *private)
{
return ops->odb_remove_pending(lck, private);
}
@@ -137,7 +137,7 @@ _PUBLIC_ NTSTATUS odb_remove_pending(struct odb_lock *lck, void *private)
/*
rename the path in a open file
*/
-_PUBLIC_ NTSTATUS odb_rename(struct odb_lock *lck, const char *path)
+NTSTATUS odb_rename(struct odb_lock *lck, const char *path)
{
return ops->odb_rename(lck, path);
}
@@ -145,7 +145,7 @@ _PUBLIC_ NTSTATUS odb_rename(struct odb_lock *lck, const char *path)
/*
get back the path of an open file
*/
-_PUBLIC_ NTSTATUS odb_get_path(struct odb_lock *lck, const char **path)
+NTSTATUS odb_get_path(struct odb_lock *lck, const char **path)
{
return ops->odb_get_path(lck, path);
}
@@ -153,7 +153,7 @@ _PUBLIC_ NTSTATUS odb_get_path(struct odb_lock *lck, const char **path)
/*
update delete on close flag on an open file
*/
-_PUBLIC_ NTSTATUS odb_set_delete_on_close(struct odb_lock *lck, bool del_on_close)
+NTSTATUS odb_set_delete_on_close(struct odb_lock *lck, bool del_on_close)
{
return ops->odb_set_delete_on_close(lck, del_on_close);
}
@@ -162,7 +162,7 @@ _PUBLIC_ NTSTATUS odb_set_delete_on_close(struct odb_lock *lck, bool del_on_clos
return the current value of the delete_on_close bit, and how many
people still have the file open
*/
-_PUBLIC_ NTSTATUS odb_get_delete_on_close(struct odb_context *odb,
+NTSTATUS odb_get_delete_on_close(struct odb_context *odb,
DATA_BLOB *key, bool *del_on_close)
{
return ops->odb_get_delete_on_close(odb, key, del_on_close);
@@ -173,7 +173,7 @@ _PUBLIC_ NTSTATUS odb_get_delete_on_close(struct odb_context *odb,
determine if a file can be opened with the given share_access,
create_options and access_mask
*/
-_PUBLIC_ NTSTATUS odb_can_open(struct odb_lock *lck,
+NTSTATUS odb_can_open(struct odb_lock *lck,
uint32_t stream_id, uint32_t share_access,
uint32_t access_mask, bool delete_on_close,
uint32_t open_disposition, bool break_to_none)
@@ -182,13 +182,13 @@ _PUBLIC_ NTSTATUS odb_can_open(struct odb_lock *lck,
delete_on_close, open_disposition, break_to_none);
}
-_PUBLIC_ NTSTATUS odb_update_oplock(struct odb_lock *lck, void *file_handle,
+NTSTATUS odb_update_oplock(struct odb_lock *lck, void *file_handle,
uint32_t oplock_level)
{
return ops->odb_update_oplock(lck, file_handle, oplock_level);
}
-_PUBLIC_ NTSTATUS odb_break_oplocks(struct odb_lock *lck)
+NTSTATUS odb_break_oplocks(struct odb_lock *lck)
{
return ops->odb_break_oplocks(lck);
}
diff --git a/source4/ntvfs/config.mk b/source4/ntvfs/config.mk
index 436fe11522..93cbf64d8f 100644
--- a/source4/ntvfs/config.mk
+++ b/source4/ntvfs/config.mk
@@ -79,7 +79,7 @@ PRIVATE_PROTO_HEADER = ntvfs_proto.h
ntvfs_OBJ_FILES = $(addprefix ntvfs/, ntvfs_base.o ntvfs_generic.o ntvfs_interface.o ntvfs_util.o)
-PUBLIC_HEADERS += ntvfs/ntvfs.h
+# PUBLIC_HEADERS += ntvfs/ntvfs.h
#
# End SUBSYSTEM NTVFS
################################################
diff --git a/source4/ntvfs/ntvfs_base.c b/source4/ntvfs/ntvfs_base.c
index 4cd6192c77..3706cd172c 100644
--- a/source4/ntvfs/ntvfs_base.c
+++ b/source4/ntvfs/ntvfs_base.c
@@ -43,7 +43,7 @@ static int num_backends;
The 'type' is used to specify whether this is for a disk, printer or IPC$ share
*/
-_PUBLIC_ NTSTATUS ntvfs_register(const struct ntvfs_ops *ops,
+NTSTATUS ntvfs_register(const struct ntvfs_ops *ops,
const struct ntvfs_critical_sizes *const sizes)
{
struct ntvfs_ops *new_ops;
@@ -84,7 +84,7 @@ _PUBLIC_ NTSTATUS ntvfs_register(const struct ntvfs_ops *ops,
/*
return the operations structure for a named backend of the specified type
*/
-_PUBLIC_ const struct ntvfs_ops *ntvfs_backend_byname(const char *name, enum ntvfs_type type)
+const struct ntvfs_ops *ntvfs_backend_byname(const char *name, enum ntvfs_type type)
{
int i;
@@ -107,12 +107,12 @@ _PUBLIC_ const struct ntvfs_ops *ntvfs_backend_byname(const char *name, enum ntv
static const NTVFS_CURRENT_CRITICAL_SIZES(critical_sizes);
-_PUBLIC_ const struct ntvfs_critical_sizes *ntvfs_interface_version(void)
+const struct ntvfs_critical_sizes *ntvfs_interface_version(void)
{
return &critical_sizes;
}
-_PUBLIC_ bool ntvfs_interface_differs(const struct ntvfs_critical_sizes *const iface)
+bool ntvfs_interface_differs(const struct ntvfs_critical_sizes *const iface)
{
/* The comparison would be easier with memcmp, but compiler-interset
* alignment padding is not guaranteed to be zeroed.
diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c
index 5092e732b4..e1a86c07c0 100644
--- a/source4/ntvfs/ntvfs_generic.c
+++ b/source4/ntvfs/ntvfs_generic.c
@@ -361,7 +361,7 @@ static NTSTATUS map_openx_open(uint16_t flags, uint16_t open_mode,
/*
NTVFS open generic to any mapper
*/
-_PUBLIC_ NTSTATUS ntvfs_map_open(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_map_open(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_open *io)
{
@@ -512,7 +512,7 @@ done:
/*
NTVFS fsinfo generic to any mapper
*/
-_PUBLIC_ NTSTATUS ntvfs_map_fsinfo(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_map_fsinfo(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_fsinfo *fs)
{
@@ -641,7 +641,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_fsinfo(struct ntvfs_module_context *ntvfs,
/*
NTVFS fileinfo generic to any mapper
*/
-_PUBLIC_ NTSTATUS ntvfs_map_fileinfo(TALLOC_CTX *mem_ctx,
+NTSTATUS ntvfs_map_fileinfo(TALLOC_CTX *mem_ctx,
union smb_fileinfo *info,
union smb_fileinfo *info2)
{
@@ -872,7 +872,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_fileinfo(TALLOC_CTX *mem_ctx,
/*
NTVFS fileinfo generic to any mapper
*/
-_PUBLIC_ NTSTATUS ntvfs_map_qfileinfo(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_map_qfileinfo(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_fileinfo *info)
{
@@ -905,7 +905,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_qfileinfo(struct ntvfs_module_context *ntvfs,
/*
NTVFS pathinfo generic to any mapper
*/
-_PUBLIC_ NTSTATUS ntvfs_map_qpathinfo(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_map_qpathinfo(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_fileinfo *info)
{
@@ -939,7 +939,7 @@ _PUBLIC_ NTSTATUS ntvfs_map_qpathinfo(struct ntvfs_module_context *ntvfs,
/*
NTVFS lock generic to any mapper
*/
-_PUBLIC_ NTSTATUS ntvfs_map_lock(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_map_lock(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_lock *lck)
{
@@ -1114,7 +1114,7 @@ static NTSTATUS ntvfs_map_write_finish(struct ntvfs_module_context *ntvfs,
/*
NTVFS write generic to any mapper
*/
-_PUBLIC_ NTSTATUS ntvfs_map_write(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_map_write(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_write *wr)
{
@@ -1226,7 +1226,7 @@ static NTSTATUS ntvfs_map_read_finish(struct ntvfs_module_context *ntvfs,
/*
NTVFS read* to readx mapper
*/
-_PUBLIC_ NTSTATUS ntvfs_map_read(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_map_read(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_read *rd)
{
@@ -1322,7 +1322,7 @@ done:
/*
NTVFS close generic to any mapper
*/
-_PUBLIC_ NTSTATUS ntvfs_map_close(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_map_close(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_close *cl)
{
@@ -1391,7 +1391,7 @@ static NTSTATUS ntvfs_map_notify_finish(struct ntvfs_module_context *ntvfs,
/*
NTVFS notify generic to any mapper
*/
-_PUBLIC_ NTSTATUS ntvfs_map_notify(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_map_notify(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_notify *nt)
{
diff --git a/source4/ntvfs/ntvfs_interface.c b/source4/ntvfs/ntvfs_interface.c
index 3bd2859388..c348558fca 100644
--- a/source4/ntvfs/ntvfs_interface.c
+++ b/source4/ntvfs/ntvfs_interface.c
@@ -22,7 +22,7 @@
#include "ntvfs/ntvfs.h"
/* connect/disconnect */
-_PUBLIC_ NTSTATUS ntvfs_connect(struct ntvfs_request *req, const char *sharename)
+NTSTATUS ntvfs_connect(struct ntvfs_request *req, const char *sharename)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->connect) {
@@ -31,7 +31,7 @@ _PUBLIC_ NTSTATUS ntvfs_connect(struct ntvfs_request *req, const char *sharename
return ntvfs->ops->connect(ntvfs, req, sharename);
}
-_PUBLIC_ NTSTATUS ntvfs_disconnect(struct ntvfs_context *ntvfs_ctx)
+NTSTATUS ntvfs_disconnect(struct ntvfs_context *ntvfs_ctx)
{
struct ntvfs_module_context *ntvfs;
if (ntvfs_ctx == NULL) {
@@ -46,7 +46,7 @@ _PUBLIC_ NTSTATUS ntvfs_disconnect(struct ntvfs_context *ntvfs_ctx)
/* async setup - called by a backend that wants to setup any state for
a async request */
-_PUBLIC_ NTSTATUS ntvfs_async_setup(struct ntvfs_request *req, void *private)
+NTSTATUS ntvfs_async_setup(struct ntvfs_request *req, void *private)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->async_setup) {
@@ -56,7 +56,7 @@ _PUBLIC_ NTSTATUS ntvfs_async_setup(struct ntvfs_request *req, void *private)
}
/* filesystem operations */
-_PUBLIC_ NTSTATUS ntvfs_fsinfo(struct ntvfs_request *req, union smb_fsinfo *fs)
+NTSTATUS ntvfs_fsinfo(struct ntvfs_request *req, union smb_fsinfo *fs)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->fsinfo) {
@@ -66,7 +66,7 @@ _PUBLIC_ NTSTATUS ntvfs_fsinfo(struct ntvfs_request *req, union smb_fsinfo *fs)
}
/* path operations */
-_PUBLIC_ NTSTATUS ntvfs_unlink(struct ntvfs_request *req, union smb_unlink *unl)
+NTSTATUS ntvfs_unlink(struct ntvfs_request *req, union smb_unlink *unl)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->unlink) {
@@ -75,7 +75,7 @@ _PUBLIC_ NTSTATUS ntvfs_unlink(struct ntvfs_request *req, union smb_unlink *unl)
return ntvfs->ops->unlink(ntvfs, req, unl);
}
-_PUBLIC_ NTSTATUS ntvfs_chkpath(struct ntvfs_request *req, union smb_chkpath *cp)
+NTSTATUS ntvfs_chkpath(struct ntvfs_request *req, union smb_chkpath *cp)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->chkpath) {
@@ -84,7 +84,7 @@ _PUBLIC_ NTSTATUS ntvfs_chkpath(struct ntvfs_request *req, union smb_chkpath *cp
return ntvfs->ops->chkpath(ntvfs, req, cp);
}
-_PUBLIC_ NTSTATUS ntvfs_qpathinfo(struct ntvfs_request *req, union smb_fileinfo *st)
+NTSTATUS ntvfs_qpathinfo(struct ntvfs_request *req, union smb_fileinfo *st)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->qpathinfo) {
@@ -93,7 +93,7 @@ _PUBLIC_ NTSTATUS ntvfs_qpathinfo(struct ntvfs_request *req, union smb_fileinfo
return ntvfs->ops->qpathinfo(ntvfs, req, st);
}
-_PUBLIC_ NTSTATUS ntvfs_setpathinfo(struct ntvfs_request *req, union smb_setfileinfo *st)
+NTSTATUS ntvfs_setpathinfo(struct ntvfs_request *req, union smb_setfileinfo *st)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->setpathinfo) {
@@ -102,7 +102,7 @@ _PUBLIC_ NTSTATUS ntvfs_setpathinfo(struct ntvfs_request *req, union smb_setfile
return ntvfs->ops->setpathinfo(ntvfs, req, st);
}
-_PUBLIC_ NTSTATUS ntvfs_open(struct ntvfs_request *req, union smb_open *oi)
+NTSTATUS ntvfs_open(struct ntvfs_request *req, union smb_open *oi)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->open) {
@@ -111,7 +111,7 @@ _PUBLIC_ NTSTATUS ntvfs_open(struct ntvfs_request *req, union smb_open *oi)
return ntvfs->ops->open(ntvfs, req, oi);
}
-_PUBLIC_ NTSTATUS ntvfs_mkdir(struct ntvfs_request *req, union smb_mkdir *md)
+NTSTATUS ntvfs_mkdir(struct ntvfs_request *req, union smb_mkdir *md)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->mkdir) {
@@ -120,7 +120,7 @@ _PUBLIC_ NTSTATUS ntvfs_mkdir(struct ntvfs_request *req, union smb_mkdir *md)
return ntvfs->ops->mkdir(ntvfs, req, md);
}
-_PUBLIC_ NTSTATUS ntvfs_rmdir(struct ntvfs_request *req, struct smb_rmdir *rd)
+NTSTATUS ntvfs_rmdir(struct ntvfs_request *req, struct smb_rmdir *rd)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->rmdir) {
@@ -129,7 +129,7 @@ _PUBLIC_ NTSTATUS ntvfs_rmdir(struct ntvfs_request *req, struct smb_rmdir *rd)
return ntvfs->ops->rmdir(ntvfs, req, rd);
}
-_PUBLIC_ NTSTATUS ntvfs_rename(struct ntvfs_request *req, union smb_rename *ren)
+NTSTATUS ntvfs_rename(struct ntvfs_request *req, union smb_rename *ren)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->rename) {
@@ -138,7 +138,7 @@ _PUBLIC_ NTSTATUS ntvfs_rename(struct ntvfs_request *req, union smb_rename *ren)
return ntvfs->ops->rename(ntvfs, req, ren);
}
-_PUBLIC_ NTSTATUS ntvfs_copy(struct ntvfs_request *req, struct smb_copy *cp)
+NTSTATUS ntvfs_copy(struct ntvfs_request *req, struct smb_copy *cp)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->copy) {
@@ -148,7 +148,7 @@ _PUBLIC_ NTSTATUS ntvfs_copy(struct ntvfs_request *req, struct smb_copy *cp)
}
/* directory search */
-_PUBLIC_ NTSTATUS ntvfs_search_first(struct ntvfs_request *req, union smb_search_first *io, void *private,
+NTSTATUS ntvfs_search_first(struct ntvfs_request *req, union smb_search_first *io, void *private,
bool ntvfs_callback(void *private, const union smb_search_data *file))
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
@@ -158,7 +158,7 @@ _PUBLIC_ NTSTATUS ntvfs_search_first(struct ntvfs_request *req, union smb_search
return ntvfs->ops->search_first(ntvfs, req, io, private, ntvfs_callback);
}
-_PUBLIC_ NTSTATUS ntvfs_search_next(struct ntvfs_request *req, union smb_search_next *io, void *private,
+NTSTATUS ntvfs_search_next(struct ntvfs_request *req, union smb_search_next *io, void *private,
bool ntvfs_callback(void *private, const union smb_search_data *file))
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
@@ -168,7 +168,7 @@ _PUBLIC_ NTSTATUS ntvfs_search_next(struct ntvfs_request *req, union smb_search_
return ntvfs->ops->search_next(ntvfs, req, io, private, ntvfs_callback);
}
-_PUBLIC_ NTSTATUS ntvfs_search_close(struct ntvfs_request *req, union smb_search_close *io)
+NTSTATUS ntvfs_search_close(struct ntvfs_request *req, union smb_search_close *io)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->search_close) {
@@ -178,7 +178,7 @@ _PUBLIC_ NTSTATUS ntvfs_search_close(struct ntvfs_request *req, union smb_search
}
/* operations on open files */
-_PUBLIC_ NTSTATUS ntvfs_ioctl(struct ntvfs_request *req, union smb_ioctl *io)
+NTSTATUS ntvfs_ioctl(struct ntvfs_request *req, union smb_ioctl *io)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->ioctl) {
@@ -187,7 +187,7 @@ _PUBLIC_ NTSTATUS ntvfs_ioctl(struct ntvfs_request *req, union smb_ioctl *io)
return ntvfs->ops->ioctl(ntvfs, req, io);
}
-_PUBLIC_ NTSTATUS ntvfs_read(struct ntvfs_request *req, union smb_read *io)
+NTSTATUS ntvfs_read(struct ntvfs_request *req, union smb_read *io)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->read) {
@@ -196,7 +196,7 @@ _PUBLIC_ NTSTATUS ntvfs_read(struct ntvfs_request *req, union smb_read *io)
return ntvfs->ops->read(ntvfs, req, io);
}
-_PUBLIC_ NTSTATUS ntvfs_write(struct ntvfs_request *req, union smb_write *io)
+NTSTATUS ntvfs_write(struct ntvfs_request *req, union smb_write *io)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->write) {
@@ -205,7 +205,7 @@ _PUBLIC_ NTSTATUS ntvfs_write(struct ntvfs_request *req, union smb_write *io)
return ntvfs->ops->write(ntvfs, req, io);
}
-_PUBLIC_ NTSTATUS ntvfs_seek(struct ntvfs_request *req, union smb_seek *io)
+NTSTATUS ntvfs_seek(struct ntvfs_request *req, union smb_seek *io)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->seek) {
@@ -214,7 +214,7 @@ _PUBLIC_ NTSTATUS ntvfs_seek(struct ntvfs_request *req, union smb_seek *io)
return ntvfs->ops->seek(ntvfs, req, io);
}
-_PUBLIC_ NTSTATUS ntvfs_flush(struct ntvfs_request *req,
+NTSTATUS ntvfs_flush(struct ntvfs_request *req,
union smb_flush *flush)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
@@ -224,7 +224,7 @@ _PUBLIC_ NTSTATUS ntvfs_flush(struct ntvfs_request *req,
return ntvfs->ops->flush(ntvfs, req, flush);
}
-_PUBLIC_ NTSTATUS ntvfs_lock(struct ntvfs_request *req, union smb_lock *lck)
+NTSTATUS ntvfs_lock(struct ntvfs_request *req, union smb_lock *lck)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->lock) {
@@ -233,7 +233,7 @@ _PUBLIC_ NTSTATUS ntvfs_lock(struct ntvfs_request *req, union smb_lock *lck)
return ntvfs->ops->lock(ntvfs, req, lck);
}
-_PUBLIC_ NTSTATUS ntvfs_qfileinfo(struct ntvfs_request *req, union smb_fileinfo *info)
+NTSTATUS ntvfs_qfileinfo(struct ntvfs_request *req, union smb_fileinfo *info)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->qfileinfo) {
@@ -242,7 +242,7 @@ _PUBLIC_ NTSTATUS ntvfs_qfileinfo(struct ntvfs_request *req, union smb_fileinfo
return ntvfs->ops->qfileinfo(ntvfs, req, info);
}
-_PUBLIC_ NTSTATUS ntvfs_setfileinfo(struct ntvfs_request *req, union smb_setfileinfo *info)
+NTSTATUS ntvfs_setfileinfo(struct ntvfs_request *req, union smb_setfileinfo *info)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->setfileinfo) {
@@ -251,7 +251,7 @@ _PUBLIC_ NTSTATUS ntvfs_setfileinfo(struct ntvfs_request *req, union smb_setfile
return ntvfs->ops->setfileinfo(ntvfs, req, info);
}
-_PUBLIC_ NTSTATUS ntvfs_close(struct ntvfs_request *req, union smb_close *io)
+NTSTATUS ntvfs_close(struct ntvfs_request *req, union smb_close *io)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->close) {
@@ -261,7 +261,7 @@ _PUBLIC_ NTSTATUS ntvfs_close(struct ntvfs_request *req, union smb_close *io)
}
/* trans interface - used by IPC backend for pipes and RAP calls */
-_PUBLIC_ NTSTATUS ntvfs_trans(struct ntvfs_request *req, struct smb_trans2 *trans)
+NTSTATUS ntvfs_trans(struct ntvfs_request *req, struct smb_trans2 *trans)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->trans) {
@@ -271,7 +271,7 @@ _PUBLIC_ NTSTATUS ntvfs_trans(struct ntvfs_request *req, struct smb_trans2 *tran
}
/* trans2 interface - only used by CIFS backend to prover complete passthru for testing */
-_PUBLIC_ NTSTATUS ntvfs_trans2(struct ntvfs_request *req, struct smb_trans2 *trans2)
+NTSTATUS ntvfs_trans2(struct ntvfs_request *req, struct smb_trans2 *trans2)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->trans2) {
@@ -281,7 +281,7 @@ _PUBLIC_ NTSTATUS ntvfs_trans2(struct ntvfs_request *req, struct smb_trans2 *tra
}
/* printing specific operations */
-_PUBLIC_ NTSTATUS ntvfs_lpq(struct ntvfs_request *req, union smb_lpq *lpq)
+NTSTATUS ntvfs_lpq(struct ntvfs_request *req, union smb_lpq *lpq)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->lpq) {
@@ -291,7 +291,7 @@ _PUBLIC_ NTSTATUS ntvfs_lpq(struct ntvfs_request *req, union smb_lpq *lpq)
}
/* logoff - called when a vuid is closed */
-_PUBLIC_ NTSTATUS ntvfs_logoff(struct ntvfs_request *req)
+NTSTATUS ntvfs_logoff(struct ntvfs_request *req)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->logoff) {
@@ -300,7 +300,7 @@ _PUBLIC_ NTSTATUS ntvfs_logoff(struct ntvfs_request *req)
return ntvfs->ops->logoff(ntvfs, req);
}
-_PUBLIC_ NTSTATUS ntvfs_exit(struct ntvfs_request *req)
+NTSTATUS ntvfs_exit(struct ntvfs_request *req)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->exit) {
@@ -312,7 +312,7 @@ _PUBLIC_ NTSTATUS ntvfs_exit(struct ntvfs_request *req)
/*
change notify request
*/
-_PUBLIC_ NTSTATUS ntvfs_notify(struct ntvfs_request *req, union smb_notify *info)
+NTSTATUS ntvfs_notify(struct ntvfs_request *req, union smb_notify *info)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->notify) {
@@ -324,7 +324,7 @@ _PUBLIC_ NTSTATUS ntvfs_notify(struct ntvfs_request *req, union smb_notify *info
/*
cancel an outstanding async request
*/
-_PUBLIC_ NTSTATUS ntvfs_cancel(struct ntvfs_request *req)
+NTSTATUS ntvfs_cancel(struct ntvfs_request *req)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->cancel) {
@@ -334,7 +334,7 @@ _PUBLIC_ NTSTATUS ntvfs_cancel(struct ntvfs_request *req)
}
/* initial setup */
-_PUBLIC_ NTSTATUS ntvfs_next_connect(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_connect(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, const char *sharename)
{
if (!ntvfs->next || !ntvfs->next->ops->connect) {
@@ -343,7 +343,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_connect(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->connect(ntvfs->next, req, sharename);
}
-_PUBLIC_ NTSTATUS ntvfs_next_disconnect(struct ntvfs_module_context *ntvfs)
+NTSTATUS ntvfs_next_disconnect(struct ntvfs_module_context *ntvfs)
{
if (!ntvfs->next || !ntvfs->next->ops->disconnect) {
return NT_STATUS_NOT_IMPLEMENTED;
@@ -352,7 +352,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_disconnect(struct ntvfs_module_context *ntvfs)
}
/* async_setup - called when setting up for a async request */
-_PUBLIC_ NTSTATUS ntvfs_next_async_setup(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_async_setup(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
void *private)
{
@@ -363,7 +363,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_async_setup(struct ntvfs_module_context *ntvfs,
}
/* filesystem operations */
-_PUBLIC_ NTSTATUS ntvfs_next_fsinfo(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_fsinfo(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_fsinfo *fs)
{
@@ -374,7 +374,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_fsinfo(struct ntvfs_module_context *ntvfs,
}
/* path operations */
-_PUBLIC_ NTSTATUS ntvfs_next_unlink(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_unlink(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_unlink *unl)
{
@@ -384,7 +384,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_unlink(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->unlink(ntvfs->next, req, unl);
}
-_PUBLIC_ NTSTATUS ntvfs_next_chkpath(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_chkpath(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_chkpath *cp)
{
@@ -394,7 +394,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_chkpath(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->chkpath(ntvfs->next, req, cp);
}
-_PUBLIC_ NTSTATUS ntvfs_next_qpathinfo(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_qpathinfo(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_fileinfo *st)
{
@@ -404,7 +404,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_qpathinfo(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->qpathinfo(ntvfs->next, req, st);
}
-_PUBLIC_ NTSTATUS ntvfs_next_setpathinfo(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_setpathinfo(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_setfileinfo *st)
{
@@ -414,7 +414,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_setpathinfo(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->setpathinfo(ntvfs->next, req, st);
}
-_PUBLIC_ NTSTATUS ntvfs_next_mkdir(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_mkdir(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_mkdir *md)
{
@@ -424,7 +424,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_mkdir(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->mkdir(ntvfs->next, req, md);
}
-_PUBLIC_ NTSTATUS ntvfs_next_rmdir(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_rmdir(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
struct smb_rmdir *rd)
{
@@ -434,7 +434,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_rmdir(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->rmdir(ntvfs->next, req, rd);
}
-_PUBLIC_ NTSTATUS ntvfs_next_rename(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_rename(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_rename *ren)
{
@@ -444,7 +444,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_rename(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->rename(ntvfs->next, req, ren);
}
-_PUBLIC_ NTSTATUS ntvfs_next_copy(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_copy(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
struct smb_copy *cp)
{
@@ -454,7 +454,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_copy(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->copy(ntvfs->next, req, cp);
}
-_PUBLIC_ NTSTATUS ntvfs_next_open(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_open(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_open *oi)
{
@@ -466,7 +466,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_open(struct ntvfs_module_context *ntvfs,
/* directory search */
-_PUBLIC_ NTSTATUS ntvfs_next_search_first(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_search_first(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_search_first *io, void *private,
bool (*callback)(void *private, const union smb_search_data *file))
@@ -477,7 +477,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_search_first(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->search_first(ntvfs->next, req, io, private, callback);
}
-_PUBLIC_ NTSTATUS ntvfs_next_search_next(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_search_next(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_search_next *io, void *private,
bool (*callback)(void *private, const union smb_search_data *file))
@@ -488,7 +488,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_search_next(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->search_next(ntvfs->next, req, io, private, callback);
}
-_PUBLIC_ NTSTATUS ntvfs_next_search_close(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_search_close(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_search_close *io)
{
@@ -499,7 +499,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_search_close(struct ntvfs_module_context *ntvfs,
}
/* operations on open files */
-_PUBLIC_ NTSTATUS ntvfs_next_ioctl(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_ioctl(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_ioctl *io)
{
@@ -509,7 +509,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_ioctl(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->ioctl(ntvfs->next, req, io);
}
-_PUBLIC_ NTSTATUS ntvfs_next_read(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_read(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_read *io)
{
@@ -519,7 +519,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_read(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->read(ntvfs->next, req, io);
}
-_PUBLIC_ NTSTATUS ntvfs_next_write(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_write(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_write *io)
{
@@ -529,7 +529,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_write(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->write(ntvfs->next, req, io);
}
-_PUBLIC_ NTSTATUS ntvfs_next_seek(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_seek(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_seek *io)
{
@@ -539,7 +539,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_seek(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->seek(ntvfs->next, req, io);
}
-_PUBLIC_ NTSTATUS ntvfs_next_flush(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_flush(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_flush *flush)
{
@@ -549,7 +549,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_flush(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->flush(ntvfs->next, req, flush);
}
-_PUBLIC_ NTSTATUS ntvfs_next_lock(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_lock(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_lock *lck)
{
@@ -559,7 +559,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_lock(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->lock(ntvfs->next, req, lck);
}
-_PUBLIC_ NTSTATUS ntvfs_next_qfileinfo(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_qfileinfo(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_fileinfo *info)
{
@@ -569,7 +569,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_qfileinfo(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->qfileinfo(ntvfs->next, req, info);
}
-_PUBLIC_ NTSTATUS ntvfs_next_setfileinfo(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_setfileinfo(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_setfileinfo *info)
{
@@ -579,7 +579,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_setfileinfo(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->setfileinfo(ntvfs->next, req, info);
}
-_PUBLIC_ NTSTATUS ntvfs_next_close(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_close(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_close *io)
{
@@ -590,7 +590,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_close(struct ntvfs_module_context *ntvfs,
}
/* trans interface - used by IPC backend for pipes and RAP calls */
-_PUBLIC_ NTSTATUS ntvfs_next_trans(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_trans(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
struct smb_trans2 *trans)
{
@@ -601,7 +601,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_trans(struct ntvfs_module_context *ntvfs,
}
/* trans2 interface - only used by CIFS backend to prover complete passthru for testing */
-_PUBLIC_ NTSTATUS ntvfs_next_trans2(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_trans2(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
struct smb_trans2 *trans2)
{
@@ -614,7 +614,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_trans2(struct ntvfs_module_context *ntvfs,
/*
change notify request
*/
-_PUBLIC_ NTSTATUS ntvfs_next_notify(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_notify(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_notify *info)
{
@@ -625,7 +625,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_notify(struct ntvfs_module_context *ntvfs,
}
/* cancel - called to cancel an outstanding async request */
-_PUBLIC_ NTSTATUS ntvfs_next_cancel(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_cancel(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req)
{
if (!ntvfs->next || !ntvfs->next->ops->cancel) {
@@ -635,7 +635,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_cancel(struct ntvfs_module_context *ntvfs,
}
/* printing specific operations */
-_PUBLIC_ NTSTATUS ntvfs_next_lpq(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_lpq(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
union smb_lpq *lpq)
{
@@ -647,7 +647,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_lpq(struct ntvfs_module_context *ntvfs,
/* logoff - called when a vuid is closed */
-_PUBLIC_ NTSTATUS ntvfs_next_logoff(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_logoff(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req)
{
if (!ntvfs->next || !ntvfs->next->ops->logoff) {
@@ -656,7 +656,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_logoff(struct ntvfs_module_context *ntvfs,
return ntvfs->next->ops->logoff(ntvfs->next, req);
}
-_PUBLIC_ NTSTATUS ntvfs_next_exit(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_next_exit(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req)
{
if (!ntvfs->next || !ntvfs->next->ops->exit) {
@@ -666,7 +666,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_exit(struct ntvfs_module_context *ntvfs,
}
/* oplock helpers */
-_PUBLIC_ NTSTATUS ntvfs_set_oplock_handler(struct ntvfs_context *ntvfs,
+NTSTATUS ntvfs_set_oplock_handler(struct ntvfs_context *ntvfs,
NTSTATUS (*handler)(void *private_data, struct ntvfs_handle *handle, uint8_t level),
void *private_data)
{
@@ -675,7 +675,7 @@ _PUBLIC_ NTSTATUS ntvfs_set_oplock_handler(struct ntvfs_context *ntvfs,
return NT_STATUS_OK;
}
-_PUBLIC_ NTSTATUS ntvfs_send_oplock_break(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_send_oplock_break(struct ntvfs_module_context *ntvfs,
struct ntvfs_handle *handle, uint8_t level)
{
if (!ntvfs->ctx->oplock.handler) {
@@ -686,7 +686,7 @@ _PUBLIC_ NTSTATUS ntvfs_send_oplock_break(struct ntvfs_module_context *ntvfs,
}
/* client connection callback */
-_PUBLIC_ NTSTATUS ntvfs_set_addr_callbacks(struct ntvfs_context *ntvfs,
+NTSTATUS ntvfs_set_addr_callbacks(struct ntvfs_context *ntvfs,
struct socket_address *(*my_addr)(void *private_data, TALLOC_CTX *mem_ctx),
struct socket_address *(*peer_addr)(void *private_data, TALLOC_CTX *mem_ctx),
void *private_data)
@@ -697,7 +697,7 @@ _PUBLIC_ NTSTATUS ntvfs_set_addr_callbacks(struct ntvfs_context *ntvfs,
return NT_STATUS_OK;
}
-_PUBLIC_ struct socket_address *ntvfs_get_my_addr(struct ntvfs_module_context *ntvfs, TALLOC_CTX *mem_ctx)
+struct socket_address *ntvfs_get_my_addr(struct ntvfs_module_context *ntvfs, TALLOC_CTX *mem_ctx)
{
if (!ntvfs->ctx->client.get_my_addr) {
return NULL;
@@ -706,7 +706,7 @@ _PUBLIC_ struct socket_address *ntvfs_get_my_addr(struct ntvfs_module_context *n
return ntvfs->ctx->client.get_my_addr(ntvfs->ctx->client.private_data, mem_ctx);
}
-_PUBLIC_ struct socket_address *ntvfs_get_peer_addr(struct ntvfs_module_context *ntvfs, TALLOC_CTX *mem_ctx)
+struct socket_address *ntvfs_get_peer_addr(struct ntvfs_module_context *ntvfs, TALLOC_CTX *mem_ctx)
{
if (!ntvfs->ctx->client.get_peer_addr) {
return NULL;
diff --git a/source4/ntvfs/ntvfs_util.c b/source4/ntvfs/ntvfs_util.c
index ebe8008edd..fadbe2b80a 100644
--- a/source4/ntvfs/ntvfs_util.c
+++ b/source4/ntvfs/ntvfs_util.c
@@ -25,7 +25,7 @@
#include "ntvfs/ntvfs.h"
-_PUBLIC_ struct ntvfs_request *ntvfs_request_create(struct ntvfs_context *ctx, TALLOC_CTX *mem_ctx,
+struct ntvfs_request *ntvfs_request_create(struct ntvfs_context *ctx, TALLOC_CTX *mem_ctx,
struct auth_session_info *session_info,
uint16_t smbpid,
struct timeval request_time,
@@ -62,7 +62,7 @@ failed:
return NULL;
}
-_PUBLIC_ NTSTATUS ntvfs_async_state_push(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_async_state_push(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
void *private_data,
void (*send_fn)(struct ntvfs_request *))
@@ -84,7 +84,7 @@ _PUBLIC_ NTSTATUS ntvfs_async_state_push(struct ntvfs_module_context *ntvfs,
return NT_STATUS_OK;
}
-_PUBLIC_ void ntvfs_async_state_pop(struct ntvfs_request *req)
+void ntvfs_async_state_pop(struct ntvfs_request *req)
{
struct ntvfs_async_state *async;
@@ -98,7 +98,7 @@ _PUBLIC_ void ntvfs_async_state_pop(struct ntvfs_request *req)
talloc_free(async);
}
-_PUBLIC_ NTSTATUS ntvfs_handle_new(struct ntvfs_module_context *ntvfs,
+NTSTATUS ntvfs_handle_new(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
struct ntvfs_handle **h)
{
@@ -108,7 +108,7 @@ _PUBLIC_ NTSTATUS ntvfs_handle_new(struct ntvfs_module_context *ntvfs,
return ntvfs->ctx->handles.create_new(ntvfs->ctx->handles.private_data, req, h);
}
-_PUBLIC_ NTSTATUS ntvfs_handle_set_backend_data(struct ntvfs_handle *h,
+NTSTATUS ntvfs_handle_set_backend_data(struct ntvfs_handle *h,
struct ntvfs_module_context *ntvfs,
TALLOC_CTX *private_data)
{
@@ -137,7 +137,7 @@ _PUBLIC_ NTSTATUS ntvfs_handle_set_backend_data(struct ntvfs_handle *h,
return NT_STATUS_OK;
}
-_PUBLIC_ void *ntvfs_handle_get_backend_data(struct ntvfs_handle *h,
+void *ntvfs_handle_get_backend_data(struct ntvfs_handle *h,
struct ntvfs_module_context *ntvfs)
{
struct ntvfs_handle_data *d;
@@ -150,7 +150,7 @@ _PUBLIC_ void *ntvfs_handle_get_backend_data(struct ntvfs_handle *h,
return NULL;
}
-_PUBLIC_ void ntvfs_handle_remove_backend_data(struct ntvfs_handle *h,
+void ntvfs_handle_remove_backend_data(struct ntvfs_handle *h,
struct ntvfs_module_context *ntvfs)
{
struct ntvfs_handle_data *d,*n;
@@ -169,7 +169,7 @@ _PUBLIC_ void ntvfs_handle_remove_backend_data(struct ntvfs_handle *h,
h->ctx->handles.destroy(h->ctx->handles.private_data, h);
}
-_PUBLIC_ struct ntvfs_handle *ntvfs_handle_search_by_wire_key(struct ntvfs_module_context *ntvfs,
+struct ntvfs_handle *ntvfs_handle_search_by_wire_key(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
const DATA_BLOB *key)
{
@@ -179,12 +179,12 @@ _PUBLIC_ struct ntvfs_handle *ntvfs_handle_search_by_wire_key(struct ntvfs_modul
return ntvfs->ctx->handles.search_by_wire_key(ntvfs->ctx->handles.private_data, req, key);
}
-_PUBLIC_ DATA_BLOB ntvfs_handle_get_wire_key(struct ntvfs_handle *h, TALLOC_CTX *mem_ctx)
+DATA_BLOB ntvfs_handle_get_wire_key(struct ntvfs_handle *h, TALLOC_CTX *mem_ctx)
{
return h->ctx->handles.get_wire_key(h->ctx->handles.private_data, h, mem_ctx);
}
-_PUBLIC_ NTSTATUS ntvfs_set_handle_callbacks(struct ntvfs_context *ntvfs,
+NTSTATUS ntvfs_set_handle_callbacks(struct ntvfs_context *ntvfs,
NTSTATUS (*create_new)(void *private_data, struct ntvfs_request *req, struct ntvfs_handle **h),
NTSTATUS (*make_valid)(void *private_data, struct ntvfs_handle *h),
void (*destroy)(void *private_data, struct ntvfs_handle *h),
diff --git a/source4/ntvfs/posix/pvfs_acl.c b/source4/ntvfs/posix/pvfs_acl.c
index f19dc1f41f..2393a2e7a3 100644
--- a/source4/ntvfs/posix/pvfs_acl.c
+++ b/source4/ntvfs/posix/pvfs_acl.c
@@ -38,7 +38,7 @@ static int num_backends;
The 'name' can be later used by other backends to find the operations
structure for this backend.
*/
-_PUBLIC_ NTSTATUS pvfs_acl_register(const struct pvfs_acl_ops *ops)
+NTSTATUS pvfs_acl_register(const struct pvfs_acl_ops *ops)
{
struct pvfs_acl_ops *new_ops;
@@ -66,7 +66,7 @@ _PUBLIC_ NTSTATUS pvfs_acl_register(const struct pvfs_acl_ops *ops)
/*
return the operations structure for a named backend
*/
-_PUBLIC_ const struct pvfs_acl_ops *pvfs_acl_backend_byname(const char *name)
+const struct pvfs_acl_ops *pvfs_acl_backend_byname(const char *name)
{
int i;
@@ -126,6 +126,8 @@ static NTSTATUS pvfs_default_acl(struct pvfs_state *pvfs,
NTSTATUS status;
struct security_ace ace;
mode_t mode;
+ struct id_mapping *ids;
+ struct composite_context *ctx;
*psd = security_descriptor_initialise(req);
if (*psd == NULL) {
@@ -133,15 +135,33 @@ static NTSTATUS pvfs_default_acl(struct pvfs_state *pvfs,
}
sd = *psd;
- status = sidmap_uid_to_sid(pvfs->sidmap, sd, name->st.st_uid, &sd->owner_sid);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
- status = sidmap_gid_to_sid(pvfs->sidmap, sd, name->st.st_gid, &sd->group_sid);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
+ ids = talloc_array(sd, struct id_mapping, 2);
+ NT_STATUS_HAVE_NO_MEMORY(ids);
+
+ ids[0].unixid = talloc(ids, struct unixid);
+ NT_STATUS_HAVE_NO_MEMORY(ids[0].unixid);
+
+ ids[0].unixid->id = name->st.st_uid;
+ ids[0].unixid->type = ID_TYPE_UID;
+ ids[0].sid = NULL;
+ ids[1].unixid = talloc(ids, struct unixid);
+ NT_STATUS_HAVE_NO_MEMORY(ids[1].unixid);
+
+ ids[1].unixid->id = name->st.st_gid;
+ ids[1].unixid->type = ID_TYPE_GID;
+ ids[1].sid = NULL;
+
+ ctx = wbc_xids_to_sids_send(pvfs->wbc_ctx, ids, 2, ids);
+ NT_STATUS_HAVE_NO_MEMORY(ctx);
+
+ status = wbc_xids_to_sids_recv(ctx, &ids);
+ NT_STATUS_NOT_OK_RETURN(status);
+
+ sd->owner_sid = talloc_steal(sd, ids[0].sid);
+ sd->group_sid = talloc_steal(sd, ids[1].sid);
+
+ talloc_free(ids);
sd->type |= SEC_DESC_DACL_PRESENT;
mode = name->st.st_mode;
@@ -248,6 +268,8 @@ NTSTATUS pvfs_acl_set(struct pvfs_state *pvfs,
gid_t old_gid = -1;
uid_t new_uid = -1;
gid_t new_gid = -1;
+ struct id_mapping *ids;
+ struct composite_context *ctx;
if (pvfs->acl_ops != NULL) {
status = pvfs->acl_ops->acl_load(pvfs, name, fd, req, &sd);
@@ -259,6 +281,12 @@ NTSTATUS pvfs_acl_set(struct pvfs_state *pvfs,
return status;
}
+ ids = talloc(req, struct id_mapping);
+ NT_STATUS_HAVE_NO_MEMORY(ids);
+ ids->unixid = NULL;
+ ids->sid = NULL;
+ ids->status = NT_STATUS_NONE_MAPPED;
+
new_sd = info->set_secdesc.in.sd;
orig_sd = *sd;
@@ -271,8 +299,16 @@ NTSTATUS pvfs_acl_set(struct pvfs_state *pvfs,
return NT_STATUS_ACCESS_DENIED;
}
if (!dom_sid_equal(sd->owner_sid, new_sd->owner_sid)) {
- status = sidmap_sid_to_unixuid(pvfs->sidmap, new_sd->owner_sid, &new_uid);
+ ids->sid = new_sd->owner_sid;
+ ctx = wbc_sids_to_xids_send(pvfs->wbc_ctx, ids, 1, ids);
+ NT_STATUS_HAVE_NO_MEMORY(ctx);
+ status = wbc_sids_to_xids_recv(ctx, &ids);
NT_STATUS_NOT_OK_RETURN(status);
+
+ if (ids->unixid->type == ID_TYPE_BOTH ||
+ ids->unixid->type == ID_TYPE_UID) {
+ new_uid = ids->unixid->id;
+ }
}
sd->owner_sid = new_sd->owner_sid;
}
@@ -281,8 +317,17 @@ NTSTATUS pvfs_acl_set(struct pvfs_state *pvfs,
return NT_STATUS_ACCESS_DENIED;
}
if (!dom_sid_equal(sd->group_sid, new_sd->group_sid)) {
- status = sidmap_sid_to_unixgid(pvfs->sidmap, new_sd->group_sid, &new_gid);
+ ids->sid = new_sd->group_sid;
+ ctx = wbc_sids_to_xids_send(pvfs->wbc_ctx, ids, 1, ids);
+ NT_STATUS_HAVE_NO_MEMORY(ctx);
+ status = wbc_sids_to_xids_recv(ctx, &ids);
NT_STATUS_NOT_OK_RETURN(status);
+
+ if (ids->unixid->type == ID_TYPE_BOTH ||
+ ids->unixid->type == ID_TYPE_GID) {
+ new_gid = ids->unixid->id;
+ }
+
}
sd->group_sid = new_sd->group_sid;
}
@@ -664,6 +709,8 @@ NTSTATUS pvfs_acl_inherit(struct pvfs_state *pvfs,
struct pvfs_filename *parent;
struct security_descriptor *parent_sd, *sd;
bool container;
+ struct id_mapping *ids;
+ struct composite_context *ctx;
/* form the parents path */
status = pvfs_resolve_parent(pvfs, req, name, &parent);
@@ -705,14 +752,31 @@ NTSTATUS pvfs_acl_inherit(struct pvfs_state *pvfs,
return NT_STATUS_NO_MEMORY;
}
- status = sidmap_uid_to_sid(pvfs->sidmap, sd, name->st.st_uid, &sd->owner_sid);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
- status = sidmap_gid_to_sid(pvfs->sidmap, sd, name->st.st_gid, &sd->group_sid);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
+ ids = talloc_array(sd, struct id_mapping, 2);
+ NT_STATUS_HAVE_NO_MEMORY(ids);
+
+ ids[0].unixid = talloc(ids, struct unixid);
+ NT_STATUS_HAVE_NO_MEMORY(ids[0].unixid);
+ ids[0].unixid->id = name->st.st_uid;
+ ids[0].unixid->type = ID_TYPE_UID;
+ ids[0].sid = NULL;
+ ids[0].status = NT_STATUS_NONE_MAPPED;
+
+ ids[1].unixid = talloc(ids, struct unixid);
+ NT_STATUS_HAVE_NO_MEMORY(ids[1].unixid);
+ ids[1].unixid->id = name->st.st_gid;
+ ids[1].unixid->type = ID_TYPE_GID;
+ ids[1].sid = NULL;
+ ids[1].status = NT_STATUS_NONE_MAPPED;
+
+ ctx = wbc_xids_to_sids_send(pvfs->wbc_ctx, ids, 2, ids);
+ NT_STATUS_HAVE_NO_MEMORY(ctx);
+
+ status = wbc_xids_to_sids_recv(ctx, &ids);
+ NT_STATUS_NOT_OK_RETURN(status);
+
+ sd->owner_sid = talloc_steal(sd, ids[0].sid);
+ sd->group_sid = talloc_steal(sd, ids[1].sid);
sd->type |= SEC_DESC_DACL_PRESENT;
diff --git a/source4/ntvfs/posix/pvfs_acl_nfs4.c b/source4/ntvfs/posix/pvfs_acl_nfs4.c
index 2abb1482a4..fa855555b2 100644
--- a/source4/ntvfs/posix/pvfs_acl_nfs4.c
+++ b/source4/ntvfs/posix/pvfs_acl_nfs4.c
@@ -38,7 +38,9 @@ static NTSTATUS pvfs_acl_load_nfs4(struct pvfs_state *pvfs, struct pvfs_filename
NTSTATUS status;
struct nfs4acl *acl;
struct security_descriptor *sd;
- int i;
+ int i, num_ids;
+ struct id_mapping *ids;
+ struct composite_context *ctx;
acl = talloc_zero(mem_ctx, struct nfs4acl);
NT_STATUS_HAVE_NO_MEMORY(acl);
@@ -57,25 +59,57 @@ static NTSTATUS pvfs_acl_load_nfs4(struct pvfs_state *pvfs, struct pvfs_filename
sd = *psd;
sd->type |= acl->a_flags;
- status = sidmap_uid_to_sid(pvfs->sidmap, sd, name->st.st_uid, &sd->owner_sid);
- NT_STATUS_NOT_OK_RETURN(status);
- status = sidmap_gid_to_sid(pvfs->sidmap, sd, name->st.st_gid, &sd->group_sid);
+
+ /* the number of ids to map is the acl count plus uid and gid */
+ num_ids = acl->a_count +2;
+ ids = talloc_array(sd, struct id_mapping, num_ids);
+ NT_STATUS_HAVE_NO_MEMORY(ids);
+
+ ids[0].unixid = talloc(ids, struct unixid);
+ NT_STATUS_HAVE_NO_MEMORY(ids[0].unixid);
+ ids[0].unixid->id = name->st.st_uid;
+ ids[0].unixid->type = ID_TYPE_UID;
+ ids[0].sid = NULL;
+ ids[0].status = NT_STATUS_NONE_MAPPED;
+
+ ids[1].unixid = talloc(ids, struct unixid);
+ NT_STATUS_HAVE_NO_MEMORY(ids[1].unixid);
+ ids[1].unixid->id = name->st.st_gid;
+ ids[1].unixid->type = ID_TYPE_GID;
+ ids[1].sid = NULL;
+ ids[1].status = NT_STATUS_NONE_MAPPED;
+
+ for (i=0;i<acl->a_count;i++) {
+ struct nfs4ace *a = &acl->ace[i];
+ ids[i+2].unixid = talloc(ids, struct unixid);
+ NT_STATUS_HAVE_NO_MEMORY(ids[i+2].unixid);
+ ids[i+2].unixid->id = a->e_id;
+ if (a->e_flags & ACE4_IDENTIFIER_GROUP) {
+ ids[i+2].unixid->type = ID_TYPE_GID;
+ } else {
+ ids[i+2].unixid->type = ID_TYPE_UID;
+ }
+ ids[i+2].sid = NULL;
+ ids[i+2].status = NT_STATUS_NONE_MAPPED;
+ }
+
+ /* Allocate memory for the sids from the security descriptor to be on
+ * the safe side. */
+ ctx = wbc_xids_to_sids_send(pvfs->wbc_ctx, sd, num_ids, ids);
+ NT_STATUS_HAVE_NO_MEMORY(ctx);
+ status = wbc_xids_to_sids_recv(ctx, &ids);
NT_STATUS_NOT_OK_RETURN(status);
+ sd->owner_sid = talloc_steal(sd, ids[0].sid);
+ sd->group_sid = talloc_steal(sd, ids[1].sid);
+
for (i=0;i<acl->a_count;i++) {
struct nfs4ace *a = &acl->ace[i];
struct security_ace ace;
- struct dom_sid *sid;
ace.type = a->e_type;
ace.flags = a->e_flags;
ace.access_mask = a->e_mask;
- if (a->e_flags & ACE4_IDENTIFIER_GROUP) {
- status = sidmap_gid_to_sid(pvfs->sidmap, sd, a->e_id, &sid);
- } else {
- status = sidmap_uid_to_sid(pvfs->sidmap, sd, a->e_id, &sid);
- }
- NT_STATUS_NOT_OK_RETURN(status);
- ace.trustee = *sid;
+ ace.trustee = *ids[i+2].sid;
security_descriptor_dacl_add(sd, &ace);
}
@@ -93,6 +127,8 @@ static NTSTATUS pvfs_acl_save_nfs4(struct pvfs_state *pvfs, struct pvfs_filename
struct nfs4acl acl;
int i;
TALLOC_CTX *tmp_ctx;
+ struct id_mapping *ids;
+ struct composite_context *ctx;
tmp_ctx = talloc_new(pvfs);
NT_STATUS_HAVE_NO_MEMORY(tmp_ctx);
@@ -110,30 +146,44 @@ static NTSTATUS pvfs_acl_save_nfs4(struct pvfs_state *pvfs, struct pvfs_filename
return NT_STATUS_NO_MEMORY;
}
+ ids = talloc_array(tmp_ctx, struct id_mapping, acl.a_count);
+ if (ids == NULL) {
+ talloc_free(tmp_ctx);
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ for (i=0;i<acl.a_count;i++) {
+ struct security_ace *ace = &sd->dacl->aces[i];
+ ids[i].unixid = NULL;
+ ids[i].sid = dom_sid_dup(ids, &ace->trustee);
+ if (ids[i].sid == NULL) {
+ talloc_free(tmp_ctx);
+ return NT_STATUS_NO_MEMORY;
+ }
+ ids[i].status = NT_STATUS_NONE_MAPPED;
+ }
+
+ ctx = wbc_sids_to_xids_send(pvfs->wbc_ctx,ids, acl.a_count, ids);
+ if (ctx == NULL) {
+ talloc_free(tmp_ctx);
+ return NT_STATUS_NO_MEMORY;
+ }
+ status = wbc_sids_to_xids_recv(ctx, &ids);
+ if (!NT_STATUS_IS_OK(status)) {
+ talloc_free(tmp_ctx);
+ return status;
+ }
+
for (i=0;i<acl.a_count;i++) {
struct nfs4ace *a = &acl.ace[i];
struct security_ace *ace = &sd->dacl->aces[i];
a->e_type = ace->type;
a->e_flags = ace->flags;
a->e_mask = ace->access_mask;
- if (sidmap_sid_is_group(pvfs->sidmap, &ace->trustee)) {
- gid_t gid;
+ if (ids[i].unixid->type != ID_TYPE_UID) {
a->e_flags |= ACE4_IDENTIFIER_GROUP;
- status = sidmap_sid_to_unixgid(pvfs->sidmap, &ace->trustee, &gid);
- if (!NT_STATUS_IS_OK(status)) {
- talloc_free(tmp_ctx);
- return status;
- }
- a->e_id = gid;
- } else {
- uid_t uid;
- status = sidmap_sid_to_unixuid(pvfs->sidmap, &ace->trustee, &uid);
- if (!NT_STATUS_IS_OK(status)) {
- talloc_free(tmp_ctx);
- return status;
- }
- a->e_id = uid;
}
+ a->e_id = ids[i].unixid->id;
a->e_who = "";
}
diff --git a/source4/ntvfs/posix/pvfs_xattr.c b/source4/ntvfs/posix/pvfs_xattr.c
index b66d252a45..3043b80538 100644
--- a/source4/ntvfs/posix/pvfs_xattr.c
+++ b/source4/ntvfs/posix/pvfs_xattr.c
@@ -101,7 +101,7 @@ NTSTATUS pvfs_xattr_unlink_hook(struct pvfs_state *pvfs, const char *fname)
/*
load a NDR structure from a xattr
*/
-_PUBLIC_ NTSTATUS pvfs_xattr_ndr_load(struct pvfs_state *pvfs,
+NTSTATUS pvfs_xattr_ndr_load(struct pvfs_state *pvfs,
TALLOC_CTX *mem_ctx,
const char *fname, int fd, const char *attr_name,
void *p, void *pull_fn)
@@ -131,7 +131,7 @@ _PUBLIC_ NTSTATUS pvfs_xattr_ndr_load(struct pvfs_state *pvfs,
/*
save a NDR structure into a xattr
*/
-_PUBLIC_ NTSTATUS pvfs_xattr_ndr_save(struct pvfs_state *pvfs,
+NTSTATUS pvfs_xattr_ndr_save(struct pvfs_state *pvfs,
const char *fname, int fd, const char *attr_name,
void *p, void *push_fn)
{
diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c
index ca874d1db1..ebc2d88e70 100644
--- a/source4/ntvfs/posix/vfs_posix.c
+++ b/source4/ntvfs/posix/vfs_posix.c
@@ -222,8 +222,10 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs,
event_context_find(pvfs),
pvfs->ntvfs->ctx->config);
- pvfs->sidmap = sidmap_open(pvfs, pvfs->ntvfs->ctx->lp_ctx);
- if (pvfs->sidmap == NULL) {
+ pvfs->wbc_ctx = wbc_init(pvfs,
+ pvfs->ntvfs->ctx->msg_ctx,
+ pvfs->ntvfs->ctx->event_ctx);
+ if (pvfs->wbc_ctx == NULL) {
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
diff --git a/source4/ntvfs/posix/vfs_posix.h b/source4/ntvfs/posix/vfs_posix.h
index 4d22a91714..441424142f 100644
--- a/source4/ntvfs/posix/vfs_posix.h
+++ b/source4/ntvfs/posix/vfs_posix.h
@@ -26,6 +26,7 @@
#include "system/filesys.h"
#include "ntvfs/ntvfs.h"
#include "ntvfs/common/ntvfs_common.h"
+#include "libcli/wbclient/wbclient.h"
#include "dsdb/samdb/samdb.h"
struct pvfs_wait;
@@ -46,7 +47,7 @@ struct pvfs_state {
struct brl_context *brl_context;
struct odb_context *odb_context;
struct notify_context *notify_context;
- struct sidmap_context *sidmap;
+ struct wbc_context *wbc_ctx;
/* a list of pending async requests. Needed to support
ntcancel */
diff --git a/source4/ntvfs/unixuid/vfs_unixuid.c b/source4/ntvfs/unixuid/vfs_unixuid.c
index 63889c6677..66c2cfaf4c 100644
--- a/source4/ntvfs/unixuid/vfs_unixuid.c
+++ b/source4/ntvfs/unixuid/vfs_unixuid.c
@@ -25,11 +25,11 @@
#include "system/passwd.h"
#include "auth/auth.h"
#include "ntvfs/ntvfs.h"
-#include "dsdb/samdb/samdb.h"
+#include "libcli/wbclient/wbclient.h"
#include "param/param.h"
struct unixuid_private {
- struct sidmap_context *sidmap;
+ struct wbc_context *wbc_ctx;
struct unix_sec_ctx *last_sec_ctx;
struct security_token *last_token;
};
@@ -100,9 +100,11 @@ static NTSTATUS nt_token_to_unix_security(struct ntvfs_module_context *ntvfs,
struct security_token *token,
struct unix_sec_ctx **sec)
{
- struct unixuid_private *private = ntvfs->private_data;
+ struct unixuid_private *priv = ntvfs->private_data;
int i;
NTSTATUS status;
+ struct id_mapping *ids;
+ struct composite_context *ctx;
*sec = talloc(req, struct unix_sec_ctx);
/* we can't do unix security without a user and group */
@@ -110,29 +112,53 @@ static NTSTATUS nt_token_to_unix_security(struct ntvfs_module_context *ntvfs,
return NT_STATUS_ACCESS_DENIED;
}
- status = sidmap_sid_to_unixuid(private->sidmap,
- token->user_sid, &(*sec)->uid);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
+ ids = talloc_array(req, struct id_mapping, token->num_sids);
+ NT_STATUS_HAVE_NO_MEMORY(ids);
- status = sidmap_sid_to_unixgid(private->sidmap,
- token->group_sid, &(*sec)->gid);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
+ ids[0].unixid = NULL;
+ ids[0].sid = token->user_sid;
+ ids[0].status = NT_STATUS_NONE_MAPPED;
+
+ ids[1].unixid = NULL;
+ ids[1].sid = token->group_sid;
+ ids[1].status = NT_STATUS_NONE_MAPPED;
(*sec)->ngroups = token->num_sids - 2;
(*sec)->groups = talloc_array(*sec, gid_t, (*sec)->ngroups);
- if ((*sec)->groups == NULL) {
- return NT_STATUS_NO_MEMORY;
+ NT_STATUS_HAVE_NO_MEMORY((*sec)->groups);
+
+ for (i=0;i<(*sec)->ngroups;i++) {
+ ids[i+2].unixid = NULL;
+ ids[i+2].sid = token->sids[i+2];
+ ids[i+2].status = NT_STATUS_NONE_MAPPED;
+ }
+
+ ctx = wbc_sids_to_xids_send(priv->wbc_ctx, ids, token->num_sids, ids);
+ NT_STATUS_HAVE_NO_MEMORY(ctx);
+
+ status = wbc_sids_to_xids_recv(ctx, &ids);
+ NT_STATUS_NOT_OK_RETURN(status);
+
+ if (ids[0].unixid->type == ID_TYPE_BOTH ||
+ ids[0].unixid->type == ID_TYPE_UID) {
+ (*sec)->uid = ids[0].unixid->id;
+ } else {
+ return NT_STATUS_INVALID_SID;
+ }
+
+ if (ids[1].unixid->type == ID_TYPE_BOTH ||
+ ids[1].unixid->type == ID_TYPE_GID) {
+ (*sec)->gid = ids[1].unixid->id;
+ } else {
+ return NT_STATUS_INVALID_SID;
}
for (i=0;i<(*sec)->ngroups;i++) {
- status = sidmap_sid_to_unixgid(private->sidmap,
- token->sids[i+2], &(*sec)->groups[i]);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
+ if (ids[i+2].unixid->type == ID_TYPE_BOTH ||
+ ids[i+2].unixid->type == ID_TYPE_GID) {
+ (*sec)->groups[i] = ids[i+2].unixid->id;
+ } else {
+ return NT_STATUS_INVALID_SID;
}
}
@@ -216,9 +242,11 @@ static NTSTATUS unixuid_connect(struct ntvfs_module_context *ntvfs,
return NT_STATUS_NO_MEMORY;
}
- private->sidmap = sidmap_open(private, ntvfs->ctx->lp_ctx);
- if (private->sidmap == NULL) {
- return NT_STATUS_INTERNAL_DB_CORRUPTION;
+ private->wbc_ctx = wbc_init(private, ntvfs->ctx->msg_ctx,
+ ntvfs->ctx->event_ctx);
+ if (private->wbc_ctx == NULL) {
+ talloc_free(private);
+ return NT_STATUS_INTERNAL_ERROR;
}
ntvfs->private_data = private;