summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2010-06-22 23:21:39 +0000
committerTiago Cunha <tcunha@gmx.com>2010-06-22 23:21:39 +0000
commit29434cb0432426819cc75bbb624b14cf916fe88f (patch)
tree9648d2a2001954feacf61ab49962c161fc5cfa3f
parentb7454e37cbec61fbd30a40c57df4916aa4fb2c70 (diff)
Sync OpenBSD patchset 722:
Give tmux sockets (but not the containing folder) group permissions. This allows hardlinks to the sockets to be used more easily.
-rw-r--r--server.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/server.c b/server.c
index 4e120ae5..94bea25d 100644
--- a/server.c
+++ b/server.c
@@ -1,4 +1,4 @@
-/* $Id: server.c,v 1.241 2010-05-16 17:50:31 nicm Exp $ */
+/* $Id: server.c,v 1.242 2010-06-22 23:21:39 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -85,7 +85,7 @@ server_create_socket(void)
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
fatal("socket failed");
- mask = umask(S_IXUSR|S_IRWXG|S_IRWXO);
+ mask = umask(S_IXUSR|S_IXGRP|S_IRWXO);
if (bind(fd, (struct sockaddr *) &sa, SUN_LEN(&sa)) == -1)
fatal("bind failed");
umask(mask);
@@ -314,9 +314,9 @@ server_update_socket(void)
if (n != last) {
last = n;
if (n != 0)
- chmod(socket_path, S_IRWXU);
+ chmod(socket_path, S_IRWXU|S_IRWXG);
else
- chmod(socket_path, S_IRUSR|S_IWUSR);
+ chmod(socket_path, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
}
}