wine: hard-code the username to make things work in Rainbow
[sugaredwine.git] / patches / 0025-libwine-hard-code-the-username-because-Rainbow-like.patch
blobb55cd3256c91f7466b332aa36c1d867b3afe2fb1
1 From 385f50b633c5f5006c5e1297fcb73f13c8253b52 Mon Sep 17 00:00:00 2001
2 From: Vincent Povirk <vincent@codeweavers.com>
3 Date: Thu, 9 Oct 2008 11:37:20 -0500
4 Subject: [PATCH] libwine: hard-code the username because Rainbow likes to change it
6 ---
7 libs/wine/config.c | 8 +++++++-
8 1 files changed, 7 insertions(+), 1 deletions(-)
10 diff --git a/libs/wine/config.c b/libs/wine/config.c
11 index dbfe930..8eaf164 100644
12 --- a/libs/wine/config.c
13 +++ b/libs/wine/config.c
14 @@ -45,9 +45,11 @@ static char *datadir;
15 static char *config_dir;
16 static char *server_dir;
17 static char *build_dir;
18 -static char *user_name;
19 static char *argv0_name;
21 +/* use a constant username because Rainbow likes to change it */
22 +static const char user_name[] = "sugaruser";
24 #ifdef __GNUC__
25 static void fatal_error( const char *err, ... ) __attribute__((noreturn,format(printf,1,2)));
26 static void fatal_perror( const char *err, ... ) __attribute__((noreturn,format(printf,1,2)));
27 @@ -176,9 +178,12 @@ static void init_paths(void)
28 struct stat st;
30 const char *home = getenv( "HOME" );
31 +#if 0 /* disabled because of rainbow */
32 const char *user = NULL;
33 +#endif
34 const char *prefix = getenv( "WINEPREFIX" );
36 +#if 0 /* disabled because of rainbow */
37 #ifdef HAVE_GETPWUID
38 char uid_str[32];
39 struct passwd *pwd = getpwuid( getuid() );
40 @@ -198,6 +203,7 @@ static void init_paths(void)
41 fatal_error( "cannot determine your user name, set the USER environment variable\n" );
42 #endif /* HAVE_GETPWUID */
43 user_name = xstrdup( user );
44 +#endif
46 /* build config_dir */
48 --
49 1.5.6.3