Alexandre Julliard : libwine: Don' t add a user id to the server directory if not supported.
Alexandre Julliard
julliard at winehq.org
Mon Sep 16 16:57:22 CDT 2013
Module: wine
Branch: master
Commit: 876189a405e18ae7229093c391583eeb1447c53e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=876189a405e18ae7229093c391583eeb1447c53e
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Sep 16 12:43:07 2013 +0200
libwine: Don't add a user id to the server directory if not supported.
---
libs/wine/config.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/libs/wine/config.c b/libs/wine/config.c
index 4e26212..d8c46be 100644
--- a/libs/wine/config.c
+++ b/libs/wine/config.c
@@ -36,7 +36,7 @@
#include "wine/library.h"
static const char server_config_dir[] = "/.wine"; /* config dir relative to $HOME */
-static const char server_root_prefix[] = "/tmp/.wine-"; /* prefix for server root dir */
+static const char server_root_prefix[] = "/tmp/.wine"; /* prefix for server root dir */
static const char server_dir_prefix[] = "/server-"; /* prefix for server dir */
static char *bindir;
@@ -220,16 +220,18 @@ static char *get_runtime_argvdir( const char *argv0 )
/* initialize the server directory value */
static void init_server_dir( dev_t dev, ino_t ino )
{
- char *p;
+ char *p, *root;
+
#ifdef HAVE_GETUID
- const unsigned int uid = getuid();
+ root = xmalloc( sizeof(server_root_prefix) + 12 );
+ sprintf( root, "%s-%u", server_root_prefix, getuid() );
#else
- const unsigned int uid = 0;
+ root = xstrdup( server_root_prefix );
#endif
- server_dir = xmalloc( sizeof(server_root_prefix) + 32 + sizeof(server_dir_prefix) +
- 2*sizeof(dev) + 2*sizeof(ino) );
- sprintf( server_dir, "%s%u%s", server_root_prefix, uid, server_dir_prefix );
+ server_dir = xmalloc( strlen(root) + sizeof(server_dir_prefix) + 2*sizeof(dev) + 2*sizeof(ino) + 2 );
+ strcpy( server_dir, root );
+ strcat( server_dir, server_dir_prefix );
p = server_dir + strlen(server_dir);
if (dev != (unsigned long)dev)
@@ -241,6 +243,7 @@ static void init_server_dir( dev_t dev, ino_t ino )
sprintf( p, "%lx%08lx", (unsigned long)((unsigned long long)ino >> 32), (unsigned long)ino );
else
sprintf( p, "%lx", (unsigned long)ino );
+ free( root );
}
/* retrieve the default dll dir */
More information about the wine-cvs
mailing list