1 --- screen-3.9.9.orig/doc/screen.texinfo
2 +++ screen-3.9.9/doc/screen.texinfo
6 @kbd{>} sets the (second) mark and writes the contents of the paste buffer
7 -to the screen-exchange file (@file{/tmp/screen-exchange} per default)
8 +to the screen-exchange file (@file{$HOME/.screen-exchange} per default)
9 once copy-mode is finished. @xref{Screen-Exchange}.@*
10 This example demonstrates how to dump the
11 whole scrollback buffer to that file: @*@kbd{C-a [ g SPACE G $ >}.
14 Change the filename used for reading and writing with the paste buffer.
15 If the @var{exchange-file} parameter is omitted, @code{screen} reverts
16 -to the default of @file{/tmp/screen-exchange}. The following example
17 +to the default of @file{$HOME/.screen-exchange}. The following example
18 will paste the system's password file into the screen window (using the
19 paste buffer, where a copy remains):
21 --- screen-3.9.9.orig/doc/screen.1
22 +++ screen-3.9.9/doc/screen.1
25 Change the filename used for reading and writing with the paste buffer.
26 If the optional argument to the \*Qbufferfile\*U command is omitted,
27 -the default setting (\*Q/tmp/screen-exchange\*U) is reactivated.
28 +the default setting (\*Q$HOME/.screen-exchange\*U) is reactivated.
29 The following example will paste the system's password file into
35 \fB>\fP sets the (second) mark and writes the contents of the paste buffer to
36 -the screen-exchange file (/tmp/screen-exchange per default) once copy-mode is
37 +the screen-exchange file ($HOME/.screen-exchange per default) once copy-mode is
40 This example demonstrates how to dump the whole scrollback buffer
42 file if no filename is given. This is thought of as a primitive means of communication between
44 users on the same host. The filename can be set with the \fIbufferfile\fP
45 -command and defaults to \*Q/tmp/screen-exchange\*U.
46 +command and defaults to \*Q$HOME/.screen-exchange\*U.
49 .BR "writelock " [ on | "off\fR|\fBauto\fR]"
50 --- screen-3.9.9.orig/etc/etcscreenrc
51 +++ screen-3.9.9/etc/etcscreenrc
54 # This is an example for the global screenrc file.
55 -# You may want to install this file as /usr/local/etc/screenrc.
56 +# You may want to install this file as /etc/screenrc.
57 # Check config.h for the exact location.
59 # Flaws of termcap and standard settings are done here.
64 +# On Debian GNU/Linux, `<--' (Backspace key) should send char `\177':
65 +bindkey -k kb stuff "\177"
66 --- screen-3.9.9.orig/pty.c
67 +++ screen-3.9.9/pty.c
72 - int unlockpt __P((int)), grantpt __P((int));
73 + int unlockpt __P((int)), grantpt __P((int)), getpt __P((void));
74 sigret_t (*sigcld)__P(SIGPROTOARG);
77 + if ((f = getpt()) == -1)
79 strcpy(PtyName, "/dev/ptmx");
80 if ((f = open(PtyName, O_RDWR | O_NOCTTY)) == -1)
81 +#endif /* HAVE_GETPT */
85 --- screen-3.9.9.orig/README
86 +++ screen-3.9.9/README
89 C-a C-] (paste) Output copy buffer to current window's stdin.
91 - C-a < (readbuf) Read the copy buffer from /tmp/screen-exchange.
92 - C-a > (writebuf) Write the copy buffer to /tmp/screen-exchange.
93 + C-a < (readbuf) Read the copy buffer from $HOME/.screen-exchange.
94 + C-a > (writebuf) Write the copy buffer to $HOME/.screen-exchange.
96 C-a d (detach) Detach screen. All processes continue and may
97 spool output to their pty's, but screen
98 --- screen-3.9.9.orig/configure.in
99 +++ screen-3.9.9/configure.in
101 [echo "$1" 1>&AC_FD_MSG
104 +AC_ARG_WITH(libpam, [ --with-libpam use libpam for PAM support])
107 dnl Extract version from patchlevel.h
110 AC_MSG_ERROR(!!! no tgetent - no screen))))))
116 +#include <termcap.h>
117 +int main(int argc, char *argv[])
119 exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
120 }], AC_NOTE(- you use the termcap database),
122 if test -c /dev/ptmx ; then
123 AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],AC_DEFINE(HAVE_SVR4_PTYS))
125 +AC_CHECK_FUNCS(getpt)
127 AC_CHECKING(for ptyranges)
128 if test -d /dev/ptym ; then
129 @@ -1080,6 +1086,30 @@
135 +if test "$with_libpam" = "yes"; then
136 + dnl AC_CHECK_LIB(pam, pam_start, AC_DEFINE(PAM) LIBPAM=-lpam)
137 + dnl the above doesn't work as there is no libpam.a (only .so)
138 + dnl XXX - libpam_misc is probably Linux-PAM specific
139 + LIBPAM="-lpam -lpam_misc -ldl"
142 +# AC_CACHE_CHECK(whether pam_strerror needs two arguments,
143 +# ac_cv_pam_strerror_needs_two_args,
145 +# [#include <security/pam_appl.h>],
146 +# [ pam_handle_t *pamh; pam_strerror(pamh, PAM_SUCCESS);
148 +# ac_cv_pam_strerror_needs_two_args=yes,
149 +# ac_cv_pam_strerror_needs_two_args=no
152 +# if test "$ac_cv_pam_strerror_needs_two_args" = "yes"; then
153 +# AC_DEFINE(PAM_STRERROR_NEEDS_TWO_ARGS)
157 dnl AC_CHECK_HEADER(shadow.h, AC_DEFINE(SHADOWPW))
158 AC_CHECKING(getspnam)
159 AC_TRY_LINK([#include <shadow.h>], [getspnam("x");],AC_DEFINE(SHADOWPW))
160 @@ -1178,7 +1208,7 @@
162 ETCSCREENRC="\"/usr/local/etc/screenrc\""
163 if test -n "$prefix"; then
164 -ETCSCREENRC="\"$prefix/etc/screenrc\""
165 +ETCSCREENRC="\"/etc/screenrc\""
167 AC_MSG_CHECKING(for the global screenrc file)
168 AC_ARG_WITH(sys-screenrc, [ --with-sys-screenrc=path where to put the global screenrc file], [ ETCSCREENRC="\"${withval}\"" ])
169 --- screen-3.9.9.orig/ansi.c
170 +++ screen-3.9.9/ansi.c
171 @@ -2220,7 +2220,7 @@
175 - struct mline *tmp[256];
176 + struct mline tmp[256];
180 --- screen-3.9.9.orig/screen.c
181 +++ screen-3.9.9/screen.c
186 +char bufferfile[MAXPATHLEN];
188 extern char *blank, *null, Term[], screenterm[], **environ, Termcap[];
197 struct spwd *sss = NULL;
198 static char *spw = NULL;
199 @@ -279,13 +280,18 @@
204 if (ppp->pw_passwd[0] == '#' && ppp->pw_passwd[1] == '#' &&
205 strcmp(ppp->pw_passwd + 2, ppp->pw_name) == 0)
207 - for (; n < 13; n++)
208 + else if (!strncmp(ppp->pw_passwd, "$1$", 3)) { /* MD5-based passwords */
212 + for (; n < len; n++)
214 char c = ppp->pw_passwd[n];
215 - if (!(c == '.' || c == '/' || c == '$' ||
216 + if (!(c == '.' || c == '/' || (len == 34 && c == '$') ||
217 (c >= '0' && c <= '9') ||
218 (c >= 'a' && c <= 'z') ||
219 (c >= 'A' && c <= 'Z')))
221 logtstamp_string = SaveStr("-- %n:%t -- time-stamp -- %M/%d/%y %c:%s --\n");
222 hstatusstring = SaveStr("%h");
223 captionstring = SaveStr("%3n %t");
225 - BufferFile = SaveStr(DEFAULT_BUFFERFILE);
234 + snprintf(bufferfile,sizeof(bufferfile),"%s/.screen-exchange", home);
235 + BufferFile = SaveStr(bufferfile);
237 oumask = umask(0); /* well, unsigned never fails? jw. */
241 if (lstat(SockDir, &st))
243 - n = (eff_uid == 0) ? 0755 :
244 - (eff_gid != real_gid) ? 0775 :
245 + n = (eff_gid != real_gid) ? 0775 :
246 + (eff_uid == 0) ? 0755 :
250 --- screen-3.9.9.orig/screen.h
251 +++ screen-3.9.9/screen.h
256 +extern char bufferfile[MAXPATHLEN];
259 # define STATIC /* a function that the debugger should see */
260 --- screen-3.9.9.orig/debian/pam.d-screen
261 +++ screen-3.9.9/debian/pam.d-screen
263 +auth required pam_unix.so
264 --- screen-3.9.9.orig/Makefile.in
265 +++ screen-3.9.9/Makefile.in
267 ETCSCREENRC = `sed < config.h -n -e '/define ETCSCREENRC/s/^.*"\([^"]*\)"/\1/p'`
271 +CFLAGS = @CFLAGS@ @USEPAM@
272 CPPFLAGS = @CPPFLAGS@
275 +LIBS = @LIBS@ @LIBPAM@
279 --- screen-3.9.9.orig/config.h.in
280 +++ screen-3.9.9/config.h.in
283 #undef HAVE_SVR4_PTYS
286 + * define HAVE_GETPT if you have the getpt() function.
291 * define PTYRANGE0 and or PTYRANGE1 if you want to adapt screen
292 * to unusual environments. E.g. For SunOs the defaults are "qpr" and
293 --- screen-3.9.9.orig/window.c
294 +++ screen-3.9.9/window.c
295 @@ -1524,6 +1524,12 @@
299 + if (ioctl(w->w_ptyfd, TIOCPKT, (char *)&flag))
301 + Msg(errno, "TIOCPKT ioctl on parent");
308 @@ -1560,6 +1566,14 @@
309 evdeq(&pwin->p_writeev);
316 + if (ioctl(w->w_ptyfd, TIOCPKT, (char *)&flag))
317 + Msg(errno, "TIOCPKT reset on parent failed");
319 +#endif /* TIOCPKT */
323 --- screen-3.9.9.orig/tty.sh
324 +++ screen-3.9.9/tty.sh
327 #if defined(POSIX) && !defined(ultrix)
328 setsid(); /* will break terminal affiliation */
329 -# if defined(BSD) && defined(TIOCSCTTY)
330 +# if defined(BSD) && defined(TIOCSCTTY) && !defined(__GNU__)
331 ioctl(fd, TIOCSCTTY, (char *)0);
332 # endif /* BSD && TIOCSCTTY */
334 --- screen-3.9.9.orig/process.c
335 +++ screen-3.9.9/process.c
336 @@ -2019,7 +2019,7 @@
340 - BufferFile = SaveStr(DEFAULT_BUFFERFILE);
341 + BufferFile = SaveStr(bufferfile);
342 else if (ParseSaveStr(act, &BufferFile))
345 --- screen-3.9.9.orig/attacher.c
346 +++ screen-3.9.9/attacher.c
352 +#include <security/pam_appl.h>
353 +#endif /* USE_PAM */
357 static sigret_t AttacherSigInt __P(SIGPROTOARG);
363 +static char *PAM_password;
364 +static char *PAM_name;
368 static int ContinuePlease;
369 @@ -720,14 +728,67 @@
374 +static int PAM_conv (int num_msg,
375 + const struct pam_message **msg,
376 + struct pam_response **resp,
377 + void *appdata_ptr) {
379 + struct pam_response *reply = NULL;
381 + reply = malloc(sizeof(struct pam_response)*num_msg);
382 + if (!reply) return PAM_CONV_ERR;
383 + #define COPY_STRING(s) (s) ? strdup(s) : NULL
385 + for (replies = 0; replies < num_msg; replies++) {
386 + switch (msg[replies]->msg_style) {
387 + case PAM_PROMPT_ECHO_OFF:
388 + /* wants password */
389 + reply[replies].resp_retcode = PAM_SUCCESS;
390 + reply[replies].resp = COPY_STRING(PAM_password);
392 + case PAM_TEXT_INFO:
393 + /* ignore the informational mesage */
394 + /* but first clear out any drek left by malloc */
395 + reply[replies].resp = NULL;
397 + case PAM_PROMPT_ECHO_ON:
398 + /* user name given to PAM already */
401 + /* unknown or PAM_ERROR_MSG */
403 + return PAM_CONV_ERR;
407 + return PAM_SUCCESS;
410 +static struct pam_conv PAM_conversation = {
417 /* -- original copyright by Luigi Cannelloni 1985 (luigi@faui70.UUCP) -- */
421 char fullname[100], *cp1, message[100 + 100];
422 - char *pass, mypass[9];
426 + pam_handle_t *pamh = NULL;
429 +#endif /* USE_PAM */
431 pass = ppp->pw_passwd;
434 + /* if we're using PAM this will evaluate to true. which we don't want. */
435 if (pass == 0 || *pass == 0)
437 if ((pass = getpass("Key: ")))
442 +#endif /* USE_PAM */
444 debug("screen_builtin_lck looking in gcos field\n");
445 strncpy(fullname, ppp->pw_gecos, sizeof(fullname) - 9);
447 AttacherFinit(SIGARG);
452 + PAM_name=ppp->pw_name;
454 + pam_error = pam_start("screen", PAM_name, &PAM_conversation, &pamh);
456 + if (pam_error == PAM_SUCCESS) {
457 + pam_error = pam_authenticate(pamh, 0);
458 + pam_end(pamh, PAM_SUCCESS);
459 + if (pam_error == PAM_SUCCESS) {
460 + memset(cp1,0,strlen(cp1));
461 + PAM_password = NULL;
468 if (!strncmp(crypt(cp1, pass), pass, strlen(pass)))
470 if (!strcmp(cp1, mypass))
473 +#endif /* USE_PAM */
474 debug("screen_builtin_lck: NO!!!!!\n");
476 debug("password ok.\n");