rpms/tmux/devel tmux-1.2-writehard.patch, NONE, 1.1 tmux.spec, 1.5, 1.6 tmux-1.0-06_hardening_write_return.diff, 1.2, NONE

Till Maas till at fedoraproject.org
Sun Mar 28 10:09:39 UTC 2010


Author: till

Update of /cvs/pkgs/rpms/tmux/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv8005

Modified Files:
	tmux.spec 
Added Files:
	tmux-1.2-writehard.patch 
Removed Files:
	tmux-1.0-06_hardening_write_return.diff 
Log Message:
rediff hardening write patch


tmux-1.2-writehard.patch:
 tty.c    |   12 ++++++++----
 window.c |    4 +++-
 2 files changed, 11 insertions(+), 5 deletions(-)

--- NEW FILE tmux-1.2-writehard.patch ---
diff -up tmux-1.2/tty.c.writehard tmux-1.2/tty.c
--- tmux-1.2/tty.c.writehard	2010-03-08 15:53:49.000000000 +0100
+++ tmux-1.2/tty.c	2010-03-28 12:01:49.335023195 +0200
@@ -300,7 +300,8 @@ tty_free(struct tty *tty)
 void
 tty_raw(struct tty *tty, const char *s)
 {
-	write(tty->fd, s, strlen(s));
+	if (write(tty->fd, s, strlen(s)) == -1)
+		fatal("write failed");
 }
 
 void
@@ -333,7 +334,8 @@ tty_puts(struct tty *tty, const char *s)
 	bufferevent_write(tty->event, s, strlen(s));
 
 	if (tty->log_fd != -1)
-		write(tty->log_fd, s, strlen(s));
+		if(write(tty->log_fd, s, strlen(s)) == -1)
+			fatal("write failed");
 }
 
 void
@@ -359,7 +361,8 @@ tty_putc(struct tty *tty, u_char ch)
 	}
 
 	if (tty->log_fd != -1)
-		write(tty->log_fd, &ch, 1);
+		if (write(tty->log_fd, &ch, 1) == -1)
+			fatal("write failed");
 }
 
 void
@@ -370,7 +373,8 @@ tty_pututf8(struct tty *tty, const struc
 	size = grid_utf8_size(gu);
 	bufferevent_write(tty->event, gu->data, size);
 	if (tty->log_fd != -1)
-		write(tty->log_fd, gu->data, size);
+		if(write(tty->log_fd, gu->data, size) == -1)
+			fatal("write failed");
 	tty->cx += gu->width;
 }
 
diff -up tmux-1.2/window.c.writehard tmux-1.2/window.c
--- tmux-1.2/window.c.writehard	2010-02-08 19:10:07.000000000 +0100
+++ tmux-1.2/window.c	2010-03-28 12:03:07.316900726 +0200
@@ -518,7 +518,9 @@ window_pane_spawn(struct window_pane *wp
 		return (-1);
 	case 0:
 		if (chdir(wp->cwd) != 0)
-			chdir("/");
+			if (chdir("/") <0)
+				fatal("chdir failed");
+
 
 		if (tcgetattr(STDIN_FILENO, &tio2) != 0)
 			fatal("tcgetattr failed");


Index: tmux.spec
===================================================================
RCS file: /cvs/pkgs/rpms/tmux/devel/tmux.spec,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- tmux.spec	28 Mar 2010 09:44:14 -0000	1.5
+++ tmux.spec	28 Mar 2010 10:09:39 -0000	1.6
@@ -15,7 +15,9 @@ Source0:        http://downloads.sourcef
 Patch0:         tmux-1.0-02_fix_wrong_location.diff
 Patch1:         tmux-1.0-03_proper_socket_handling.diff
 Patch2:         tmux-1.0-04_dropping_unnecessary_privileges.diff
-#Patch3:         tmux-1.0-06_hardening_write_return.diff
+# 2010-03-28: Submitted upstream:
+# https://sourceforge.net/tracker/?func=detail&aid=2977945&group_id=200378&atid=973264
+Patch3:         tmux-1.2-writehard.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  ncurses-devel
@@ -32,7 +34,7 @@ as GNU Screen.
 %patch0 -p1 -b .location
 %patch1 -p1 -b .sockethandling
 %patch2 -p1 -b .dropprivs
-#%patch3 -p1 -b .writehard
+%patch3 -p1 -b .writehard
 
 %build
 %configure
@@ -61,6 +63,7 @@ getent group tmux >/dev/null || groupadd
 %changelog
 * Sun Mar 28 2010 Sven Lankes <sven at lank.es> 1.2-1
 - New upstream release
+- rediff writehard patch
 
 * Mon Nov 09 2009 Sven Lankes <sven at lank.es> 1.1-1
 - New upstream release


--- tmux-1.0-06_hardening_write_return.diff DELETED ---



More information about the scm-commits mailing list