From 531dbbd8e7760e839fad2a322de11e2d6d98abd7 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 27 Sep 2004 20:50:37 +0000 Subject: [PATCH] Base the server directory name on the uid, not the username. --- libs/wine/config.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/libs/wine/config.c b/libs/wine/config.c index d08fd0186e5..72990332e1d 100644 --- a/libs/wine/config.c +++ b/libs/wine/config.c @@ -104,21 +104,12 @@ inline static void remove_trailing_slashes( char *path ) /* initialize the server directory value */ static void init_server_dir( dev_t dev, ino_t ino ) { - const char *user = wine_get_user_name(); char *p; - server_dir = xmalloc( sizeof(server_root_prefix) + strlen(user) + sizeof(server_dir_prefix) + + server_dir = xmalloc( sizeof(server_root_prefix) + 32 + sizeof(server_dir_prefix) + 2*sizeof(dev) + 2*sizeof(ino) ); - strcpy( server_dir, server_root_prefix ); - p = server_dir + sizeof(server_root_prefix) - 1; - strcpy( p, user ); - while (*p) - { - if (*p == '/') *p = '!'; - p++; - } - strcpy( p, server_dir_prefix ); - p += sizeof(server_dir_prefix) - 1; + sprintf( server_dir, "%s%u%s", server_root_prefix, getuid(), server_dir_prefix ); + p = server_dir + strlen(server_dir); if (sizeof(dev) > sizeof(unsigned long) && dev > ~0UL) sprintf( p, "%lx%08lx-", (unsigned long)(dev >> 32), (unsigned long)dev ); @@ -151,7 +142,7 @@ static void init_paths(void) } if (!user) { - sprintf( uid_str, "%d", getuid() ); + sprintf( uid_str, "%u", getuid() ); user = uid_str; } #else /* HAVE_GETPWUID */