diff options
author | Jan Christoph Nordholz <hesso@pool.math.tu-berlin.de> | 2008-04-27 14:34:00 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2011-09-03 14:05:33 +0200 |
commit | ce48b67ab5653418387f3f24bd61c7730ffbc614 (patch) | |
tree | 7e3ffc56cce8c38f353d5b03530f19ad3593a69d | |
parent | 2bba75d842fea979a467751cdc6eb60364605964 (diff) | |
download | screen-ce48b67ab5653418387f3f24bd61c7730ffbc614.tar.gz |
Imported Debian patch 4.0.3-9debian/4.0.3-9
-rw-r--r-- | debian/changelog | 15 | ||||
-rw-r--r-- | debian/init | 6 | ||||
-rw-r--r-- | debian/patches/00list | 5 | ||||
-rw-r--r-- | debian/patches/10norootpassword.dpatch (renamed from debian/patches/07norootpassword.dpatch) | 2 | ||||
-rw-r--r-- | debian/patches/16fix_gcc_warnings.dpatch | 55 | ||||
-rw-r--r-- | debian/patches/50EXP_tilde_expansion.dpatch | 141 | ||||
-rw-r--r-- | debian/patches/51EXP_session_creation_time.dpatch | 53 |
7 files changed, 217 insertions, 60 deletions
diff --git a/debian/changelog b/debian/changelog index 44010c4..d7e2080 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,18 @@ +screen (4.0.3-9) unstable; urgency=low + + * The "I broke it, I fix it" release. + * Fix a race condition that made session resumption difficult if there + was only one. Closes: #477739. + * Enhance dpatch 16fix_gcc_warnings (buildlog is now free of warnings). + * Apply initscript LSB header changes as suggested by Kel Modderman - + thanks! Closes: #477779. + * Extend the tilde expansion patch to also apply to 'chdir' commands. + Thanks to Steve Kemp! Closes: #477210. + * Document my dpatch numbering style in 00list (and move one patch to + make things fit again). + + -- Jan Christoph Nordholz <hesso@pool.math.tu-berlin.de> Sun, 27 Apr 2008 14:34:00 +0200 + screen (4.0.3-8) unstable; urgency=low * The "resuming the bughunt" release. diff --git a/debian/init b/debian/init index 98ecd86..cee268e 100644 --- a/debian/init +++ b/debian/init @@ -6,9 +6,9 @@ ### BEGIN INIT INFO # Provides: screen-cleanup -# Required-Start: $local_fs $remote_fs -# Required-Stop: $local_fs $remote_fs -# Default-Start: 2 3 4 5 +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: S # Default-Stop: # Short-Description: screen sessions cleaning ### END INIT INFO diff --git a/debian/patches/00list b/debian/patches/00list index a1d37ef..7fc35a9 100644 --- a/debian/patches/00list +++ b/debian/patches/00list @@ -1,10 +1,12 @@ +# 00-09: fixes to configure, altering preprocessor macros etc. 01configure_fix_alpha_vsprintf 02configure_use_ncursesw 03fully_expand_screenencodings 04AUTOCONF 05fix_osdef_include 06replace_linux_feature_macro -07norootpassword +# 10-49: "regular" code and documentation fixes +10norootpassword 11replace_doc_paths 12fix_texinfo_syntax 13split_info_files @@ -25,5 +27,6 @@ 28blankerprg_callsemantics 30fix_fsf_address 40cjk_eastasian +# 50-99: experimental patches, new features etc. 50EXP_tilde_expansion 51EXP_session_creation_time diff --git a/debian/patches/07norootpassword.dpatch b/debian/patches/10norootpassword.dpatch index 1d90afc..6605bb0 100644 --- a/debian/patches/07norootpassword.dpatch +++ b/debian/patches/10norootpassword.dpatch @@ -1,5 +1,5 @@ #! /bin/sh /usr/share/dpatch/dpatch-run -## 07_norootpassword.dpatch by Martin Pitt <martin.pitt@ubuntu.com> +## 10norootpassword.dpatch by Martin Pitt <martin.pitt@ubuntu.com> ## ## DP: When locking a root-owned screen, check that root has a ## DP: password set. If not, ask for an unlocking key. diff --git a/debian/patches/16fix_gcc_warnings.dpatch b/debian/patches/16fix_gcc_warnings.dpatch index 67f35e9..422ee2e 100644 --- a/debian/patches/16fix_gcc_warnings.dpatch +++ b/debian/patches/16fix_gcc_warnings.dpatch @@ -1,7 +1,7 @@ #! /bin/sh /usr/share/dpatch/dpatch-run ## 16fix_gcc_warnings.dpatch by <hesso@pool.math.tu-berlin.de> ## -## DP: Fix a few typos in the documentation. +## DP: Get rid of several minor gcc warnings. --- screen-4.0.3.orig/fileio.c 2007-07-31 01:07:32.000000000 +0200 +++ screen-4.0.3/fileio.c 2007-07-31 01:07:41.000000000 +0200 @@ -25,3 +25,56 @@ struct mline *ol; { struct canvas *cv; +--- screen-4.0.3.orig/process.c 2008-04-26 21:21:48.000000000 +0000 ++++ screen-4.0.3/process.c 2008-04-26 21:48:04.000000000 +0000 +@@ -3049,7 +3049,7 @@ + int newnr, fl = 0, kf = 0, af = 0, df = 0, mf = 0; + struct display *odisp = display; + int used = 0; +- struct kmap_ext *kme; ++ struct kmap_ext *kme = 0; + + for (; *args && **args == '-'; args++, argl++) + { +@@ -5466,7 +5466,7 @@ + *buf = 0; + return; + } +- act.nr = (int)data; ++ act.nr = (intptr_t)data; + act.args = noargs; + act.argl = 0; + DoAction(&act, -1); +--- screen-4.0.3.orig/attacher.c 2008-04-26 21:21:45.000000000 +0000 ++++ screen-4.0.3/attacher.c 2008-04-26 21:36:27.000000000 +0000 +@@ -807,7 +807,7 @@ + pam_handle_t *pamh = 0; + int pam_error; + #endif +- char *pass, mypass[16 + 1], salt[3]; ++ char *pass = 0, mypass[16 + 1], salt[3]; + int using_pam = 1; + + #ifdef USE_PAM +--- screen-4.0.3.orig/screen.c 2008-04-26 21:21:39.000000000 +0000 ++++ screen-4.0.3/screen.c 2008-04-26 21:23:37.000000000 +0000 +@@ -2301,7 +2301,7 @@ + int truncpos = -1; + int truncper = 0; + int trunclong = 0; +- struct backtick *bt; ++ struct backtick *bt = 0; + + if (winmsg_numrend >= 0) + winmsg_numrend = 0; +--- screen-4.0.3.orig/utmp.c 2008-04-26 21:51:18.000000000 +0000 ++++ screen-4.0.3/utmp.c 2008-04-26 21:51:46.000000000 +0000 +@@ -618,7 +618,7 @@ + #endif /* sgi */ + strncpy(u->ut_line, line, sizeof(u->ut_line)); + u->ut_pid = pid; +- (void)time((time_t *)&u->ut_time); ++ u->ut_time = time(0); + } + + static slot_t diff --git a/debian/patches/50EXP_tilde_expansion.dpatch b/debian/patches/50EXP_tilde_expansion.dpatch index e0a57a0..4a19620 100644 --- a/debian/patches/50EXP_tilde_expansion.dpatch +++ b/debian/patches/50EXP_tilde_expansion.dpatch @@ -1,11 +1,25 @@ #! /bin/sh /usr/share/dpatch/dpatch-run ## 50EXP_tilde_expansion.dpatch by <hesso@pool.math.tu-berlin.de> ## -## DP: Add full tilde expansion to the builtin 'source' command. +## DP: Add full tilde expansion to the builtin commands 'source' +## DP: and 'chdir'. Thanks to Nico Golde (#308818) and Steve Kemp +## DP: (#477210) for patch suggestions. @DPATCH@ ---- screen-4.0.3.orig/fileio.c 2007-08-06 19:26:00.000000000 +0200 -+++ screen-4.0.3/fileio.c 2007-08-06 19:25:42.000000000 +0200 +diff -Nau screen-4.0.3.orig/extern.h screen-4.0.3/extern.h +--- screen-4.0.3.orig/extern.h 2008-04-27 02:37:32.000000000 +0200 ++++ screen-4.0.3/extern.h 2008-04-27 02:31:59.000000000 +0200 +@@ -65,6 +65,7 @@ + extern int MFindUsedLine __P((struct win *, int, int)); + + /* fileio.c */ ++extern char *ExpandFilename __P((const char *)); + extern void StartRc __P((char *)); + extern void FinishRc __P((char *)); + extern void RcLine __P((char *, int)); +diff -Nau screen-4.0.3.orig/fileio.c screen-4.0.3/fileio.c +--- screen-4.0.3.orig/fileio.c 2008-04-27 02:37:35.000000000 +0200 ++++ screen-4.0.3/fileio.c 2008-04-27 02:35:29.000000000 +0200 @@ -24,6 +24,7 @@ #include <sys/types.h> #include <fcntl.h> @@ -14,54 +28,99 @@ #ifndef SIGINT # include <signal.h> -@@ -296,9 +297,47 @@ - Msg(0, "%s: source: recursion limit reached", rc_name); - return; - } -- rc_recursion++; -- FinishRc(rcfilename); -- rc_recursion--; -+ if (*rcfilename == '~') +@@ -87,6 +88,56 @@ + return cp; + } + ++/** ++ * Private simple tilde expansion function, to avoid pulling in ++ * libreadline or similar monster libraries. ++ * ++ * Note: We are applying a conservative match on usernames here. ++ * Jan Nordholz <hesso@pool.math.tu-berlin.de>, 2008/04/27 ++ */ ++char * ++ExpandFilename(fn) ++const char *fn; ++{ ++ char *ret = 0; ++ ++ ret = malloc(MAXPATHLEN + 1); ++ snprintf(ret, MAXPATHLEN, "%s", fn); ++ ++ if (*fn == '~') + { -+ char rcfilename_tilde_exp[MAXPATHLEN+1]; -+ char *slash_position = strchr(rcfilename, '/'); -+ if (slash_position == rcfilename+1) ++ int userlen = strspn(fn+1, "abcdefghijklmnopqrstuvwxyz0123456789-_"); ++ if (!userlen) + { -+ char *home = getenv("HOME"); -+ if (!home) ++ if (home && *home) + { -+ Msg(0, "%s: source: tilde expansion failed", rc_name); -+ return; ++ snprintf(ret, MAXPATHLEN, "%s%s", home, fn+1+userlen); ++ } ++ else ++ { ++ Msg(0, "%s: source: tilde expansion failed.", rc_name); + } -+ snprintf(rcfilename_tilde_exp, MAXPATHLEN, "%s/%s", home, rcfilename+2); + } -+ else if (slash_position) ++ else + { + struct passwd *p; -+ *slash_position = 0; -+ p = getpwnam(rcfilename+1); -+ if (!p) ++ ret[userlen+1] = 0; ++ p = getpwnam(ret+1); ++ ret[userlen+1] = fn[userlen+1]; ++ if (p && p->pw_dir) + { -+ Msg(0, "%s: source: tilde expansion failed for user %s", rc_name, rcfilename+1); -+ return; ++ snprintf(ret, MAXPATHLEN, "%s%s", p->pw_dir, fn+1+userlen); ++ } ++ else ++ { ++ Msg(0, "%s: source: tilde expansion failed.", rc_name); + } -+ snprintf(rcfilename_tilde_exp, MAXPATHLEN, "%s/%s", p->pw_dir, slash_position+1); -+ } -+ else -+ { -+ Msg(0, "%s: source: illegal tilde expression.", rc_name); -+ return; + } -+ rc_recursion++; -+ FinishRc(rcfilename_tilde_exp); -+ rc_recursion--; -+ } -+ else -+ { -+ rc_recursion++; -+ FinishRc(rcfilename); -+ rc_recursion--; + } ++ ++ return ret; ++} ++ + static char * + findrcfile(rcfile) + char *rcfile; +@@ -291,17 +342,21 @@ + do_source(rcfilename) + char *rcfilename; + { ++ char *expanded_rcfilename; ++ + if (rc_recursion > 10) + { + Msg(0, "%s: source: recursion limit reached", rc_name); + return; + } ++ + rc_recursion++; +- FinishRc(rcfilename); ++ expanded_rcfilename = ExpandFilename(rcfilename); ++ FinishRc(expanded_rcfilename); ++ free(expanded_rcfilename); + rc_recursion--; } - +- + /* + * Running a Command Line in the environment determined by the display. + * The fore window is taken from the display as well as the user. +diff -Nau screen-4.0.3.orig/process.c screen-4.0.3/process.c +--- screen-4.0.3.orig/process.c 2008-04-27 02:37:35.000000000 +0200 ++++ screen-4.0.3/process.c 2008-04-27 02:25:03.000000000 +0200 +@@ -2375,9 +2375,10 @@ + #endif + break; + case RC_CHDIR: +- s = *args ? *args : home; ++ s = ExpandFilename(*args ? *args : home); + if (chdir(s) == -1) + Msg(errno, "%s", s); ++ free(s); + break; + case RC_SHELL: + case RC_DEFSHELL: diff --git a/debian/patches/51EXP_session_creation_time.dpatch b/debian/patches/51EXP_session_creation_time.dpatch index ea6be28..ca6cfa1 100644 --- a/debian/patches/51EXP_session_creation_time.dpatch +++ b/debian/patches/51EXP_session_creation_time.dpatch @@ -80,7 +80,7 @@ char *name, *n; - int firsts = -1, sockfd; - char *firstn = NULL; -+ int sockfd; ++ int sockfd = -1; int nfound = 0, ngood = 0, ndead = 0, nwipe = 0, npriv = 0; + time_t sysboot = time(NULL) - GetUptime(); struct sent @@ -112,7 +112,7 @@ { while (*n >= '0' && *n <= '9') n++; -@@ -226,11 +227,17 @@ +@@ -226,12 +227,24 @@ debug(" store it.\n"); if ((sent = (struct sent *)malloc(sizeof(struct sent))) == 0) continue; @@ -122,17 +122,30 @@ + sent->created = sysboot + SessionCreationTime(name); + sent->good = 0; + -+ for (slisttail = &slist; *slisttail; slisttail = &((*slisttail)->next)) { -+ if ((*slisttail)->created < sent->created) break; -+ } ++ for (slisttail = &slist; *slisttail; slisttail = &((*slisttail)->next)) ++ { ++ if ((*slisttail)->created < sent->created) break; ++ } + + sent->next = *slisttail; *slisttail = sent; - slisttail = &sent->next; nfound++; ++ if (sockfd >= 0) ++ { ++ close(sockfd); ++ sockfd = -1; ++ } sockfd = MakeClientSocket(0); #ifdef USE_SETEUID -@@ -295,17 +302,9 @@ + /* MakeClientSocket sets ids back to eff */ +@@ -290,22 +303,14 @@ + (!dflag && !rflag && !xflag)) + { + close(sockfd); ++ sockfd = -1; + debug(" no!\n"); + npriv++; /* a good socket that was not for us */ continue; } ngood++; @@ -149,11 +162,10 @@ - } + sent->good = 1; + debug(" added to list.\n"); -+ close(sockfd); } (void)closedir(dirp); if (nfound && (lsflag || ngood != 1) && !quietflag) -@@ -324,34 +323,42 @@ +@@ -324,34 +329,42 @@ } for (sent = slist; sent; sent = sent->next) { @@ -204,7 +216,7 @@ break; } } -@@ -364,10 +371,22 @@ +@@ -364,13 +377,37 @@ else Msg(0, m, ndead > 1 ? "s" : "", ndead > 1 ? "" : "es"); /* other args for nethack */ } @@ -221,15 +233,30 @@ + } + if (schosen && fdp) + { -+ sprintf(SockPath + sdirlen, "/%s", schosen->name); -+ *fdp = MakeClientSocket(0); ++ if (sockfd >= 0 && !strcmp(SockPath + sdirlen + 1, schosen->name)) ++ { ++ *fdp = sockfd; ++ sockfd = -1; ++ } ++ else ++ { ++ sprintf(SockPath + sdirlen, "/%s", schosen->name); ++ *fdp = MakeClientSocket(0); +#ifdef USE_SETEUID -+ xseteuid(real_uid); -+ xsetegid(real_gid); ++ xseteuid(real_uid); ++ xsetegid(real_gid); +#endif ++ } } else SockPath[sdirlen] = 0; ++ if (sockfd >= 0) ++ { ++ close(sockfd); ++ } + for (sent = slist; sent; sent = nsent) + { + nsent = sent->next; --- screen-4.0.3.orig/doc/screen.1 2008-04-21 22:34:11.000000000 +0200 +++ screen-4.0.3/doc/screen.1 2008-04-21 22:50:37.000000000 +0200 @@ -238,7 +238,7 @@ |