From 72af9b01dc7ee00d79908760af6051f8794fa2b8 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 31 Oct 2008 17:25:44 -0700 Subject: Another unused variable. --- source3/lib/sharesec.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/lib') diff --git a/source3/lib/sharesec.c b/source3/lib/sharesec.c index b90346ff7e..8ea63a5824 100644 --- a/source3/lib/sharesec.c +++ b/source3/lib/sharesec.c @@ -279,7 +279,6 @@ bool share_access_check(const NT_USER_TOKEN *token, const char *sharename, NTSTATUS status; SEC_DESC *psd = NULL; size_t sd_size; - bool ret = True; psd = get_share_security(talloc_tos(), sharename, &sd_size); -- cgit From 54eaf2de74b4779919ae97b54abceb3878894bf6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 31 Oct 2008 18:04:53 -0700 Subject: Get closer to passing S4 RAW-ACLs. Jeremy. --- source3/lib/secdesc.c | 6 +++--- source3/lib/util_seaccess.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/secdesc.c b/source3/lib/secdesc.c index 1da2b3ec93..2987306066 100644 --- a/source3/lib/secdesc.c +++ b/source3/lib/secdesc.c @@ -529,7 +529,7 @@ NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx, /* First add the regular ACE entry. */ init_sec_ace(new_ace, ptrustee, ace->type, - ace->access_mask, SEC_ACE_FLAG_INHERITED_ACE); + ace->access_mask, 0); DEBUG(5,("se_create_child_secdesc(): %s:%d/0x%02x/0x%08x" " inherited as %s:%d/0x%02x/0x%08x\n", @@ -549,7 +549,7 @@ NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx, } init_sec_ace(new_ace, ptrustee, ace->type, - ace->access_mask, new_flags | SEC_ACE_FLAG_INHERITED_ACE); + ace->access_mask, new_flags); DEBUG(5, ("se_create_child_secdesc(): %s:%d/0x%02x/0x%08x " " inherited as %s:%d/0x%02x/0x%08x\n", @@ -565,7 +565,7 @@ NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx, /* Create child security descriptor to return */ new_dacl = make_sec_acl(ctx, - ACL_REVISION, + NT4_ACL_REVISION, new_ace_list_ndx, new_ace_list); diff --git a/source3/lib/util_seaccess.c b/source3/lib/util_seaccess.c index 17d4b78202..d7fdc9a8b9 100644 --- a/source3/lib/util_seaccess.c +++ b/source3/lib/util_seaccess.c @@ -110,7 +110,7 @@ static uint32_t access_check_max_allowed(const struct security_descriptor *sd, { uint32_t denied = 0, granted = 0; unsigned i; - + if (is_sid_in_token(token, sd->owner_sid)) { granted |= SEC_STD_WRITE_DAC | SEC_STD_READ_CONTROL | SEC_STD_DELETE; } else if (user_has_privileges(token, &se_restore)) { @@ -120,7 +120,7 @@ static uint32_t access_check_max_allowed(const struct security_descriptor *sd, if (sd->dacl == NULL) { return granted & ~denied; } - + for (i = 0;idacl->num_aces; i++) { struct security_ace *ace = &sd->dacl->aces[i]; -- cgit From 161d70a57ae8a17dcbc9c426bfff33c8c51318b7 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 1 Nov 2008 03:27:45 +0100 Subject: Move sys_chown() to rep_chown(). --- source3/lib/system.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/system.c b/source3/lib/system.c index eabb6d6dc4..7f5f572255 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -622,25 +622,6 @@ int sys_link(const char *oldpath, const char *newpath) #endif } -/******************************************************************* -chown isn't used much but OS/2 doesn't have it -********************************************************************/ - -int sys_chown(const char *fname,uid_t uid,gid_t gid) -{ -#ifndef HAVE_CHOWN - static int done; - if (!done) { - DEBUG(1,("WARNING: no chown!\n")); - done=1; - } - errno = ENOSYS; - return -1; -#else - return(chown(fname,uid,gid)); -#endif -} - /******************************************************************* Wrapper for lchown. ********************************************************************/ -- cgit From cdf8f5786387c4764fa790ab5def04dfff8b9af5 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 1 Nov 2008 03:29:06 +0100 Subject: Use 'regular' chown, libreplace will provide (dummy) replacement if necessary. --- source3/lib/fault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib') diff --git a/source3/lib/fault.c b/source3/lib/fault.c index d4c1142937..d038e57e1a 100644 --- a/source3/lib/fault.c +++ b/source3/lib/fault.c @@ -129,7 +129,7 @@ void dump_core_setup(const char *progname) } mkdir(corepath,0700); - sys_chown(corepath,getuid(),getgid()); + chown(corepath,getuid(),getgid()); chmod(corepath,0700); SAFE_FREE(logbase); -- cgit From bbbe6ab72284c78c095babd875070aaac8c477dd Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 1 Nov 2008 03:30:47 +0100 Subject: Move sys_link to libreplace. --- source3/lib/system.c | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/system.c b/source3/lib/system.c index 7f5f572255..cb3551c11e 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -608,20 +608,6 @@ int sys_readlink(const char *path, char *buf, size_t bufsiz) #endif } -/******************************************************************* -system wrapper for link -********************************************************************/ - -int sys_link(const char *oldpath, const char *newpath) -{ -#ifndef HAVE_LINK - errno = ENOSYS; - return -1; -#else - return link(oldpath, newpath); -#endif -} - /******************************************************************* Wrapper for lchown. ********************************************************************/ -- cgit From dbda9adfaf388f62cf359ea728ae303d81df81a9 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 1 Nov 2008 03:33:39 +0100 Subject: Move sys_readlink() to libreplace. --- source3/lib/system.c | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/system.c b/source3/lib/system.c index cb3551c11e..ac64954107 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -594,20 +594,6 @@ int sys_symlink(const char *oldpath, const char *newpath) #endif } -/******************************************************************* -system wrapper for readlink -********************************************************************/ - -int sys_readlink(const char *path, char *buf, size_t bufsiz) -{ -#ifndef HAVE_READLINK - errno = ENOSYS; - return -1; -#else - return readlink(path, buf, bufsiz); -#endif -} - /******************************************************************* Wrapper for lchown. ********************************************************************/ -- cgit From e8cda43e171c1aa8f4b858228e715290d400691c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 1 Nov 2008 03:35:58 +0100 Subject: Move sys_symlink() to libreplace. --- source3/lib/system.c | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/system.c b/source3/lib/system.c index ac64954107..e2ed11d450 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -580,20 +580,6 @@ char *sys_getwd(char *s) return wd; } -/******************************************************************* -system wrapper for symlink -********************************************************************/ - -int sys_symlink(const char *oldpath, const char *newpath) -{ -#ifndef HAVE_SYMLINK - errno = ENOSYS; - return -1; -#else - return symlink(oldpath, newpath); -#endif -} - /******************************************************************* Wrapper for lchown. ********************************************************************/ -- cgit From 38d67363aca81b970717c58b07e04396ae9dfd9f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 1 Nov 2008 03:39:20 +0100 Subject: Move sys_lchown() to libreplace. --- source3/lib/system.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/system.c b/source3/lib/system.c index e2ed11d450..27722fcab2 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -580,25 +580,6 @@ char *sys_getwd(char *s) return wd; } -/******************************************************************* - Wrapper for lchown. -********************************************************************/ - -int sys_lchown(const char *fname,uid_t uid,gid_t gid) -{ -#ifndef HAVE_LCHOWN - static int done; - if (!done) { - DEBUG(1,("WARNING: no lchown!\n")); - done=1; - } - errno = ENOSYS; - return -1; -#else - return(lchown(fname,uid,gid)); -#endif -} - /******************************************************************* os/2 also doesn't have chroot ********************************************************************/ -- cgit From a6d537bb6cec25eb27cf8884ca5e3362a86818b3 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 1 Nov 2008 03:42:27 +0100 Subject: Move sys_realpath() to libreplace. --- source3/lib/system.c | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/system.c b/source3/lib/system.c index 27722fcab2..da2797322a 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -537,21 +537,6 @@ int sys_mknod(const char *path, mode_t mode, SMB_DEV_T dev) #endif } -/******************************************************************* - Wrapper for realpath. -********************************************************************/ - -char *sys_realpath(const char *path, char *resolved_path) -{ -#if defined(HAVE_REALPATH) - return realpath(path, resolved_path); -#else - /* As realpath is not a system call we can't return ENOSYS. */ - errno = EINVAL; - return NULL; -#endif -} - /******************************************************************* The wait() calls vary between systems ********************************************************************/ -- cgit From 6a2caa34b24c2225dba9da011eaa5cc3eb8752be Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 1 Nov 2008 03:46:09 +0100 Subject: Remove sys_chroot() - libreplace already provides an alternative. --- source3/lib/system.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/system.c b/source3/lib/system.c index da2797322a..d23e7ae6db 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -565,24 +565,6 @@ char *sys_getwd(char *s) return wd; } -/******************************************************************* -os/2 also doesn't have chroot -********************************************************************/ -int sys_chroot(const char *dname) -{ -#ifndef HAVE_CHROOT - static int done; - if (!done) { - DEBUG(1,("WARNING: no chroot!\n")); - done=1; - } - errno = ENOSYS; - return -1; -#else - return(chroot(dname)); -#endif -} - #if defined(HAVE_POSIX_CAPABILITIES) /************************************************************************** -- cgit From 7b186c48d365ae8eda81ae9a0af100d2214bee32 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 1 Nov 2008 03:49:49 +0100 Subject: Remove sys_dl*() - stubs are already provided by libreplace. --- source3/lib/module.c | 16 ++++++++-------- source3/lib/system.c | 40 ---------------------------------------- 2 files changed, 8 insertions(+), 48 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/module.c b/source3/lib/module.c index 76983387ff..de13668009 100644 --- a/source3/lib/module.c +++ b/source3/lib/module.c @@ -37,11 +37,11 @@ static NTSTATUS do_smb_load_module(const char *module_name, bool is_probe) * backwards compatibility, there might be symbols in the * plugin referencing to old (removed) functions */ - handle = sys_dlopen(module_name, RTLD_LAZY); + handle = dlopen(module_name, RTLD_LAZY); /* This call should reset any possible non-fatal errors that occured since last call to dl* functions */ - error = sys_dlerror(); + error = dlerror(); if(!handle) { int level = is_probe ? 3 : 0; @@ -49,15 +49,15 @@ static NTSTATUS do_smb_load_module(const char *module_name, bool is_probe) return NT_STATUS_UNSUCCESSFUL; } - init = (init_module_function *)sys_dlsym(handle, "init_samba_module"); + init = (init_module_function *)dlsym(handle, "init_samba_module"); - /* we must check sys_dlerror() to determine if it worked, because - sys_dlsym() can validly return NULL */ - error = sys_dlerror(); + /* we must check dlerror() to determine if it worked, because + dlsym() can validly return NULL */ + error = dlerror(); if (error) { DEBUG(0, ("Error trying to resolve symbol 'init_samba_module' " "in %s: %s\n", module_name, error)); - sys_dlclose(handle); + dlclose(handle); return NT_STATUS_UNSUCCESSFUL; } @@ -67,7 +67,7 @@ static NTSTATUS do_smb_load_module(const char *module_name, bool is_probe) if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("Module '%s' initialization failed: %s\n", module_name, get_friendly_nt_error_msg(status))); - sys_dlclose(handle); + dlclose(handle); } return status; diff --git a/source3/lib/system.c b/source3/lib/system.c index d23e7ae6db..90dbdafa92 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -1190,46 +1190,6 @@ int sys_pclose(int fd) return wstatus; } -/************************************************************************** - Wrappers for dlopen, dlsym, dlclose. -****************************************************************************/ - -void *sys_dlopen(const char *name, int flags) -{ -#if defined(HAVE_DLOPEN) - return dlopen(name, flags); -#else - return NULL; -#endif -} - -void *sys_dlsym(void *handle, const char *symbol) -{ -#if defined(HAVE_DLSYM) - return dlsym(handle, symbol); -#else - return NULL; -#endif -} - -int sys_dlclose (void *handle) -{ -#if defined(HAVE_DLCLOSE) - return dlclose(handle); -#else - return 0; -#endif -} - -const char *sys_dlerror(void) -{ -#if defined(HAVE_DLERROR) - return dlerror(); -#else - return NULL; -#endif -} - int sys_dup2(int oldfd, int newfd) { #if defined(HAVE_DUP2) -- cgit