1 diff -urN screen-3.9.10.org/Makefile.in screen-3.9.10/Makefile.in
2 --- screen-3.9.10.org/Makefile.in Tue Sep 4 16:26:21 2001
3 +++ screen-3.9.10/Makefile.in Sat Sep 29 14:47:21 2001
5 ETCSCREENRC = `sed < config.h -n -e '/define ETCSCREENRC/s/^.*"\([^"]*\)"/\1/p'`
9 +CFLAGS = @CFLAGS@ @USEPAM@
13 +LIBS = @LIBS@ @LIBPAM@
17 diff -urN screen-3.9.10.org/README screen-3.9.10/README
18 --- screen-3.9.10.org/README Sat Apr 28 15:26:42 2001
19 +++ screen-3.9.10/README Sat Sep 29 14:47:15 2001
22 C-a C-] (paste) Output copy buffer to current window's stdin.
24 - C-a < (readbuf) Read the copy buffer from /tmp/screen-exchange.
25 - C-a > (writebuf) Write the copy buffer to /tmp/screen-exchange.
26 + C-a < (readbuf) Read the copy buffer from $HOME/.screen-exchange.
27 + C-a > (writebuf) Write the copy buffer to $HOME/.screen-exchange.
29 C-a d (detach) Detach screen. All processes continue and may
30 spool output to their pty's, but screen
31 diff -urN screen-3.9.10.org/ansi.c.rej screen-3.9.10/ansi.c.rej
32 --- screen-3.9.10.org/ansi.c.rej Thu Jan 1 01:00:00 1970
33 +++ screen-3.9.10/ansi.c.rej Sat Sep 29 14:47:21 2001
40 +- struct mline *tmp[256];
48 ++ struct mline tmp[256];
52 diff -urN screen-3.9.10.org/attacher.c screen-3.9.10/attacher.c
53 --- screen-3.9.10.org/attacher.c Sat Apr 28 15:26:42 2001
54 +++ screen-3.9.10/attacher.c Sat Sep 29 14:47:22 2001
60 +#include <security/pam_appl.h>
65 static sigret_t AttacherSigInt __P(SIGPROTOARG);
71 +static char *PAM_password;
72 +static char *PAM_name;
76 static int ContinuePlease;
82 +static int PAM_conv (int num_msg,
83 + const struct pam_message **msg,
84 + struct pam_response **resp,
85 + void *appdata_ptr) {
87 + struct pam_response *reply = NULL;
89 + reply = malloc(sizeof(struct pam_response)*num_msg);
90 + if (!reply) return PAM_CONV_ERR;
91 + #define COPY_STRING(s) (s) ? strdup(s) : NULL
93 + for (replies = 0; replies < num_msg; replies++) {
94 + switch (msg[replies]->msg_style) {
95 + case PAM_PROMPT_ECHO_OFF:
96 + /* wants password */
97 + reply[replies].resp_retcode = PAM_SUCCESS;
98 + reply[replies].resp = COPY_STRING(PAM_password);
100 + case PAM_TEXT_INFO:
101 + /* ignore the informational mesage */
102 + /* but first clear out any drek left by malloc */
103 + reply[replies].resp = NULL;
105 + case PAM_PROMPT_ECHO_ON:
106 + /* user name given to PAM already */
109 + /* unknown or PAM_ERROR_MSG */
111 + return PAM_CONV_ERR;
115 + return PAM_SUCCESS;
118 +static struct pam_conv PAM_conversation = {
125 /* -- original copyright by Luigi Cannelloni 1985 (luigi@faui70.UUCP) -- */
129 char fullname[100], *cp1, message[100 + 100];
130 - char *pass, mypass[9];
134 + pam_handle_t *pamh = NULL;
137 +#endif /* USE_PAM */
139 pass = ppp->pw_passwd;
142 + /* if we're using PAM this will evaluate to true. which we don't want. */
143 if (pass == 0 || *pass == 0)
145 if ((pass = getpass("Key: ")))
150 +#endif /* USE_PAM */
152 debug("screen_builtin_lck looking in gcos field\n");
153 strncpy(fullname, ppp->pw_gecos, sizeof(fullname) - 9);
155 AttacherFinit(SIGARG);
160 + PAM_name=ppp->pw_name;
162 + pam_error = pam_start("screen", PAM_name, &PAM_conversation, &pamh);
164 + if (pam_error == PAM_SUCCESS) {
165 + pam_error = pam_authenticate(pamh, 0);
166 + pam_end(pamh, PAM_SUCCESS);
167 + if (pam_error == PAM_SUCCESS) {
168 + memset(cp1,0,strlen(cp1));
169 + PAM_password = NULL;
176 if (!strncmp(crypt(cp1, pass), pass, strlen(pass)))
178 if (!strcmp(cp1, mypass))
181 +#endif /* USE_PAM */
182 debug("screen_builtin_lck: NO!!!!!\n");
184 debug("password ok.\n");
185 diff -urN screen-3.9.10.org/config.h.in screen-3.9.10/config.h.in
186 --- screen-3.9.10.org/config.h.in Tue Sep 4 16:26:21 2001
187 +++ screen-3.9.10/config.h.in Sat Sep 29 14:47:21 2001
190 #undef HAVE_SVR4_PTYS
193 + * define HAVE_GETPT if you have the getpt() function.
198 * define PTYRANGE0 and or PTYRANGE1 if you want to adapt screen
199 * to unusual environments. E.g. For SunOs the defaults are "qpr" and
200 diff -urN screen-3.9.10.org/configure.in screen-3.9.10/configure.in
201 --- screen-3.9.10.org/configure.in Thu May 17 19:00:19 2001
202 +++ screen-3.9.10/configure.in Sat Sep 29 14:47:15 2001
204 [echo "$1" 1>&AC_FD_MSG
207 +AC_ARG_WITH(libpam, [ --with-libpam use libpam for PAM support])
210 dnl Extract version from patchlevel.h
213 AC_MSG_ERROR(!!! no tgetent - no screen))))))
219 +#include <termcap.h>
220 +int main(int argc, char *argv[])
222 exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
223 }], AC_NOTE(- you use the termcap database),
225 if test -c /dev/ptmx ; then
226 AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],AC_DEFINE(HAVE_SVR4_PTYS))
228 +AC_CHECK_FUNCS(getpt)
230 AC_CHECKING(for ptyranges)
231 if test -d /dev/ptym ; then
232 @@ -1080,6 +1086,30 @@
238 +if test "$with_libpam" = "yes"; then
239 + dnl AC_CHECK_LIB(pam, pam_start, AC_DEFINE(PAM) LIBPAM=-lpam)
240 + dnl the above doesn't work as there is no libpam.a (only .so)
241 + dnl XXX - libpam_misc is probably Linux-PAM specific
242 + LIBPAM="-lpam -lpam_misc -ldl"
245 +# AC_CACHE_CHECK(whether pam_strerror needs two arguments,
246 +# ac_cv_pam_strerror_needs_two_args,
248 +# [#include <security/pam_appl.h>],
249 +# [ pam_handle_t *pamh; pam_strerror(pamh, PAM_SUCCESS);
251 +# ac_cv_pam_strerror_needs_two_args=yes,
252 +# ac_cv_pam_strerror_needs_two_args=no
255 +# if test "$ac_cv_pam_strerror_needs_two_args" = "yes"; then
256 +# AC_DEFINE(PAM_STRERROR_NEEDS_TWO_ARGS)
260 dnl AC_CHECK_HEADER(shadow.h, AC_DEFINE(SHADOWPW))
261 AC_CHECKING(getspnam)
262 AC_TRY_LINK([#include <shadow.h>], [getspnam("x");],AC_DEFINE(SHADOWPW))
263 @@ -1178,7 +1208,7 @@
265 ETCSCREENRC="\"/usr/local/etc/screenrc\""
266 if test -n "$prefix"; then
267 -ETCSCREENRC="\"$prefix/etc/screenrc\""
268 +ETCSCREENRC="\"/etc/screenrc\""
270 AC_MSG_CHECKING(for the global screenrc file)
271 AC_ARG_WITH(sys-screenrc, [ --with-sys-screenrc=path where to put the global screenrc file], [ ETCSCREENRC="\"${withval}\"" ])
272 diff -urN screen-3.9.10.org/debian/pam.d-screen screen-3.9.10/debian/pam.d-screen
273 --- screen-3.9.10.org/debian/pam.d-screen Thu Jan 1 01:00:00 1970
274 +++ screen-3.9.10/debian/pam.d-screen Sat Sep 29 14:47:21 2001
276 +auth required pam_unix.so
277 diff -urN screen-3.9.10.org/doc/screen.1 screen-3.9.10/doc/screen.1
278 --- screen-3.9.10.org/doc/screen.1 Fri May 25 16:39:19 2001
279 +++ screen-3.9.10/doc/screen.1 Sat Sep 29 14:47:15 2001
280 @@ -1010,7 +1010,7 @@
282 Change the filename used for reading and writing with the paste buffer.
283 If the optional argument to the \*Qbufferfile\*U command is omitted,
284 -the default setting (\*Q/tmp/screen-exchange\*U) is reactivated.
285 +the default setting (\*Q$HOME/.screen-exchange\*U) is reactivated.
286 The following example will paste the system's password file into
289 @@ -1275,7 +1275,7 @@
292 \fB>\fP sets the (second) mark and writes the contents of the paste buffer to
293 -the screen-exchange file (/tmp/screen-exchange per default) once copy-mode is
294 +the screen-exchange file ($HOME/.screen-exchange per default) once copy-mode is
297 This example demonstrates how to dump the whole scrollback buffer
298 @@ -2805,7 +2805,7 @@
299 file if no filename is given. This is thought of as a primitive means of communication between
301 users on the same host. The filename can be set with the \fIbufferfile\fP
302 -command and defaults to \*Q/tmp/screen-exchange\*U.
303 +command and defaults to \*Q$HOME/.screen-exchange\*U.
306 .BR "writelock " [ on | "off\fR|\fBauto\fR]"
307 diff -urN screen-3.9.10.org/doc/screen.texinfo screen-3.9.10/doc/screen.texinfo
308 --- screen-3.9.10.org/doc/screen.texinfo Fri May 25 16:40:02 2001
309 +++ screen-3.9.10/doc/screen.texinfo Sat Sep 29 14:47:15 2001
310 @@ -2912,7 +2912,7 @@
313 @kbd{>} sets the (second) mark and writes the contents of the paste buffer
314 -to the screen-exchange file (@file{/tmp/screen-exchange} per default)
315 +to the screen-exchange file (@file{$HOME/.screen-exchange} per default)
316 once copy-mode is finished. @xref{Screen-Exchange}.@*
317 This example demonstrates how to dump the
318 whole scrollback buffer to that file: @*@kbd{C-a [ g SPACE G $ >}.
319 @@ -3034,7 +3034,7 @@
321 Change the filename used for reading and writing with the paste buffer.
322 If the @var{exchange-file} parameter is omitted, @code{screen} reverts
323 -to the default of @file{/tmp/screen-exchange}. The following example
324 +to the default of @file{$HOME/.screen-exchange}. The following example
325 will paste the system's password file into the screen window (using the
326 paste buffer, where a copy remains):
328 diff -urN screen-3.9.10.org/etc/etcscreenrc screen-3.9.10/etc/etcscreenrc
329 --- screen-3.9.10.org/etc/etcscreenrc Sat Apr 28 17:25:34 2001
330 +++ screen-3.9.10/etc/etcscreenrc Sat Sep 29 14:47:15 2001
333 # This is an example for the global screenrc file.
334 -# You may want to install this file as /usr/local/etc/screenrc.
335 +# You may want to install this file as /etc/screenrc.
336 # Check config.h for the exact location.
338 # Flaws of termcap and standard settings are done here.
343 +# On Debian GNU/Linux, `<--' (Backspace key) should send char `\177':
344 +bindkey -k kb stuff "\177"
345 diff -urN screen-3.9.10.org/process.c screen-3.9.10/process.c
346 --- screen-3.9.10.org/process.c Tue Sep 4 16:16:08 2001
347 +++ screen-3.9.10/process.c Sat Sep 29 14:47:22 2001
348 @@ -2019,7 +2019,7 @@
352 - BufferFile = SaveStr(DEFAULT_BUFFERFILE);
353 + BufferFile = SaveStr(bufferfile);
354 else if (ParseSaveStr(act, &BufferFile))
357 diff -urN screen-3.9.10.org/pty.c screen-3.9.10/pty.c
358 --- screen-3.9.10.org/pty.c Sat Apr 28 15:26:43 2001
359 +++ screen-3.9.10/pty.c Sat Sep 29 14:47:15 2001
360 @@ -243,11 +243,15 @@
364 - int unlockpt __P((int)), grantpt __P((int));
365 + int unlockpt __P((int)), grantpt __P((int)), getpt __P((void));
366 sigret_t (*sigcld)__P(SIGPROTOARG);
369 + if ((f = getpt()) == -1)
371 strcpy(PtyName, "/dev/ptmx");
372 if ((f = open(PtyName, O_RDWR | O_NOCTTY)) == -1)
373 +#endif /* HAVE_GETPT */
377 diff -urN screen-3.9.10.org/screen.c screen-3.9.10/screen.c
378 --- screen-3.9.10.org/screen.c Tue Sep 4 15:14:51 2001
379 +++ screen-3.9.10/screen.c Sat Sep 29 14:47:21 2001
384 +char bufferfile[MAXPATHLEN];
386 extern char *blank, *null, Term[], screenterm[], **environ, Termcap[];
395 struct spwd *sss = NULL;
396 static char *spw = NULL;
397 @@ -279,13 +280,18 @@
402 if (ppp->pw_passwd[0] == '#' && ppp->pw_passwd[1] == '#' &&
403 strcmp(ppp->pw_passwd + 2, ppp->pw_name) == 0)
405 - for (; n < 13; n++)
406 + else if (!strncmp(ppp->pw_passwd, "$1$", 3)) { /* MD5-based passwords */
410 + for (; n < len; n++)
412 char c = ppp->pw_passwd[n];
413 - if (!(c == '.' || c == '/' || c == '$' ||
414 + if (!(c == '.' || c == '/' || (len == 34 && c == '$') ||
415 (c >= '0' && c <= '9') ||
416 (c >= 'a' && c <= 'z') ||
417 (c >= 'A' && c <= 'Z')))
419 logtstamp_string = SaveStr("-- %n:%t -- time-stamp -- %M/%d/%y %c:%s --\n");
420 hstatusstring = SaveStr("%h");
421 captionstring = SaveStr("%3n %t");
423 - BufferFile = SaveStr(DEFAULT_BUFFERFILE);
432 + snprintf(bufferfile,sizeof(bufferfile),"%s/.screen-exchange", home);
433 + BufferFile = SaveStr(bufferfile);
435 oumask = umask(0); /* well, unsigned never fails? jw. */
439 if (lstat(SockDir, &st))
441 - n = (eff_uid == 0) ? 0755 :
442 - (eff_gid != real_gid) ? 0775 :
443 + n = (eff_gid != real_gid) ? 0775 :
444 + (eff_uid == 0) ? 0755 :
448 diff -urN screen-3.9.10.org/screen.h screen-3.9.10/screen.h
449 --- screen-3.9.10.org/screen.h Sat Apr 28 15:26:43 2001
450 +++ screen-3.9.10/screen.h Sat Sep 29 14:47:21 2001
455 +extern char bufferfile[MAXPATHLEN];
458 # define STATIC /* a function that the debugger should see */
459 diff -urN screen-3.9.10.org/tty.sh screen-3.9.10/tty.sh
460 --- screen-3.9.10.org/tty.sh Sat Apr 28 15:26:43 2001
461 +++ screen-3.9.10/tty.sh Sat Sep 29 14:47:21 2001
464 #if defined(POSIX) && !defined(ultrix)
465 setsid(); /* will break terminal affiliation */
466 -# if defined(BSD) && defined(TIOCSCTTY)
467 +# if defined(BSD) && defined(TIOCSCTTY) && !defined(__GNU__)
468 ioctl(fd, TIOCSCTTY, (char *)0);
469 # endif /* BSD && TIOCSCTTY */
471 diff -urN screen-3.9.10.org/window.c screen-3.9.10/window.c
472 --- screen-3.9.10.org/window.c Sat Apr 28 15:26:43 2001
473 +++ screen-3.9.10/window.c Sat Sep 29 14:47:21 2001
474 @@ -1524,6 +1524,12 @@
478 + if (ioctl(w->w_ptyfd, TIOCPKT, (char *)&flag))
480 + Msg(errno, "TIOCPKT ioctl on parent");
487 @@ -1560,6 +1566,14 @@
488 evdeq(&pwin->p_writeev);
495 + if (ioctl(w->w_ptyfd, TIOCPKT, (char *)&flag))
496 + Msg(errno, "TIOCPKT reset on parent failed");
498 +#endif /* TIOCPKT */