summaryrefslogtreecommitdiffstats
path: root/setup_native/scripts
diff options
context:
space:
mode:
authorRelease Engineers <releng@openoffice.org>2009-08-27 13:01:32 +0000
committerRelease Engineers <releng@openoffice.org>2009-08-27 13:01:32 +0000
commit59e13df0d23320c7b1edaab888db2f0bb8e2331d (patch)
tree560711bb38ebe0ab63cd1e3b2ff3ea8f979009d4 /setup_native/scripts
parentCWS-TOOLING: integrate CWS mh132 (diff)
downloadcore-59e13df0d23320c7b1edaab888db2f0bb8e2331d.tar.gz
core-59e13df0d23320c7b1edaab888db2f0bb8e2331d.zip
CWS-TOOLING: integrate CWS sysui311_DEV300
2009-08-11 18:30:31 +0200 ihi r274874 : #104116# use __lxstat wrapper for X86_64 Linux
Diffstat (limited to 'setup_native/scripts')
-rw-r--r--setup_native/scripts/source/getuid.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/setup_native/scripts/source/getuid.c b/setup_native/scripts/source/getuid.c
index 926c2b809af2..9af63f4f079d 100644
--- a/setup_native/scripts/source/getuid.c
+++ b/setup_native/scripts/source/getuid.c
@@ -88,13 +88,29 @@ int fstatat64(int fildes, const char *path, struct stat64 *buf, int flag)
return ret;
}
-
-#elif defined LINUX
+#elif defined LINUX
uid_t getuid (void) {return 0;}
uid_t geteuid (void) {return 0;}
/* This is to fool tar */
+#ifdef X86_64
+int __lxstat(int n, const char *path, struct stat *buf)
+{
+ int ret = 0;
+ static int (*p_lstat) (int n, const char *path, struct stat *buf) = NULL;
+ if (p_lstat == NULL)
+ p_lstat = (int (*)(int n, const char *path, struct stat *buf))
+ dlsym (RTLD_NEXT, "__lxstat");
+ ret = (*p_lstat)(n, path, buf);
+ if (buf != NULL)
+ {
+ buf->st_uid = 0; /* root */
+ buf->st_gid = 0; /* root */
+ }
+ return ret;
+}
+#else
int __lxstat64(int n, const char *path, struct stat64 *buf)
{
int ret = 0;
@@ -105,13 +121,12 @@ int __lxstat64(int n, const char *path, struct stat64 *buf)
ret = (*p_lstat)(n, path, buf);
if (buf != NULL)
{
- buf->st_uid = 0; /* root */
- buf->st_gid = 0; /* root */
+ buf->st_uid = 0;
+ buf->st_gid = 0;
}
-
return ret;
}
-
+#endif
#endif
#ifdef _cplusplus