diff --git a/.gitignore b/.gitignore index 56d72f4..abca92d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ screen-4.0.3.tar.gz /screen-20110819git450e8f.tar.bz2 /screen-20120314git3c2946.tar.bz2 /screen-4.2.1.tar.gz +/screen-4.3.1.tar.gz diff --git a/screen-4.0.3-libs.patch b/screen-4.0.3-libs.patch deleted file mode 100644 index a548787..0000000 --- a/screen-4.0.3-libs.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff -up screen-4.0.3/configure.in.libs screen-4.0.3/configure.in ---- screen-4.0.3/configure.in.libs 2003-06-03 13:58:24.000000000 +0200 -+++ screen-4.0.3/configure.in 2008-02-26 13:58:29.000000000 +0100 -@@ -196,7 +196,9 @@ AC_EGREP_CPP(yes, - ], LIBS="$LIBS -lsocket -linet";seqptx=1) - - oldlibs="$LIBS" --LIBS="$LIBS -lelf" -+# Humm we don't actually need to link against libelf for linux -+#LIBS="$LIBS -lelf" -+LIBS="$LIBS" - AC_CHECKING(SVR4) - AC_TRY_LINK([#include - ],, -@@ -643,14 +645,10 @@ dnl - AC_CHECKING(for tgetent) - AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, - olibs="$LIBS" --LIBS="-lcurses $olibs" --AC_CHECKING(libcurses) -+LIBS="-ltinfo $olibs" -+AC_CHECKING(libtinfo) - AC_TRY_LINK(,[ --#ifdef __hpux --__sorry_hpux_libcurses_is_totally_broken_in_10_10(); --#else - tgetent((char *)0, (char *)0); --#endif - ],, - LIBS="-ltermcap $olibs" - AC_CHECKING(libtermcap) -@@ -666,7 +664,7 @@ AC_MSG_ERROR(!!! no tgetent - no screen) - AC_TRY_RUN([ - main() - { -- exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1); -+ return 1; - }], AC_NOTE(- you use the termcap database), - AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO)) - AC_CHECKING(ospeed) -@@ -864,9 +862,6 @@ fi - dnl - dnl **** loadav **** - dnl --AC_CHECKING(for libutil(s)) --test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils" --test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil" - - AC_CHECKING(getloadavg) - AC_TRY_LINK(,[getloadavg((double *)0, 0);], diff --git a/screen-4.0.3-screenrc.patch b/screen-4.0.3-screenrc.patch deleted file mode 100644 index 67e3698..0000000 --- a/screen-4.0.3-screenrc.patch +++ /dev/null @@ -1,157 +0,0 @@ -diff -up screen-4.0.3/etc/etcscreenrc.screenrc screen-4.0.3/etc/etcscreenrc ---- screen-4.0.3/etc/etcscreenrc.screenrc 2003-12-05 14:46:13.000000000 +0100 -+++ screen-4.0.3/etc/etcscreenrc 2009-09-25 14:20:31.000000000 +0200 -@@ -36,8 +36,8 @@ vbell_msg " Wuff ---- Wuff!! " - # IC insert multiple chars - # nx terminal uses xon/xoff - --termcap facit|vt100|xterm LP:G0 --terminfo facit|vt100|xterm LP:G0 -+termcap facit|vt100|xterm|xterm-* LP:G0 -+terminfo facit|vt100|xterm|xterm-* LP:G0 - - #the vt100 description does not mention "dl". *sigh* - termcap vt100 dl=5\E[M -@@ -55,15 +55,15 @@ terminfo sun 'up=^K:AL=\E[%p1%dL:DL=\E[% - #xterm understands both im/ic and doesn't have a status line. - #Note: Do not specify im and ic in the real termcap/info file as - #some programs (e.g. vi) will (no,no, may (jw)) not work anymore. --termcap xterm|fptwist hs@:cs=\E[%i%d;%dr:im=\E[4h:ei=\E[4l --terminfo xterm|fptwist hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l -+#termcap xterm|fptwist hs@:cs=\E[%i%d;%dr:im=\E[4h:ei=\E[4l -+#terminfo xterm|fptwist hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l - - # Long time I had this in my private screenrc file. But many people - # seem to want it (jw): - # we do not want the width to change to 80 characters on startup: - # on suns, /etc/termcap has :is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l: --termcap xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l' --terminfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l' -+#termcap xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l' -+#terminfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l' - - # - # Do not use xterms alternate window buffer. -diff -up screen-4.0.3/etc/screenrc.screenrc screen-4.0.3/etc/screenrc ---- screen-4.0.3/etc/screenrc.screenrc 2006-10-23 15:06:32.000000000 +0200 -+++ screen-4.0.3/etc/screenrc 2009-09-25 14:31:30.000000000 +0200 -@@ -1,21 +1,11 @@ --# --# Example of a user's .screenrc file --# -- - # This is how one can set a reattach password: - # password ODSJQf.4IJN7E # "1234" - --# no annoying audible bell, please --vbell on -- --# detach on hangup --autodetach on -- - # don't display the copyright page - startup_message off - - # emulate .logout message --pow_detach_msg "Screen session of \$LOGNAME \$:cr:\$:nl:ended." -+pow_detach_msg "Screen session of $LOGNAME $:cr:$:nl:ended." - - # advertise hardstatus support to $TERMCAP - # termcapinfo * '' 'hs:ts=\E_:fs=\E\\:ds=\E_\E\\' -@@ -40,18 +30,12 @@ defscrollback 1000 - - ################ - # --# xterm tweaks -+# more xterm tweaks - # - --#xterm understands both im/ic and doesn't have a status line. --#Note: Do not specify im and ic in the real termcap/info file as --#some programs (e.g. vi) will not work anymore. --termcap xterm hs@:cs=\E[%i%d;%dr:im=\E[4h:ei=\E[4l --terminfo xterm hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l -- - #80/132 column switching must be enabled for ^AW to work - #change init sequence to not switch width --termcapinfo xterm Z0=\E[?3h:Z1=\E[?3l:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l -+#termcapinfo xterm Z0=\E[?3h:Z1=\E[?3l:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l - - # Make the output buffer large for (fast) xterms. - #termcapinfo xterm* OL=10000 -@@ -59,18 +43,18 @@ termcapinfo xterm* OL=100 - - # tell screen that xterm can switch to dark background and has function - # keys. --termcapinfo xterm 'VR=\E[?5h:VN=\E[?5l' --termcapinfo xterm 'k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~' --termcapinfo xterm 'kh=\EOH:kI=\E[2~:kD=\E[3~:kH=\EOF:kP=\E[5~:kN=\E[6~' -+termcapinfo xterm|xterm-* 'VR=\E[?5h:VN=\E[?5l' -+#termcapinfo xterm 'k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~' -+#termcapinfo xterm 'kh=\EOH:kI=\E[2~:kD=\E[3~:kH=\EOF:kP=\E[5~:kN=\E[6~' - - # special xterm hardstatus: use the window title. --termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007' -+termcapinfo xterm|xterm-* 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007' - - #terminfo xterm 'vb=\E[?5h$<200/>\E[?5l' --termcapinfo xterm 'vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l' -+#termcapinfo xterm 'vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l' - - # emulate part of the 'K' charset --termcapinfo xterm 'XC=K%,%\E(B,[\304,\\\\\326,]\334,{\344,|\366,}\374,~\337' -+termcapinfo xterm|xterm-* 'XC=K%,%\E(B,[\304,\\\\\326,]\334,{\344,|\366,}\374,~\337' - - # xterm-52 tweaks: - # - uses background color for delete operations -@@ -103,32 +87,12 @@ termcapinfo linux C8 - # old rxvt versions also need this - # termcapinfo rxvt C8 - -- --################ --# --# keybindings --# -- --#remove some stupid / dangerous key bindings --bind k --bind ^k --bind . --bind ^\ --bind \\ --bind ^h --bind h --#make them better --bind 'K' kill --bind 'I' login on --bind 'O' login off --bind '}' history -- - # Yet another hack: - # Prepend/append register [/] to the paste if ^a^] is pressed. - # This lets me have autoindent mode in vi. --register [ "\033:se noai\015a" --register ] "\033:se ai\015a" --bind ^] paste [.] -+#register [ "\033:se noai\015a" -+#register ] "\033:se ai\015a" -+#bind ^] paste [.] - - ################ - # -@@ -140,9 +104,14 @@ bind ^] paste [.] - # screen -t 40 2 rlogin server - - # caption always "%3n %t%? @%u%?%? [%h]%?%=%c" -+## alternative caption, gives window list, LOGNAME and current date: -+# caption always "%{wk}%?%-Lw%?%{bw}%n*%f %t%?(%u)%?%{wk}%?%+Lw %=%{mk}@%H %{yk}%D %{ck}%M%{wk} %{ck}%d %{gk}%c" - # hardstatus alwaysignore - # hardstatus alwayslastline "%Lw" - -+# Red Hat's normal status line -+hardstatus string "[screen %n%?: %t%?] %h" -+ - # bind = resize = - # bind + resize +1 - # bind - resize -1 diff --git a/screen-4.1.0-suppress_remap.patch b/screen-4.1.0-suppress_remap.patch deleted file mode 100644 index 85109a2..0000000 --- a/screen-4.1.0-suppress_remap.patch +++ /dev/null @@ -1,13 +0,0 @@ -Author: Loic Minier -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-4.2.1-crypt.patch b/screen-4.2.1-crypt.patch deleted file mode 100644 index 63a1578..0000000 --- a/screen-4.2.1-crypt.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/misc.c b/misc.c -index 43e93a2..178fda9 100644 ---- a/misc.c -+++ b/misc.c -@@ -56,6 +56,8 @@ register const char *str; - { - register char *cp; - -+ if(str == NULL) -+ Panic(0, "SaveStr() received NULL - possibly failed crypt()"); - if ((cp = malloc(strlen(str) + 1)) == NULL) - Panic(0, "%s", strnomem); - else diff --git a/screen-4.3.1-crypt.patch b/screen-4.3.1-crypt.patch new file mode 100644 index 0000000..63a1578 --- /dev/null +++ b/screen-4.3.1-crypt.patch @@ -0,0 +1,13 @@ +diff --git a/misc.c b/misc.c +index 43e93a2..178fda9 100644 +--- a/misc.c ++++ b/misc.c +@@ -56,6 +56,8 @@ register const char *str; + { + register char *cp; + ++ if(str == NULL) ++ Panic(0, "SaveStr() received NULL - possibly failed crypt()"); + if ((cp = malloc(strlen(str) + 1)) == NULL) + Panic(0, "%s", strnomem); + else diff --git a/screen-4.3.1-libs.patch b/screen-4.3.1-libs.patch new file mode 100644 index 0000000..4d98da8 --- /dev/null +++ b/screen-4.3.1-libs.patch @@ -0,0 +1,50 @@ +diff --git a/configure.ac b/configure.ac +index ffe2e37..768f762 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -203,7 +203,8 @@ AC_EGREP_CPP(yes, + ], LIBS="$LIBS -lsocket -linet";seqptx=1) + + oldlibs="$LIBS" +-LIBS="$LIBS -lelf" ++# Humm we don't actually need to link against libelf for Linux ++LIBS="$LIBS" + AC_CHECKING(SVR4) + AC_TRY_LINK([#include + ],, +@@ -657,14 +658,10 @@ dnl + AC_CHECKING(for tgetent) + AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, + olibs="$LIBS" +-LIBS="-lcurses $olibs" +-AC_CHECKING(libcurses) ++LIBS="-ltinfo $olibs" ++AC_CHECKING(libtinfo) + AC_TRY_LINK(,[ +-#ifdef __hpux +-__sorry_hpux_libcurses_is_totally_broken_in_10_10(); +-#else + tgetent((char *)0, (char *)0); +-#endif + ],, + LIBS="-ltermcap $olibs" + AC_CHECKING(libtermcap) +@@ -689,7 +686,7 @@ AC_MSG_ERROR(!!! no tgetent - no screen))))))))) + AC_TRY_RUN([ + main() + { +- exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1); ++ return 1; + }], AC_NOTE(- you use the termcap database), + AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO)) + AC_CHECKING(ospeed) +@@ -887,9 +884,6 @@ fi + dnl + dnl **** loadav **** + dnl +-AC_CHECKING(for libutil(s)) +-test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils" +-test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil" + + AC_CHECKING(getloadavg) + AC_TRY_LINK(,[getloadavg((double *)0, 0);], diff --git a/screen-4.3.1-screenrc.patch b/screen-4.3.1-screenrc.patch new file mode 100644 index 0000000..67e3698 --- /dev/null +++ b/screen-4.3.1-screenrc.patch @@ -0,0 +1,157 @@ +diff -up screen-4.0.3/etc/etcscreenrc.screenrc screen-4.0.3/etc/etcscreenrc +--- screen-4.0.3/etc/etcscreenrc.screenrc 2003-12-05 14:46:13.000000000 +0100 ++++ screen-4.0.3/etc/etcscreenrc 2009-09-25 14:20:31.000000000 +0200 +@@ -36,8 +36,8 @@ vbell_msg " Wuff ---- Wuff!! " + # IC insert multiple chars + # nx terminal uses xon/xoff + +-termcap facit|vt100|xterm LP:G0 +-terminfo facit|vt100|xterm LP:G0 ++termcap facit|vt100|xterm|xterm-* LP:G0 ++terminfo facit|vt100|xterm|xterm-* LP:G0 + + #the vt100 description does not mention "dl". *sigh* + termcap vt100 dl=5\E[M +@@ -55,15 +55,15 @@ terminfo sun 'up=^K:AL=\E[%p1%dL:DL=\E[% + #xterm understands both im/ic and doesn't have a status line. + #Note: Do not specify im and ic in the real termcap/info file as + #some programs (e.g. vi) will (no,no, may (jw)) not work anymore. +-termcap xterm|fptwist hs@:cs=\E[%i%d;%dr:im=\E[4h:ei=\E[4l +-terminfo xterm|fptwist hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l ++#termcap xterm|fptwist hs@:cs=\E[%i%d;%dr:im=\E[4h:ei=\E[4l ++#terminfo xterm|fptwist hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l + + # Long time I had this in my private screenrc file. But many people + # seem to want it (jw): + # we do not want the width to change to 80 characters on startup: + # on suns, /etc/termcap has :is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l: +-termcap xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l' +-terminfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l' ++#termcap xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l' ++#terminfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l' + + # + # Do not use xterms alternate window buffer. +diff -up screen-4.0.3/etc/screenrc.screenrc screen-4.0.3/etc/screenrc +--- screen-4.0.3/etc/screenrc.screenrc 2006-10-23 15:06:32.000000000 +0200 ++++ screen-4.0.3/etc/screenrc 2009-09-25 14:31:30.000000000 +0200 +@@ -1,21 +1,11 @@ +-# +-# Example of a user's .screenrc file +-# +- + # This is how one can set a reattach password: + # password ODSJQf.4IJN7E # "1234" + +-# no annoying audible bell, please +-vbell on +- +-# detach on hangup +-autodetach on +- + # don't display the copyright page + startup_message off + + # emulate .logout message +-pow_detach_msg "Screen session of \$LOGNAME \$:cr:\$:nl:ended." ++pow_detach_msg "Screen session of $LOGNAME $:cr:$:nl:ended." + + # advertise hardstatus support to $TERMCAP + # termcapinfo * '' 'hs:ts=\E_:fs=\E\\:ds=\E_\E\\' +@@ -40,18 +30,12 @@ defscrollback 1000 + + ################ + # +-# xterm tweaks ++# more xterm tweaks + # + +-#xterm understands both im/ic and doesn't have a status line. +-#Note: Do not specify im and ic in the real termcap/info file as +-#some programs (e.g. vi) will not work anymore. +-termcap xterm hs@:cs=\E[%i%d;%dr:im=\E[4h:ei=\E[4l +-terminfo xterm hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l +- + #80/132 column switching must be enabled for ^AW to work + #change init sequence to not switch width +-termcapinfo xterm Z0=\E[?3h:Z1=\E[?3l:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l ++#termcapinfo xterm Z0=\E[?3h:Z1=\E[?3l:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l + + # Make the output buffer large for (fast) xterms. + #termcapinfo xterm* OL=10000 +@@ -59,18 +43,18 @@ termcapinfo xterm* OL=100 + + # tell screen that xterm can switch to dark background and has function + # keys. +-termcapinfo xterm 'VR=\E[?5h:VN=\E[?5l' +-termcapinfo xterm 'k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~' +-termcapinfo xterm 'kh=\EOH:kI=\E[2~:kD=\E[3~:kH=\EOF:kP=\E[5~:kN=\E[6~' ++termcapinfo xterm|xterm-* 'VR=\E[?5h:VN=\E[?5l' ++#termcapinfo xterm 'k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~' ++#termcapinfo xterm 'kh=\EOH:kI=\E[2~:kD=\E[3~:kH=\EOF:kP=\E[5~:kN=\E[6~' + + # special xterm hardstatus: use the window title. +-termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007' ++termcapinfo xterm|xterm-* 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007' + + #terminfo xterm 'vb=\E[?5h$<200/>\E[?5l' +-termcapinfo xterm 'vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l' ++#termcapinfo xterm 'vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l' + + # emulate part of the 'K' charset +-termcapinfo xterm 'XC=K%,%\E(B,[\304,\\\\\326,]\334,{\344,|\366,}\374,~\337' ++termcapinfo xterm|xterm-* 'XC=K%,%\E(B,[\304,\\\\\326,]\334,{\344,|\366,}\374,~\337' + + # xterm-52 tweaks: + # - uses background color for delete operations +@@ -103,32 +87,12 @@ termcapinfo linux C8 + # old rxvt versions also need this + # termcapinfo rxvt C8 + +- +-################ +-# +-# keybindings +-# +- +-#remove some stupid / dangerous key bindings +-bind k +-bind ^k +-bind . +-bind ^\ +-bind \\ +-bind ^h +-bind h +-#make them better +-bind 'K' kill +-bind 'I' login on +-bind 'O' login off +-bind '}' history +- + # Yet another hack: + # Prepend/append register [/] to the paste if ^a^] is pressed. + # This lets me have autoindent mode in vi. +-register [ "\033:se noai\015a" +-register ] "\033:se ai\015a" +-bind ^] paste [.] ++#register [ "\033:se noai\015a" ++#register ] "\033:se ai\015a" ++#bind ^] paste [.] + + ################ + # +@@ -140,9 +104,14 @@ bind ^] paste [.] + # screen -t 40 2 rlogin server + + # caption always "%3n %t%? @%u%?%? [%h]%?%=%c" ++## alternative caption, gives window list, LOGNAME and current date: ++# caption always "%{wk}%?%-Lw%?%{bw}%n*%f %t%?(%u)%?%{wk}%?%+Lw %=%{mk}@%H %{yk}%D %{ck}%M%{wk} %{ck}%d %{gk}%c" + # hardstatus alwaysignore + # hardstatus alwayslastline "%Lw" + ++# Red Hat's normal status line ++hardstatus string "[screen %n%?: %t%?] %h" ++ + # bind = resize = + # bind + resize +1 + # bind - resize -1 diff --git a/screen-4.3.1-suppress_remap.patch b/screen-4.3.1-suppress_remap.patch new file mode 100644 index 0000000..85109a2 --- /dev/null +++ b/screen-4.3.1-suppress_remap.patch @@ -0,0 +1,13 @@ +Author: Loic Minier +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-ipv6.patch b/screen-ipv6.patch deleted file mode 100644 index 176b310..0000000 --- a/screen-ipv6.patch +++ /dev/null @@ -1,348 +0,0 @@ -diff --git a/doc/screen.1 b/doc/screen.1 -index fd5c06e..3703596 100644 ---- a/doc/screen.1 -+++ b/doc/screen.1 -@@ -403,6 +403,13 @@ several screen sessions running. You can use the \fB-d\fP or - \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 --git a/extern.h b/extern.h -index a3e3ca2..9b564e6 100644 ---- a/extern.h -+++ b/extern.h -@@ -459,8 +459,7 @@ extern void LayProcessMouseSwitch __P((struct layer *, int)); - - /* 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 --git a/help.c b/help.c -index 8446f34..a2b8614 100644 ---- a/help.c -+++ b/help.c -@@ -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 --git a/screen.c b/screen.c -index 473e4fa..c193f46 100644 ---- a/screen.c -+++ b/screen.c -@@ -250,6 +250,10 @@ struct win *windows; - struct win *console_window; - - -+#ifdef BUILTIN_TELNET -+int af; -+#endif -+ - - /* - * Do this last -@@ -507,6 +511,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 +548,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 --git a/teln.c b/teln.c -index 1764dbc..5f0cb0b 100644 ---- a/teln.c -+++ b/teln.c -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - - #include "config.h" - -@@ -42,12 +43,14 @@ 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 +108,76 @@ 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; -+ struct addrinfo hints, *res0, *res; - char buf[256]; - -- args = p->w_cmdargs + 1; -- -- if (!*args) -- { -- Msg(0, "Usage: screen //telnet host [port]"); -- return -1; -+ 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 (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; -- } -+ 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 (port == TEL_DEFPORT) -- TelReply(p, (char *)tn_init, sizeof(tn_init)); -- return 0; -+ 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 --git a/window.c b/window.c -index c9d6817..2ad6041 100644 ---- a/window.c -+++ b/window.c -@@ -610,6 +610,13 @@ struct NewWindow *newwin; - #endif - 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; -@@ -772,7 +779,7 @@ struct NewWindow *newwin; - #ifdef BUILTIN_TELNET - if (type == W_TYPE_TELNET) - { -- if (TelConnect(p)) -+ if (TelOpenAndConnect(p)) - { - FreeWindow(p); - return -1; -@@ -884,6 +891,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; - -@@ -917,7 +931,7 @@ struct win *p; - #ifdef BUILTIN_TELNET - if (p->w_type == W_TYPE_TELNET) - { -- if (TelConnect(p)) -+ if (TelOpenAndConnect(p)) - return -1; - } - else -@@ -1076,16 +1090,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 --git a/window.h b/window.h -index 7311ecb..7fc7c72 100644 ---- a/window.h -+++ b/window.h -@@ -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]; diff --git a/screen.spec b/screen.spec index ce4f91a..f38a97b 100644 --- a/screen.spec +++ b/screen.spec @@ -1,34 +1,30 @@ %bcond_with multiuser %global _hardened_build 1 -Summary: A screen manager that supports multiple logins on one terminal -Name: screen -Version: 4.2.1 -Release: 6%{?dist} -License: GPLv2+ -Group: Applications/System -URL: http://www.gnu.org/software/screen -Requires(pre): /usr/sbin/groupadd +Summary: A screen manager that supports multiple logins on one terminal +Name: screen +Version: 4.3.1 +Release: 1%{?dist} +License: GPLv2+ +Group: Applications/System +URL: http://www.gnu.org/software/screen +Requires(pre): /usr/sbin/groupadd Requires(preun): /sbin/install-info Requires(post): /sbin/install-info -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: ncurses-devel pam-devel libutempter-devel autoconf texinfo -BuildRequires: automake +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: ncurses-devel pam-devel libutempter-devel autoconf texinfo +BuildRequires: automake # for %%_tmpfilesdir macro -BuildRequires: systemd +BuildRequires: systemd -#Source0: ftp://ftp.uni-erlangen.de/pub/utilities/screen/screen-%{version}.tar.gz -# snapshot from git://git.savannah.gnu.org/screen.git -Source0: screen-4.2.1.tar.gz -Source1: screen.pam +Source0: ftp://ftp.gnu.org/gnu/screen/screen-%{version}.tar.gz +Source1: screen.pam -Patch1: screen-4.0.3-libs.patch -Patch2: screen-4.0.3-screenrc.patch -Patch3: screen-ipv6.patch -Patch4: screen-E3.patch -Patch5: screen-4.1.0-suppress_remap.patch -Patch6: screen-4.2.1-crypt.patch -Patch7: screen-altscreen.patch +Patch1: screen-4.3.1-libs.patch +Patch2: screen-4.3.1-screenrc.patch +Patch3: screen-E3.patch +Patch4: screen-4.3.1-suppress_remap.patch +Patch5: screen-4.3.1-crypt.patch %description The screen utility allows you to have multiple logins on just one @@ -44,11 +40,9 @@ support multiple logins on one terminal. %setup -q -n %{name}-%{version} %patch1 -p1 -b .libs %patch2 -p1 -b .screenrc -%patch3 -p1 -b .ipv6 -%patch4 -p1 -b .E3 -%patch5 -p1 -b .suppress_remap -%patch6 -p1 -b .crypto -%patch7 -p1 -b .altscreen.patch +%patch3 -p1 -b .E3 +%patch4 -p1 -b .suppress_remap +%patch5 -p1 -b .crypto %build @@ -145,6 +139,9 @@ fi %endif %changelog +* Tue Jun 30 2015 Petr Hracek - 4.3.1-1 +- New upstream version 4.3.1 (#1237109) + * Fri Jun 19 2015 Fedora Release Engineering - 4.2.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild diff --git a/sources b/sources index 3d5e947..aaeb383 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -419a0594e2b25039239af8b90eda7d92 screen-4.2.1.tar.gz +5bb3b0ff2674e29378c31ad3411170ad screen-4.3.1.tar.gz