Commit e7c3ab18 authored by Steven Edwards's avatar Steven Edwards Committed by Alexandre Julliard

Check for getuid and avoid the use of it in libwine if we don't have

it.
parent b96edb38
...@@ -16278,6 +16278,7 @@ fi ...@@ -16278,6 +16278,7 @@ fi
for ac_func in \ for ac_func in \
_lwp_create \ _lwp_create \
_lwp_self \ _lwp_self \
...@@ -16308,6 +16309,7 @@ for ac_func in \ ...@@ -16308,6 +16309,7 @@ for ac_func in \
getservbyport \ getservbyport \
gettid \ gettid \
gettimeofday \ gettimeofday \
getuid \
inet_network \ inet_network \
lseek64 \ lseek64 \
lstat \ lstat \
......
...@@ -1083,6 +1083,7 @@ AC_CHECK_FUNCS(\ ...@@ -1083,6 +1083,7 @@ AC_CHECK_FUNCS(\
getservbyport \ getservbyport \
gettid \ gettid \
gettimeofday \ gettimeofday \
getuid \
inet_network \ inet_network \
lseek64 \ lseek64 \
lstat \ lstat \
......
...@@ -191,6 +191,9 @@ ...@@ -191,6 +191,9 @@
/* Define to 1 if you have the `gettimeofday' function. */ /* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY #undef HAVE_GETTIMEOFDAY
/* Define to 1 if you have the `getuid' function. */
#undef HAVE_GETUID
/* Define to 1 if you have the <gif_lib.h> header file. */ /* Define to 1 if you have the <gif_lib.h> header file. */
#undef HAVE_GIF_LIB_H #undef HAVE_GIF_LIB_H
......
...@@ -105,10 +105,15 @@ inline static void remove_trailing_slashes( char *path ) ...@@ -105,10 +105,15 @@ inline static void remove_trailing_slashes( char *path )
static void init_server_dir( dev_t dev, ino_t ino ) static void init_server_dir( dev_t dev, ino_t ino )
{ {
char *p; char *p;
#ifdef HAVE_GETUID
const unsigned int uid = getuid();
#else
const unsigned int uid = 0;
#endif
server_dir = xmalloc( sizeof(server_root_prefix) + 32 + sizeof(server_dir_prefix) + server_dir = xmalloc( sizeof(server_root_prefix) + 32 + sizeof(server_dir_prefix) +
2*sizeof(dev) + 2*sizeof(ino) ); 2*sizeof(dev) + 2*sizeof(ino) );
sprintf( server_dir, "%s%u%s", server_root_prefix, getuid(), server_dir_prefix ); sprintf( server_dir, "%s%u%s", server_root_prefix, uid, server_dir_prefix );
p = server_dir + strlen(server_dir); p = server_dir + strlen(server_dir);
if (sizeof(dev) > sizeof(unsigned long) && dev > ~0UL) if (sizeof(dev) > sizeof(unsigned long) && dev > ~0UL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment