[tmux/el5/master: 14/14] Merge branch 'master' into el5
Sven Lankes
slankes at fedoraproject.org
Sun Apr 10 10:06:45 UTC 2011
commit 7a91eb7092104d2b2b3886de8feed27179a43a1c
Merge: 3a51a8f 7357310
Author: Sven Lankes <sven at lank.es>
Date: Sun Apr 10 12:06:13 2011 +0200
Merge branch 'master' into el5
Conflicts:
.gitignore
sources
tmux-1.0-02_fix_wrong_location.diff
tmux-1.0-03_proper_socket_handling.diff
tmux-1.0-04_dropping_unnecessary_privileges.diff
tmux.spec
sources | 4 +
tmux-1.0-02_fix_wrong_location.diff | 41 ++++++++++++
tmux-1.0-03_proper_socket_handling.diff | 72 ++++++++++++++++++++++
tmux-1.0-04_dropping_unnecessary_privileges.diff | 29 +++++++++
tmux-1.2-writehard.patch | 57 +++++++++++++++++
tmux.spec | 31 ++++++++-
6 files changed, 231 insertions(+), 3 deletions(-)
---
diff --cc sources
index 0053d49,154396f..6b6ce94
--- a/sources
+++ b/sources
@@@ -1,1 -1,1 +1,5 @@@
++<<<<<<< HEAD
+faf2fc52ac3ae63d899f6fece2c112cd tmux-1.1.tar.gz
++=======
+ 0bfc7dd9a5bab192406167589c716a21 tmux-1.4.tar.gz
++>>>>>>> master
diff --cc tmux-1.0-02_fix_wrong_location.diff
index 4d72c24,5c401ba..43449f5
--- a/tmux-1.0-02_fix_wrong_location.diff
+++ b/tmux-1.0-02_fix_wrong_location.diff
@@@ -1,8 -1,7 +1,15 @@@
++<<<<<<< HEAD
+diff --git a/GNUmakefile b/GNUmakefile
+index f8f1911..5e7b6f3 100644
+--- a/GNUmakefile
++++ b/GNUmakefile
+@@ -23,7 +23,7 @@ VERSION= 1.1
++=======
+ # correct directory /usr/local
+ --- a/GNUmakefile
+ +++ b/GNUmakefile
+ @@ -23,7 +23,7 @@
++>>>>>>> master
CC?= cc
CFLAGS+= -DBUILD="\"$(VERSION)\""
@@@ -11,30 -10,28 +18,52 @@@
LIBS+=
# Sun CC
++<<<<<<< HEAD
+@@ -51,7 +51,7 @@ CFLAGS+= -Wno-pointer-sign
++=======
+ @@ -51,7 +51,7 @@
++>>>>>>> master
endif
endif
-PREFIX?= /usr/local
++<<<<<<< HEAD
++PREFIX?= /usr
+ INSTALLDIR= install -d
+ INSTALLBIN= install -g bin -o root -m 555
+ INSTALLMAN= install -g bin -o root -m 444
+@@ -80,7 +80,7 @@ clean-all: clean clean-depend
++=======
+ +PREFIX?= /usr/
+ INSTALL?= install
+ INSTALLDIR= $(INSTALL) -d
+ INSTALLBIN= $(INSTALL) -m 555
+ @@ -81,7 +81,7 @@
++>>>>>>> master
install: all
$(INSTALLDIR) $(DESTDIR)$(PREFIX)/bin
$(INSTALLBIN) tmux $(DESTDIR)$(PREFIX)/bin/tmux
- $(INSTALLDIR) $(DESTDIR)$(PREFIX)/man/man1
- $(INSTALLMAN) tmux.1 $(DESTDIR)$(PREFIX)/man/man1/tmux.1
++<<<<<<< HEAD
++ $(INSTALLDIR) $(DESTDIR)$(PREFIX)/share/man/man1
++ $(INSTALLMAN) tmux.1 $(DESTDIR)$(PREFIX)/share/man/man1/tmux.1
+
+ -include .depend
+diff --git a/Makefile b/Makefile
+index f713677..c5b1ece 100644
+--- a/Makefile
++++ b/Makefile
+@@ -24,7 +24,7 @@ VERSION= 1.1
++=======
+ + $(INSTALLDIR) $(DESTDIR)$(PREFIX)share/man/man1
+ + $(INSTALLMAN) tmux.1 $(DESTDIR)$(PREFIX)share/man/man1/tmux.1
+
+ -include .depend
+ --- a/Makefile
+ +++ b/Makefile
+ @@ -24,7 +24,7 @@
++>>>>>>> master
CC?= cc
CFLAGS+= -DBUILD="\"$(VERSION)\""
@@@ -43,16 -40,16 +72,28 @@@
LIBS+=
.ifdef FDEBUG
++<<<<<<< HEAD
+@@ -47,7 +47,7 @@ CFLAGS+= -Wno-pointer-sign
++=======
+ @@ -47,7 +47,7 @@
++>>>>>>> master
.endif
.endif
-PREFIX?= /usr/local
++<<<<<<< HEAD
++PREFIX?= /usr
+ INSTALLDIR= install -d
+ INSTALLBIN= install -g bin -o root -m 555
+ INSTALLMAN= install -g bin -o root -m 444
+@@ -79,5 +79,5 @@ clean-all: clean clean-depend
++=======
+ +PREFIX?= /usr/
+ INSTALL?= install
+ INSTALLDIR= ${INSTALL} -d
+ INSTALLBIN= ${INSTALL} -m 555
+ @@ -80,5 +80,5 @@
++>>>>>>> master
install: all
${INSTALLDIR} ${DESTDIR}${PREFIX}/bin
${INSTALLBIN} tmux ${DESTDIR}${PREFIX}/bin/
diff --cc tmux-1.0-03_proper_socket_handling.diff
index ff07806,fb6703d..0a3b3af
--- a/tmux-1.0-03_proper_socket_handling.diff
+++ b/tmux-1.0-03_proper_socket_handling.diff
@@@ -1,46 -1,48 +1,93 @@@
++<<<<<<< HEAD
+diff --git a/GNUmakefile b/GNUmakefile
+index 5e7b6f3..c11120e 100644
+--- a/GNUmakefile
++++ b/GNUmakefile
+@@ -53,7 +53,7 @@ endif
+
+ PREFIX?= /usr
+ INSTALLDIR= install -d
+-INSTALLBIN= install -g bin -o root -m 555
++INSTALLBIN= install -g tmux -o root -m 2755
+ INSTALLMAN= install -g bin -o root -m 444
+
+ SRCS= $(shell echo *.c|sed 's|osdep-[a-z0-9]*.c||g')
+diff --git a/Makefile b/Makefile
+index c5b1ece..9cb822a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -49,7 +49,7 @@ CFLAGS+= -Wno-pointer-sign
+
+ PREFIX?= /usr
+ INSTALLDIR= install -d
+-INSTALLBIN= install -g bin -o root -m 555
++INSTALLBIN= install -g tmux -o root -m 2755
+ INSTALLMAN= install -g bin -o root -m 444
+
+ SRCS!= echo *.c|sed 's|osdep-[a-z0-9]*.c||g'
+diff --git a/compat.h b/compat.h
+index 68fde0a..d63e7d3 100644
+--- a/compat.h
++++ b/compat.h
+@@ -26,6 +26,7 @@ typedef uint64_t u_int64_t;
+ #ifndef HAVE_PATHS_H
+ #define _PATH_BSHELL "/bin/sh"
+ #define _PATH_TMP "/tmp/"
++=======
+ # setting /usr/bin/tmux with sgid and proper location of socket
+ ---
+ # GNUmakefile | 2 +-
+ # Makefile | 2 +-
+ # compat.h | 2 +-
+ # tmux.1 | 6 +++---
+ # tmux.c | 2 +-
+ # 5 files changed, 7 insertions(+), 7 deletions(-)
+ #
+ --- a/GNUmakefile
+ +++ b/GNUmakefile
+ @@ -54,7 +54,7 @@
+ PREFIX?= /usr/
+ INSTALL?= install
+ INSTALLDIR= $(INSTALL) -d
+ -INSTALLBIN= $(INSTALL) -m 555
+ +INSTALLBIN= $(INSTALL) -g tmux -o root -m 2755
+ INSTALLMAN= $(INSTALL) -m 444
+
+ SRCS= $(shell echo *.c|LC_ALL=C sed 's|osdep-[a-z0-9]*.c||g')
+ --- a/Makefile
+ +++ b/Makefile
+ @@ -50,7 +50,7 @@
+ PREFIX?= /usr/
+ INSTALL?= install
+ INSTALLDIR= ${INSTALL} -d
+ -INSTALLBIN= ${INSTALL} -m 555
+ +INSTALLBIN= $(INSTALL) -g tmux -o root -m 2755
+ INSTALLMAN= ${INSTALL} -m 444
+
+ SRCS!= echo *.c|LC_ALL=C sed 's|osdep-[a-z0-9]*.c||g'
+ --- a/compat.h
+ +++ b/compat.h
+ @@ -25,7 +25,7 @@
+
+ #ifndef HAVE_PATHS_H
+ #define _PATH_BSHELL "/bin/sh"
+ -#define _PATH_TMP "/tmp/"
++>>>>>>> master
+#define _PATH_VARRUN "/var/run/"
#define _PATH_DEVNULL "/dev/null"
#define _PATH_TTY "/dev/tty"
#define _PATH_DEV "/dev/"
++<<<<<<< HEAD
+diff --git a/tmux.c b/tmux.c
+index b590ec1..8c07180 100644
+--- a/tmux.c
++++ b/tmux.c
+@@ -264,7 +264,7 @@ makesockpath(const char *label)
++=======
+ --- a/tmux.c
+ +++ b/tmux.c
+ @@ -188,7 +188,7 @@
++>>>>>>> master
u_int uid;
uid = getuid();
@@@ -49,3 -51,25 +96,28 @@@
if (mkdir(base, S_IRWXU) != 0 && errno != EEXIST)
return (NULL);
++<<<<<<< HEAD
++=======
+ --- a/tmux.1
+ +++ b/tmux.1
+ @@ -89,8 +89,8 @@
+ and all sessions are managed by a single
+ .Em server .
+ The server and each client are separate processes which communicate through a
+ -socket in
+ -.Pa /tmp .
+ +socket in a directory under
+ +.Pa /var/run/tmux .
+ .Pp
+ The options are as follows:
+ .Bl -tag -width "XXXXXXXXXXXX"
+ @@ -134,7 +134,7 @@
+ .It Fl L Ar socket-name
+ .Nm
+ stores the server socket in a directory under
+ -.Pa /tmp ;
+ +.Pa /var/run/tmux ;
+ the default socket is named
+ .Em default .
+ This option allows a different socket name to be specified, allowing several
++>>>>>>> master
diff --cc tmux-1.0-04_dropping_unnecessary_privileges.diff
index cc34c96,b72a085..ed08a46
--- a/tmux-1.0-04_dropping_unnecessary_privileges.diff
+++ b/tmux-1.0-04_dropping_unnecessary_privileges.diff
@@@ -1,26 -1,26 +1,55 @@@
++<<<<<<< HEAD
+# using setresgid() for safely dropping utmp group membership.
+--- a/tmux.c
++++ b/tmux.c
+@@ -236,9 +236,11 @@
+ {
+ char base[MAXPATHLEN], *path;
+ struct stat sb;
+- u_int uid;
++ u_int uid,gid;
+
+ uid = getuid();
++ gid = getgid();
++
+ xsnprintf(base, MAXPATHLEN, "%s/%s/%s-%d", _PATH_VARRUN, __progname, __progname, uid);
+
+ if (mkdir(base, S_IRWXU) != 0 && errno != EEXIST)
+@@ -254,6 +256,9 @@
+ errno = EACCES;
+ return (NULL);
+ }
++ /* drop unnecessary privileges */
++ if (setresgid(gid, gid, gid) != 0)
++ return (NULL);
+
+ xasprintf(&path, "%s/%s", base, label);
+ return (path);
++=======
+ # using setresgid() for safely dropping utmp group membership which were needed
+ # for makesocketpath() to create the user directory under /var/run/tmux which is
+ # only writeable for processes that have setgid utmp.
+ --- a/tmux.c
+ +++ b/tmux.c
+ @@ -235,6 +235,7 @@
+ struct keylist *keylist;
+ char *s, *path, *label, *home, **var;
+ int opt, flags, quiet, keys;
+ + u_int gid;
+
+ #if defined(DEBUG) && defined(__OpenBSD__)
+ malloc_options = (char *) "AFGJPX";
+ @@ -483,6 +484,12 @@
+ }
+ }
+ }
+ + gid = getgid();
+ + /* drop unnecessary privileges which were needed for makesocketpath()
+ + * to create the user directory under /var/run/tmux which is only
+ + * writeable for processes that have setgid utmp. */
+ + if (setresgid(gid, gid, gid) != 0)
+ + return (NULL);
+ if (label != NULL)
+ xfree(label);
+ if (realpath(path, socket_path) == NULL)
++>>>>>>> master
More information about the scm-commits
mailing list