diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-11-01 03:27:45 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-11-01 03:27:45 +0100 |
commit | 161d70a57ae8a17dcbc9c426bfff33c8c51318b7 (patch) | |
tree | 2f98456ae87db079c1348784e43ed2024f5580e9 /lib/replace | |
parent | dfc78b1dc2738264791e631c599d75e832aebde2 (diff) | |
download | samba-161d70a57ae8a17dcbc9c426bfff33c8c51318b7.tar.gz samba-161d70a57ae8a17dcbc9c426bfff33c8c51318b7.tar.bz2 samba-161d70a57ae8a17dcbc9c426bfff33c8c51318b7.zip |
Move sys_chown() to rep_chown().
Diffstat (limited to 'lib/replace')
-rw-r--r-- | lib/replace/README | 1 | ||||
-rw-r--r-- | lib/replace/libreplace.m4 | 2 | ||||
-rw-r--r-- | lib/replace/replace.c | 13 | ||||
-rw-r--r-- | lib/replace/replace.h | 5 |
4 files changed, 20 insertions, 1 deletions
diff --git a/lib/replace/README b/lib/replace/README index 2f3b37340f..a63409580c 100644 --- a/lib/replace/README +++ b/lib/replace/README @@ -46,6 +46,7 @@ mkdtemp mkstemp (a secure one!) pread pwrite +chown getpass readline (the library) inet_ntoa diff --git a/lib/replace/libreplace.m4 b/lib/replace/libreplace.m4 index 6f1543863a..c802525eed 100644 --- a/lib/replace/libreplace.m4 +++ b/lib/replace/libreplace.m4 @@ -108,7 +108,7 @@ AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror) AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename) AC_CHECK_FUNCS(waitpid strlcpy strlcat initgroups memmove strdup) AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r mkdtemp) -AC_CHECK_FUNCS(isatty) +AC_CHECK_FUNCS(isatty chown) AC_HAVE_DECL(setresuid, [#include <unistd.h>]) AC_HAVE_DECL(setresgid, [#include <unistd.h>]) AC_HAVE_DECL(errno, [#include <errno.h>]) diff --git a/lib/replace/replace.c b/lib/replace/replace.c index 98d799b07e..74af75ebf1 100644 --- a/lib/replace/replace.c +++ b/lib/replace/replace.c @@ -2,6 +2,7 @@ Unix SMB/CIFS implementation. replacement routines for broken systems Copyright (C) Andrew Tridgell 1992-1998 + Copyright (C) Jelmer Vernooij 2005-2008 ** NOTE! The following LGPL license applies to the replace ** library. This does NOT imply that all of Samba is released @@ -614,3 +615,15 @@ int rep_utimes(const char *filename, const struct timeval tv[2]) return utime(filename, &u); } #endif + +#ifndef HAVE_CHOWN +/** +chown isn't used much but OS/2 doesn't have it +**/ +int rep_chown(const char *fname, uid_t uid, gid_t gid) +{ + errno = ENOSYS; + return -1; +} +#endif + diff --git a/lib/replace/replace.h b/lib/replace/replace.h index a8164b642b..2518d40a65 100644 --- a/lib/replace/replace.h +++ b/lib/replace/replace.h @@ -215,6 +215,11 @@ int rep_seteuid(uid_t); int rep_setegid(gid_t); #endif +#ifndef HAVE_CHOWN +#define chown rep_chown +int rep_chown(const char *path, uid_t uid, gid_t gid); +#endif + #ifndef HAVE_SETLINEBUF #define setlinebuf rep_setlinebuf void rep_setlinebuf(FILE *); |