1 From 6583d18da1df505969d382449d367763d509339a Mon Sep 17 00:00:00 2001
2 From: Vincent Povirk <vincent@codeweavers.com>
3 Date: Wed, 15 Oct 2008 12:44:16 -0500
4 Subject: [PATCH] allow other users in the same group to share a wine server
7 dlls/ntdll/server.c | 2 +-
8 libs/wine/config.c | 6 +-----
9 server/request.c | 2 +-
10 3 files changed, 3 insertions(+), 7 deletions(-)
12 diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c
13 index 3d85db9..35857ed 100644
14 --- a/dlls/ntdll/server.c
15 +++ b/dlls/ntdll/server.c
16 @@ -860,7 +860,7 @@ static int server_connect(void)
17 /* make sure the socket is sane (ISFIFO needed for Solaris) */
18 if (!S_ISSOCK(st.st_mode) && !S_ISFIFO(st.st_mode))
19 fatal_error( "'%s/%s' is not a socket\n", serverdir, SOCKETNAME );
20 - if (st.st_uid != getuid())
21 + if (st.st_gid != getgid())
22 fatal_error( "'%s/%s' is not owned by you\n", serverdir, SOCKETNAME );
24 /* try to connect to it */
25 diff --git a/libs/wine/config.c b/libs/wine/config.c
26 index cecf25e..2df904b 100644
27 --- a/libs/wine/config.c
28 +++ b/libs/wine/config.c
29 @@ -143,11 +143,7 @@ static char *get_runtime_libdir(void)
30 static void init_server_dir( dev_t dev, ino_t ino )
34 - const unsigned int uid = getuid();
36 - const unsigned int uid = 0;
38 + const unsigned int uid = getgid();
40 server_dir = xmalloc( sizeof(server_root_prefix) + 32 + sizeof(server_dir_prefix) +
41 2*sizeof(dev) + 2*sizeof(ino) );
42 diff --git a/server/request.c b/server/request.c
43 index e03f47b..d6264ca 100644
44 --- a/server/request.c
45 +++ b/server/request.c
46 @@ -724,7 +724,7 @@ static void acquire_lock(void)
47 fatal_perror( "bind" );
49 atexit( socket_cleanup );
50 - chmod( server_socket_name, 0600 ); /* make sure no other user can connect */
51 + chmod( server_socket_name, 0660 ); /* make sure no other group can connect */
52 if (listen( fd, 5 ) == -1) fatal_perror( "listen" );
54 if (!(master_socket = alloc_object( &master_socket_ops )) ||