git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #15649 from rycee/bump/dtach
f010ce6Arseniy Seroka
pkgs/tools/misc/dtach/default.nix+12−11
@@ -1,15 +1,14 @@
1{ stdenv, fetchurl }:
1{ stdenv, fetchurl }:
2
2
3stdenv.mkDerivation rec {
3stdenv.mkDerivation rec {
4− name = "dtach-0.8";
4+ name = "dtach-${version}";
5+ version = "0.9";
5
6
6 src = fetchurl {
7 src = fetchurl {
7− url = "mirror://sourceforge/project/dtach/dtach/0.8/dtach-0.8.tar.gz";
8+ url = "mirror://sourceforge/project/dtach/dtach/${version}/${name}.tar.gz";
8− sha256 = "16614ebddf8ab2811d3dc0e7f329c7de88929ac6a9632d4cb4aef7fe11b8f2a9";
9+ sha256 = "1wwj2hlngi8qn2pisvhyfxxs8gyqjlgrrv5lz91w8ly54dlzvs9j";
9 };
10 };
10
11
11− patches = [ ./fix-CVE-2012-3368.patch ];
12−
13 installPhase = ''
12 installPhase = ''
14 mkdir -p $out/bin
13 mkdir -p $out/bin
15 cp dtach $out/bin/dtach
14 cp dtach $out/bin/dtach
@@ -19,12 +18,14 @@ stdenv.mkDerivation rec {
19 homepage = http://dtach.sourceforge.net/;
18 homepage = http://dtach.sourceforge.net/;
20 description = "A program that emulates the detach feature of screen";
19 description = "A program that emulates the detach feature of screen";
21
20
21+ longDescription = ''
22− longDescription = ''dtach is a tiny program that emulates the
22+ dtach is a tiny program that emulates the detach feature of
23− detach feature of screen, allowing you to run a program in an
23+ screen, allowing you to run a program in an environment that is
24− environment that is protected from the controlling terminal and
24+ protected from the controlling terminal and attach to it later.
25− attach to it later. dtach does not keep track of the contents of
25+ dtach does not keep track of the contents of the screen, and
26− the screen, and thus works best with programs that know how to
26+ thus works best with programs that know how to redraw
27− redraw themselves.'';
27+ themselves.
28+ '';
28
29
29 license = stdenv.lib.licenses.gpl2Plus;
30 license = stdenv.lib.licenses.gpl2Plus;
30
31
pkgs/tools/misc/dtach/fix-CVE-2012-3368.patchdeleted−49
@@ -1,49 +0,0 @@
1−Fix error handling for read from stdin in attach.c
2−
3−attach.c did not correctly handle a read from stdin when read returned
4−an error. The code assigned the return value of read to pkt.len (an
5−unsigned char) before checking the value. This prevented the error check
6−from working correctly, since an unsigned integer can never be < 0.
7−
8−A packet with an invalid length was then sent to the master, which then
9−sent 255 bytes of garbage to the program.
10−
11−Fix the bug in attach.c and the unchecked packet length bug in master.c.
12−
13−Report and initial patch by Enrico Scholz.
14−
15−--- a/master.c 2012/07/01 21:26:10 1.14
16−+++ b/master.c 2012/07/01 21:44:34 1.15
17−@@ -351,7 +351,10 @@
18−
19− /* Push out data to the program. */
20− if (pkt.type == MSG_PUSH)
21−- write(the_pty.fd, pkt.u.buf, pkt.len);
22−+ {
23−+ if (pkt.len <= sizeof(pkt.u.buf))
24−+ write(the_pty.fd, pkt.u.buf, pkt.len);
25−+ }
26−
27− /* Attach or detach from the program. */
28− else if (pkt.type == MSG_ATTACH)
29−--- a/attach.c 2012/07/01 21:26:10 1.12
30−+++ b/attach.c 2012/07/01 21:44:34 1.13
31−@@ -237,12 +237,16 @@
32− /* stdin activity */
33− if (n > 0 && FD_ISSET(0, &readfds))
34− {
35−+ ssize_t len;
36−+
37− pkt.type = MSG_PUSH;
38− memset(pkt.u.buf, 0, sizeof(pkt.u.buf));
39−- pkt.len = read(0, pkt.u.buf, sizeof(pkt.u.buf));
40−+ len = read(0, pkt.u.buf, sizeof(pkt.u.buf));
41−
42−- if (pkt.len <= 0)
43−+ if (len <= 0)
44− exit(1);
45−+
46−+ pkt.len = len;
47− process_kbd(s, &pkt);
48− n--;
49− }