summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-11-01 04:02:47 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-11-01 04:02:47 +0100
commit31fa08dcbdc643ec738474c0be471e77925f76fc (patch)
treec4337b4bd77a31f4f593d8c94bbd15b796123117 /source3/lib
parent5a56c0adf2c63602b819d052644cb14caf732438 (diff)
parent7b186c48d365ae8eda81ae9a0af100d2214bee32 (diff)
downloadsamba-31fa08dcbdc643ec738474c0be471e77925f76fc.tar.gz
samba-31fa08dcbdc643ec738474c0be471e77925f76fc.tar.bz2
samba-31fa08dcbdc643ec738474c0be471e77925f76fc.zip
Merge branch 'master' of /home/jelmer/samba3
Conflicts: lib/replace/README lib/replace/libreplace.m4 lib/replace/replace.c source3/include/proto.h source3/lib/system.c
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/fault.c2
-rw-r--r--source3/lib/module.c16
-rw-r--r--source3/lib/secdesc.c6
-rw-r--r--source3/lib/sharesec.c1
-rw-r--r--source3/lib/system.c153
-rw-r--r--source3/lib/util_seaccess.c4
6 files changed, 14 insertions, 168 deletions
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);
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/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/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);
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 6d33a1c360..86c4ef2097 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -538,21 +538,6 @@ int sys_mknod(const char *path, mode_t mode, SMB_DEV_T dev)
}
/*******************************************************************
- 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
********************************************************************/
@@ -580,104 +565,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
-}
-
-/*******************************************************************
-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
-}
-
-/*******************************************************************
-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
-}
-
-/*******************************************************************
-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.
-********************************************************************/
-
-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
-********************************************************************/
-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)
/**************************************************************************
@@ -1304,46 +1191,6 @@ int sys_pclose(int fd)
}
/**************************************************************************
- 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
-}
-
-/**************************************************************************
Wrapper for Admin Logs.
****************************************************************************/
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;i<sd->dacl->num_aces; i++) {
struct security_ace *ace = &sd->dacl->aces[i];