]> git.pld-linux.org Git - packages/screen.git/commitdiff
- up to fresh snapshot; add patches from fc
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Wed, 12 Dec 2012 19:17:04 +0000 (20:17 +0100)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Wed, 12 Dec 2012 19:17:04 +0000 (20:17 +0100)
screen-4.1.0-suppress_remap.patch [new file with mode: 0644]
screen-E3.patch [new file with mode: 0644]
screen-ipv6.patch [new file with mode: 0644]
screen.spec

diff --git a/screen-4.1.0-suppress_remap.patch b/screen-4.1.0-suppress_remap.patch
new file mode 100644 (file)
index 0000000..85109a2
--- /dev/null
@@ -0,0 +1,13 @@
+Author: Loic Minier <lool@dooz.org>
+Description: Unbreak several useful keybindings.
+--- a/termcap.c
++++ b/termcap.c
+@@ -552,8 +552,6 @@
+       else
+       break;
+     }
+-  if (n < KMAP_KEYS)
+-    domap = 1;
+   if (map == 0 && domap)
+     return 0;
+   if (map && !domap)
diff --git a/screen-E3.patch b/screen-E3.patch
new file mode 100644 (file)
index 0000000..7438929
--- /dev/null
@@ -0,0 +1,62 @@
+commit 0aec2900f63820c3405ba38a4d1cd67cc22f0715
+Author: Miroslav Lichvar <mlichvar@redhat.com>
+Date:   Mon Jul 18 17:26:47 2011 +0200
+
+    Clear scrollback buffer when locking terminal
+    
+    Linux kernel 3.0 adds a new command to clear the scrollback buffer in
+    the linux console. It's available in the ncurses terminfo entry as
+    extended capability E3. This is useful to prevent an attacker to read
+    content of a locked terminal via Shift-PgUp key.
+
+diff --git a/src/display.c b/src/display.c
+index 5fa11cb..038c435 100644
+--- a/src/display.c
++++ b/src/display.c
+@@ -3779,4 +3779,10 @@ char **cmdv;
+ #endif /* BLANKER_PRG */
++void
++ClearScrollbackBuffer()
++{
++  if (D_CE3)
++    AddCStr(D_CE3);
++}
+diff --git a/src/extern.h b/src/extern.h
+index c787d99..d3fecf0 100644
+--- a/src/extern.h
++++ b/src/extern.h
+@@ -316,6 +316,7 @@ extern int   color256to88 __P((int));
+ extern void  ResetIdle __P((void));
+ extern void  KillBlanker __P((void));
+ extern void  DisplaySleep1000 __P((int, int));
++extern void  ClearScrollbackBuffer __P((void));
+ /* resize.c */
+ extern int   ChangeWindowSize __P((struct win *, int, int, int));
+diff --git a/src/screen.c b/src/screen.c
+index cc8f565..3efb67b 100644
+--- a/src/screen.c
++++ b/src/screen.c
+@@ -1967,6 +1967,7 @@ int mode;
+ #endif
+     case D_LOCK:
+       ClearAll();
++      ClearScrollbackBuffer();
+       sign = SIG_LOCK;
+       /* tell attacher to lock terminal with a lockprg. */
+       break;
+diff --git a/src/term.c b/src/term.c
+index 991de1b..7485900 100644
+--- a/src/term.c
++++ b/src/term.c
+@@ -83,6 +83,7 @@ struct term term[T_N] =
+   { "CD", T_STR  },
+   { "ce", T_STR  },
+   { "cb", T_STR  },
++  { "E3", T_STR  },
+ /* initialise */
+   { "is", T_STR  },
diff --git a/screen-ipv6.patch b/screen-ipv6.patch
new file mode 100644 (file)
index 0000000..ec13e11
--- /dev/null
@@ -0,0 +1,345 @@
+diff -up screen/src/doc/screen.1.ipv6 screen/src/doc/screen.1
+--- screen/src/doc/screen.1.ipv6       2010-11-11 03:47:46.000000000 +0100
++++ screen/src/doc/screen.1    2011-02-03 16:05:35.957087079 +0100
+@@ -400,6 +400,12 @@
+ \fB-r\fP option to tell screen to look only for attached or
+ detached screen sessions. Note that this command doesn't work if
+ the session is password protected.
++.TP 5
++.B \-4
++Resolve hostnames only to IPv4 addresses.
++.TP 5
++.B \-6
++Resolve hostnames only to IPv6 addresses.
+ .SH "DEFAULT KEY BINDINGS"
+ .ta 12n 26n
+diff -up screen/src/extern.h.ipv6 screen/src/extern.h
+--- screen/src/extern.h.ipv6   2010-11-11 03:47:46.000000000 +0100
++++ screen/src/extern.h        2011-02-03 16:04:35.995743620 +0100
+@@ -455,8 +455,7 @@ extern void  ExitOverlayPage __P((void))
+ /* teln.c */
+ #ifdef BUILTIN_TELNET
+-extern int   TelOpen __P((char **));
+-extern int   TelConnect __P((struct win *));
++extern int   TelOpenAndConnect __P((struct win *));
+ extern int   TelIsline __P((struct win *p));
+ extern void  TelProcessLine __P((char **, int *));
+ extern int   DoTelnet __P((char *, int *, int));
+diff -up screen/src/help.c.ipv6 screen/src/help.c
+--- screen/src/help.c.ipv6     2010-11-11 03:47:46.000000000 +0100
++++ screen/src/help.c  2011-02-03 16:04:35.992744154 +0100
+@@ -66,6 +66,10 @@ char *myname, *message, *arg;
+ {
+   printf("Use: %s [-opts] [cmd [args]]\n", myname);
+   printf(" or: %s -r [host.tty]\n\nOptions:\n", myname);
++#ifdef BUILTIN_TELNET
++  printf("-4            Resolve hostnames only to IPv4 addresses.\n");
++  printf("-6            Resolve hostnames only to IPv6 addresses.\n");
++#endif
+   printf("-a            Force all capabilities into each window's termcap.\n");
+   printf("-A -[r|R]     Adapt all windows to the new display width & height.\n");
+   printf("-c file       Read configuration file instead of '.screenrc'.\n");
+diff -up screen/src/screen.c.ipv6 screen/src/screen.c
+--- screen/src/screen.c.ipv6   2010-11-11 03:47:46.000000000 +0100
++++ screen/src/screen.c        2011-02-03 16:04:35.994743798 +0100
+@@ -248,8 +248,9 @@ struct layer *flayer;
+ struct win *fore;
+ struct win *windows;
+ struct win *console_window;
+-
+-
++#ifdef BUILTIN_TELNET
++int af;
++#endif
+ /*
+  * Do this last
+@@ -507,6 +508,9 @@ char **av;
+   nwin = nwin_undef;
+   nwin_options = nwin_undef;
+   strcpy(screenterm, "screen");
++#ifdef BUILTIN_TELNET
++  af = AF_UNSPEC;
++#endif
+   logreopen_register(lf_secreopen);
+@@ -541,6 +545,14 @@ char **av;
+           {
+             switch (*ap)
+               {
++#ifdef BUILTIN_TELNET
++               case '4':
++                 af = AF_INET;
++                 break;
++               case '6':
++                 af = AF_INET6;
++                 break;
++#endif
+               case 'a':
+                 nwin_options.aflag = 1;
+                 break;
+diff -up screen/src/teln.c.ipv6 screen/src/teln.c
+--- screen/src/teln.c.ipv6     2010-11-11 03:47:46.000000000 +0100
++++ screen/src/teln.c  2011-02-03 16:04:35.992744154 +0100
+@@ -30,6 +30,7 @@
+ #include <sys/socket.h>
+ #include <fcntl.h>
+ #include <netdb.h>
++#include <stdio.h>
+ #include "config.h"
+@@ -42,12 +43,13 @@ extern struct win *fore;
+ extern struct layer *flayer;
+ extern int visual_bell;
+ extern char screenterm[];
++extern int af;
+ static void TelReply __P((struct win *, char *, int));
+ static void TelDocmd __P((struct win *, int, int));
+ static void TelDosub __P((struct win *));
+-
+-#define TEL_DEFPORT   23
++// why TEL_DEFPORT has "
++#define TEL_DEFPORT   "23"
+ #define TEL_CONNECTING        (-2)
+ #define TC_IAC          255
+@@ -105,86 +107,78 @@ char *data;
+ }
+ int
+-TelOpen(args)
+-char **args;
+-{
+-  int fd;
+-  int on = 1;
+-
+-  if ((fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1)
+-    {
+-      Msg(errno, "TelOpen: socket");
+-      return -1;
+-    }
+-  if (setsockopt(fd, SOL_SOCKET, SO_OOBINLINE, (char *)&on, sizeof(on)))
+-    Msg(errno, "TelOpen: setsockopt SO_OOBINLINE");
+-  return fd;
+-}
+-
+-int
+-TelConnect(p)
+-struct win *p;
+-{
+-  int port = TEL_DEFPORT;
+-  struct hostent *hp;
+-  char **args;
++TelOpenAndConnect(struct win *p) {
++  int fd, on = 1;
+   char buf[256];
+-  args = p->w_cmdargs + 1;
+-
+-  if (!*args)
+-    {
+-      Msg(0, "Usage: screen //telnet host [port]");
+-      return -1;
+-    }
+-  if (args[1])
+-    port = atoi(args[1]);
+-  p->w_telsa.sin_family = AF_INET;
+-  if((p->w_telsa.sin_addr.s_addr = inet_addr(*args)) == -1)
+-    {
+-      if ((hp = gethostbyname(*args)) == NULL)
+-        {
+-        Msg(0, "unknown host: %s", *args);
+-        return -1;
+-        }
+-      if (hp->h_length != sizeof(p->w_telsa.sin_addr.s_addr) || hp->h_addrtype != AF_INET)
+-      {
+-        Msg(0, "Bad address type for %s", hp->h_name);
+-        return -1;
+-      }
+-      bcopy((char *)hp->h_addr,(char *)&p->w_telsa.sin_addr.s_addr, hp->h_length);
+-      p->w_telsa.sin_family = hp->h_addrtype;
+-    }
+-  p->w_telsa.sin_port = htons(port);
+-  if (port != TEL_DEFPORT)
+-    sprintf(buf, "Trying %s %d...", inet_ntoa(p->w_telsa.sin_addr), port);
+-  else
+-    sprintf(buf, "Trying %s...", inet_ntoa(p->w_telsa.sin_addr));
+-  WriteString(p, buf, strlen(buf));
+-  if (connect(p->w_ptyfd, (struct sockaddr *)&p->w_telsa, sizeof(p->w_telsa)))
+-    {
+-      if (errno == EINPROGRESS)
+-        {
+-        p->w_telstate = TEL_CONNECTING;
+-        p->w_telconnev.fd = p->w_ptyfd;
+-        p->w_telconnev.handler = tel_connev_fn;
+-        p->w_telconnev.data = (char *)p;
+-        p->w_telconnev.type = EV_WRITE;
+-        p->w_telconnev.pri = 1;
+-        debug("telnet connect in progress...\n");
+-        evenq(&p->w_telconnev);
+-      }
+-      else
+-        {
+-        Msg(errno, "TelOpen: connect");
+-        return -1;
+-      }
+-    }
+-  else
+-    WriteString(p, "connected.\r\n", 12);
+-  if (port == TEL_DEFPORT)
+-    TelReply(p, (char *)tn_init, sizeof(tn_init));
+-  return 0;
++  struct addrinfo hints, *res0, *res;
++
++  if (!(p->w_cmdargs[1])) {
++    Msg(0, "Usage: screen //telnet host [port]");
++    return -1;
++  }
++
++  memset(&hints, 0, sizeof(hints));
++  hints.ai_family = af;
++  hints.ai_socktype = SOCK_STREAM;
++  hints.ai_protocol = IPPROTO_TCP;
++  if(getaddrinfo(p->w_cmdargs[1], p->w_cmdargs[2] ? p->w_cmdargs[2] : TEL_DEFPORT,
++                 &hints, &res0)) {
++     Msg(0, "unknown host: %s", p->w_cmdargs[1]);
++     return -1;
++  }
++
++  for(res = res0; res; res = res->ai_next) {
++    if((fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) == -1) {
++      if(res->ai_next)
++        continue;
++      else {
++        Msg(errno, "TelOpenAndConnect: socket");
++        freeaddrinfo(res0);
++        return -1;
++      }
++    }
++
++    if (setsockopt(fd, SOL_SOCKET, SO_OOBINLINE, (char *)&on, sizeof(on)))
++      Msg(errno, "TelOpenAndConnect: setsockopt SO_OOBINLINE");
++
++    if (p->w_cmdargs[2] && strcmp(p->w_cmdargs[2], TEL_DEFPORT))
++      snprintf(buf, 256, "Trying %s %s...", p->w_cmdargs[1], p->w_cmdargs[2]);
++    else
++      snprintf(buf, 256, "Trying %s...", p->w_cmdargs[1]);
++    WriteString(p, buf, strlen(buf));
++    if (connect(fd, res->ai_addr, res->ai_addrlen)) {
++      if (errno == EINPROGRESS) {
++       p->w_telstate = TEL_CONNECTING;
++       p->w_telconnev.fd = fd;
++       p->w_telconnev.handler = tel_connev_fn;
++       p->w_telconnev.data = (char *)p;
++       p->w_telconnev.type = EV_WRITE;
++       p->w_telconnev.pri = 1;
++       debug("telnet connect in progress...\n");
++       evenq(&p->w_telconnev);
++      }
++      else {
++        close(fd);
++       if(res->ai_next)
++         continue;
++       else {
++          Msg(errno, "TelOpenAndConnect: connect");
++          freeaddrinfo(res0);
++          return -1;
++       }
++      }
++    }
++    else
++      WriteString(p, "connected.\r\n", 12);
++    if (!(p->w_cmdargs[2] && strcmp(p->w_cmdargs[2], TEL_DEFPORT)))
++      TelReply(p, (char *)tn_init, sizeof(tn_init));
++    p->w_ptyfd = fd;
++    memcpy(&p->w_telsa, &res->ai_addr, sizeof(res->ai_addr));
++    freeaddrinfo(res0);
++    return 0;
++  }
++  return -1;
+ }
+ int
+diff -up screen/src/window.c.ipv6 screen/src/window.c
+--- screen/src/window.c.ipv6   2010-11-11 03:47:46.000000000 +0100
++++ screen/src/window.c        2011-02-03 16:30:56.900750293 +0100
+@@ -605,6 +605,13 @@ struct NewWindow *newwin;
+   n = pp - wtab;
+   debug1("Makewin creating %d\n", n);
++#ifdef BUILTIN_TELNET
++  if(!strcmp(nwin.args[0], "//telnet")) {
++         type = W_TYPE_TELNET;
++         TtyName = "telnet";
++  }
++  else
++#endif
+   if ((f = OpenDevice(nwin.args, nwin.lflag, &type, &TtyName)) < 0)
+     return -1;
+   if (type == W_TYPE_GROUP)
+@@ -766,7 +773,7 @@ struct NewWindow *newwin;
+ #ifdef BUILTIN_TELNET
+   if (type == W_TYPE_TELNET)
+     {
+-      if (TelConnect(p))
++      if (TelOpenAndConnect(p))
+       {
+         FreeWindow(p);
+         return -1;
+@@ -878,6 +885,13 @@ struct win *p;
+   int lflag, f;
+   lflag = nwin_default.lflag;
++#ifdef BUILTIN_TELNET
++  if(!strcmp(p->w_cmdargs[0], "//telnet")) {
++         p->w_type = W_TYPE_TELNET;
++         TtyName = "telnet";
++  }
++  else
++#endif
+   if ((f = OpenDevice(p->w_cmdargs, lflag, &p->w_type, &TtyName)) < 0)
+     return -1;
+@@ -909,7 +923,7 @@ struct win *p;
+ #ifdef BUILTIN_TELNET
+   if (p->w_type == W_TYPE_TELNET)
+     {
+-      if (TelConnect(p))
++      if (TelOpenAndConnect(p))
+         return -1;
+     }
+   else
+@@ -1068,16 +1082,6 @@ char **namep;
+       *namep = "telnet";
+       return 0;
+     }
+-#ifdef BUILTIN_TELNET
+-  if (strcmp(arg, "//telnet") == 0)
+-    {
+-      f = TelOpen(args + 1);
+-      lflag = 0;
+-      *typep = W_TYPE_TELNET;
+-      *namep = "telnet";
+-    }
+-  else
+-#endif
+   if (strncmp(arg, "//", 2) == 0)
+     {
+       Msg(0, "Invalid argument '%s'", arg);
+diff -up screen/src/window.h.ipv6 screen/src/window.h
+--- screen/src/window.h.ipv6   2010-11-11 03:47:46.000000000 +0100
++++ screen/src/window.h        2011-02-03 16:04:35.989744687 +0100
+@@ -268,7 +268,7 @@ struct win
+   struct display *w_zdisplay;
+ #endif
+ #ifdef BUILTIN_TELNET
+-  struct sockaddr_in w_telsa;
++  struct sockaddr_storage w_telsa;
+   char   w_telbuf[IOSIZE];
+   int    w_telbufl;
+   char   w_telmopts[256];
index 9d23c757c19dcfbe5c2af7965da2db1b4716df36..9bd6bc52a692fd23b6c5188dfa22a1f5236527f9 100644 (file)
@@ -20,11 +20,11 @@ Summary(uk.UTF-8):  Менеджер екрану, що підтримує кіл
 Name:          screen
 # 4.0 stable is on SCREEN_4_0 brach
 Version:       4.1.0
-Release:       1.4
+Release:       1.5
 License:       GPL v3+
 Group:         Applications/Terminal
-Source0:       http://git.savannah.gnu.org/cgit/screen.git/snapshot/%{name}-c64f800e7b197e14433ac97be12f32385a27a04f.tar.gz
-# Source0-md5: 4318d917bdbf26a0e49532462cfa285b
+Source0:       http://git.savannah.gnu.org/cgit/screen.git/snapshot/%{name}-cbaa666d4f21988164068a38ac915f8b4f3c4da3.tar.gz
+# Source0-md5: 8acbe428e5d3071c20c3981183009b73
 Source1:       http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
 # Source1-md5: 236166e774cee788cf594b05dd1dd70d
 Source2:       %{name}.pamd
@@ -43,6 +43,9 @@ Patch11:      %{name}-inputline-size.patch
 Patch12:       %{name}-screenrc.patch
 Patch13:       %{name}-osc.patch
 Patch15:       %{name}-statusline-encoding.patch
+Patch16:       screen-ipv6.patch
+Patch17:       screen-E3.patch
+Patch18:       screen-4.1.0-suppress_remap.patch
 URL:           http://www.gnu.org/software/screen/
 BuildRequires: autoconf
 BuildRequires: automake
@@ -51,6 +54,7 @@ BuildRequires:        pam-devel
 BuildRequires: texinfo
 BuildRequires: utempter-devel
 Requires:      pam >= 0.77.3
+Requires:      systemd-units >= 38
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -127,6 +131,9 @@ mv screen-*/src/* .
 %patch12 -p1
 #%patch13 -p1 # my brain farted here, see if you have better luck
 %patch15 -p0
+%patch16 -p2
+%patch17 -p2
+%patch18 -p1
 
 %build
 %{__aclocal}
@@ -138,10 +145,11 @@ CFLAGS="%{rpmcflags} -DMAXWIN=256"
        --enable-pam \
        --enable-colors256 \
        --enable-rxvt_osc \
+       --enable-telnet \
        --with-sys-screenrc=/etc/screenrc \
        --with-pty-mode=0620 \
        --with-pty-group=5 \
-       --disable-socket-dir
+       --with-socket-dir="%{_localstatedir}/run/screen"
 
 %{__make} -j1
 
@@ -168,6 +176,16 @@ cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/pam.d/screen
 bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
 rm -f $RPM_BUILD_ROOT%{_mandir}/README.screen-non-english-man-pages
 
+# Create the socket dir
+install -d $RPM_BUILD_ROOT%{_localstatedir}/run/screen
+
+# And tell systemd to recreate it on start with tmpfs
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d
+cat <<EOF > $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/screen.conf
+# screen needs directory in /var/run
+d %{_localstatedir}/run/screen 0775 root screen
+EOF
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -182,6 +200,7 @@ rm -rf $RPM_BUILD_ROOT
 %doc NEWS README ChangeLog doc/{FAQ,README.DOTSCREEN} etc/screenrc
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/screenrc
 %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/*
+%{_sysconfdir}/tmpfiles.d/screen.conf
 %attr(755,root,root) %{_bindir}/screen
 %{_datadir}/screen
 %{_mandir}/man1/*
This page took 0.046564 seconds and 4 git commands to generate.