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(). --- lib/replace/replace.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/replace/replace.h') 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 *); -- 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. --- lib/replace/replace.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/replace/replace.h') diff --git a/lib/replace/replace.h b/lib/replace/replace.h index 2518d40a65..7d8bbec18f 100644 --- a/lib/replace/replace.h +++ b/lib/replace/replace.h @@ -220,6 +220,11 @@ int rep_setegid(gid_t); int rep_chown(const char *path, uid_t uid, gid_t gid); #endif +#ifndef HAVE_LINK +#define link rep_link +int rep_link(const char *oldpath, const char *newpath); +#endif + #ifndef HAVE_SETLINEBUF #define setlinebuf rep_setlinebuf void rep_setlinebuf(FILE *); -- 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. --- lib/replace/replace.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/replace/replace.h') diff --git a/lib/replace/replace.h b/lib/replace/replace.h index 7d8bbec18f..fe01a8613e 100644 --- a/lib/replace/replace.h +++ b/lib/replace/replace.h @@ -225,6 +225,11 @@ int rep_chown(const char *path, uid_t uid, gid_t gid); int rep_link(const char *oldpath, const char *newpath); #endif +#ifndef HAVE_READLINK +#define readlink rep_readlink +int rep_readlink(const char *path, char *buf, size_t bufsize); +#endif + #ifndef HAVE_SETLINEBUF #define setlinebuf rep_setlinebuf void rep_setlinebuf(FILE *); -- 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. --- lib/replace/replace.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/replace/replace.h') diff --git a/lib/replace/replace.h b/lib/replace/replace.h index fe01a8613e..f56c5b0dc9 100644 --- a/lib/replace/replace.h +++ b/lib/replace/replace.h @@ -230,6 +230,12 @@ int rep_link(const char *oldpath, const char *newpath); int rep_readlink(const char *path, char *buf, size_t bufsize); #endif +#ifndef HAVE_SYMLINK +#define symlink rep_symlink +int rep_symlink(const char *oldpath, const char *newpath); +#endif + + #ifndef HAVE_SETLINEBUF #define setlinebuf rep_setlinebuf void rep_setlinebuf(FILE *); -- 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. --- lib/replace/replace.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/replace/replace.h') diff --git a/lib/replace/replace.h b/lib/replace/replace.h index f56c5b0dc9..b81bf5c576 100644 --- a/lib/replace/replace.h +++ b/lib/replace/replace.h @@ -235,6 +235,10 @@ int rep_readlink(const char *path, char *buf, size_t bufsize); int rep_symlink(const char *oldpath, const char *newpath); #endif +#ifndef HAVE_LCHOWN +#define lchown rep_lchown +int rep_lchown(const char *fname,uid_t uid,gid_t gid); +#endif #ifndef HAVE_SETLINEBUF #define setlinebuf rep_setlinebuf -- 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. --- lib/replace/replace.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/replace/replace.h') diff --git a/lib/replace/replace.h b/lib/replace/replace.h index b81bf5c576..8d0dd57064 100644 --- a/lib/replace/replace.h +++ b/lib/replace/replace.h @@ -235,6 +235,11 @@ int rep_readlink(const char *path, char *buf, size_t bufsize); int rep_symlink(const char *oldpath, const char *newpath); #endif +#ifndef HAVE_REALPATH +#define realpath rep_realpath +char *rep_realpath(const char *path, char *resolved_path); +#endif + #ifndef HAVE_LCHOWN #define lchown rep_lchown int rep_lchown(const char *fname,uid_t uid,gid_t gid); -- 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. --- lib/replace/replace.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/replace/replace.h') diff --git a/lib/replace/replace.h b/lib/replace/replace.h index 8d0dd57064..d717d6391c 100644 --- a/lib/replace/replace.h +++ b/lib/replace/replace.h @@ -220,6 +220,11 @@ int rep_setegid(gid_t); int rep_chown(const char *path, uid_t uid, gid_t gid); #endif +#ifndef HAVE_CHROOT +#define chroot rep_chroot +int rep_chroot(const char *dirname); +#endif + #ifndef HAVE_LINK #define link rep_link int rep_link(const char *oldpath, const char *newpath); -- cgit From 5a56c0adf2c63602b819d052644cb14caf732438 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 1 Nov 2008 03:58:14 +0100 Subject: Use dup2() replacement from libreplace. --- lib/replace/replace.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/replace/replace.h') diff --git a/lib/replace/replace.h b/lib/replace/replace.h index a8164b642b..70b29722bf 100644 --- a/lib/replace/replace.h +++ b/lib/replace/replace.h @@ -358,6 +358,11 @@ struct tm; char *rep_strptime(const char *buf, const char *format, struct tm *tm); #endif +#ifndef HAVE_DUP2 +#define dup2 rep_dup2 +int rep_dup2(int oldfd, int newfd); +#endif + /* Load header file for dynamic linking stuff */ #ifdef HAVE_DLFCN_H #include -- cgit From cd55fdd445cc5d1ab7b563336a46d80867af7197 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 1 Nov 2008 04:36:24 +0100 Subject: Fix return type of readlink(). --- lib/replace/replace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/replace/replace.h') diff --git a/lib/replace/replace.h b/lib/replace/replace.h index 8483d934d8..c1444cd5ee 100644 --- a/lib/replace/replace.h +++ b/lib/replace/replace.h @@ -232,7 +232,7 @@ int rep_link(const char *oldpath, const char *newpath); #ifndef HAVE_READLINK #define readlink rep_readlink -int rep_readlink(const char *path, char *buf, size_t bufsize); +ssize_t rep_readlink(const char *path, char *buf, size_t bufsize); #endif #ifndef HAVE_SYMLINK -- cgit From b327c0a2da6e48256fc64ee96bcec5da81843ec6 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 2 Nov 2008 17:39:41 +0100 Subject: Samba3: Remove more configure tests already done by libreplace. --- lib/replace/replace.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/replace/replace.h') diff --git a/lib/replace/replace.h b/lib/replace/replace.h index c1444cd5ee..c3b0604a2c 100644 --- a/lib/replace/replace.h +++ b/lib/replace/replace.h @@ -4,7 +4,7 @@ macros to go along with the lib/replace/ portability layer code Copyright (C) Andrew Tridgell 2005 - Copyright (C) Jelmer Vernooij 2006 + Copyright (C) Jelmer Vernooij 2006-2008 Copyright (C) Jeremy Allison 2007. ** NOTE! The following LGPL license applies to the replace @@ -215,6 +215,14 @@ int rep_seteuid(uid_t); int rep_setegid(gid_t); #endif +#if (defined(USE_SETRESUID) && !defined(HAVE_SETRESUID_DECL)) +/* stupid glibc */ +int setresuid(uid_t ruid, uid_t euid, uid_t suid); +#endif +#if (defined(USE_SETRESUID) && !defined(HAVE_SETRESGID_DECL)) +int setresgid(gid_t rgid, gid_t egid, gid_t sgid); +#endif + #ifndef HAVE_CHOWN #define chown rep_chown int rep_chown(const char *path, uid_t uid, gid_t gid); -- cgit