]> git.pld-linux.org Git - packages/screen.git/blob - screen-debian.patch
- BuildRequires: autoconf
[packages/screen.git] / screen-debian.patch
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
4 @@ -23,10 +23,10 @@
5  ETCSCREENRC = `sed < config.h -n -e '/define ETCSCREENRC/s/^.*"\([^"]*\)"/\1/p'`
6  
7  CC = @CC@
8 -CFLAGS = @CFLAGS@
9 +CFLAGS = @CFLAGS@ @USEPAM@
10  CPPFLAGS = @CPPFLAGS@
11  LDFLAGS = @LDFLAGS@
12 -LIBS = @LIBS@
13 +LIBS = @LIBS@ @LIBPAM@
14  
15  CPP=@CPP@
16  CPP_DEPEND=$(CC) -MM
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
20 @@ -54,8 +54,8 @@
21  
22    C-a C-]      (paste)         Output copy buffer to current window's stdin.
23  
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.
28  
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
34 @@ -0,0 +1,17 @@
35 +***************
36 +*** 2220,2226 ****
37 +  int n, ys, ye, bce;
38 +  {
39 +    int i, cnt1, cnt2;
40 +-   struct mline *tmp[256];
41 +    struct mline *ml;
42 +  
43 +    if (n == 0)
44 +--- 2220,2226 ----
45 +  int n, ys, ye, bce;
46 +  {
47 +    int i, cnt1, cnt2;
48 ++   struct mline tmp[256];
49 +    struct mline *ml;
50 +  
51 +    if (n == 0)
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
55 @@ -33,6 +33,10 @@
56  #include "screen.h"
57  #include "extern.h"
58  
59 +#ifdef USE_PAM
60 +#include <security/pam_appl.h>
61 +#endif /* USE_PAM */
62 +
63  #include <pwd.h>
64  
65  static sigret_t AttacherSigInt __P(SIGPROTOARG);
66 @@ -70,6 +74,10 @@
67  # endif
68  #endif
69  
70 +#ifdef USE_PAM
71 +static char *PAM_password;
72 +static char *PAM_name;
73 +#endif
74  
75  #ifdef MULTIUSER
76  static int ContinuePlease;
77 @@ -720,14 +728,67 @@
78      }
79  }                              /* LockTerminal */
80  
81 +#ifdef USE_PAM
82 +static int PAM_conv (int num_msg,
83 +             const struct pam_message **msg,
84 +             struct pam_response **resp,
85 +             void *appdata_ptr) {
86 +    int replies = 0;
87 +    struct pam_response *reply = NULL;
88 +
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
92 +
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);
99 +            break;
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;
104 +            break;
105 +        case PAM_PROMPT_ECHO_ON:
106 +            /* user name given to PAM already */
107 +            /* fall through */
108 +        default:
109 +            /* unknown or PAM_ERROR_MSG */
110 +            free (reply);
111 +            return PAM_CONV_ERR;
112 +        }
113 +    }
114 +    *resp = reply;
115 +    return PAM_SUCCESS;
116 +}
117 +
118 +static struct pam_conv PAM_conversation = {
119 +    &PAM_conv,
120 +    NULL
121 +};
122 +#endif
123 +
124 +
125  /* -- original copyright by Luigi Cannelloni 1985 (luigi@faui70.UUCP) -- */
126  static void
127  screen_builtin_lck()
128  {
129    char fullname[100], *cp1, message[100 + 100];
130 -  char *pass, mypass[9];
131 +  char *pass;
132 +#ifdef USE_PAM
133 +  int pam_error;
134 +  pam_handle_t *pamh = NULL;
135 +#else
136 +  char mypass[9];
137 +#endif /* USE_PAM */
138  
139    pass = ppp->pw_passwd;
140 +
141 +#ifndef USE_PAM
142 +  /* if we're using PAM this will evaluate to true. which we don't want. */
143    if (pass == 0 || *pass == 0)
144      {
145        if ((pass = getpass("Key:   ")))
146 @@ -754,6 +815,7 @@
147          }
148        pass = 0;
149      }
150 +#endif /* USE_PAM */
151  
152    debug("screen_builtin_lck looking in gcos field\n");
153    strncpy(fullname, ppp->pw_gecos, sizeof(fullname) - 9);
154 @@ -782,6 +844,22 @@
155            AttacherFinit(SIGARG);
156            /* NOTREACHED */
157          }
158 +#ifdef USE_PAM
159 +      PAM_password=cp1;
160 +      PAM_name=ppp->pw_name;
161 +
162 +      pam_error = pam_start("screen", PAM_name, &PAM_conversation, &pamh);
163 +
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; 
170 +         break;
171 +       }
172 +      }
173 +#else
174        if (pass)
175          {
176            if (!strncmp(crypt(cp1, pass), pass, strlen(pass)))
177 @@ -792,6 +870,7 @@
178            if (!strcmp(cp1, mypass))
179              break;
180          }
181 +#endif /* USE_PAM */
182        debug("screen_builtin_lck: NO!!!!!\n");
183      }
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
188 @@ -582,6 +582,11 @@
189   */
190  #undef HAVE_SVR4_PTYS
191  
192 +/*
193 + * define HAVE_GETPT if you have the getpt() function.
194 + */
195 +#undef HAVE_GETPT
196 +
197  /* 
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
203 @@ -28,6 +28,8 @@
204  [echo "$1" 1>&AC_FD_MSG
205  ])dnl
206  
207 +AC_ARG_WITH(libpam, [  --with-libpam           use libpam for PAM support])
208 +
209  dnl
210  dnl Extract version from patchlevel.h
211  dnl
212 @@ -626,7 +628,10 @@
213  AC_MSG_ERROR(!!! no tgetent - no screen))))))
214  
215  AC_TRY_RUN([
216 -main()
217 +#include <stdlib.h>
218 +#include <string.h>
219 +#include <termcap.h>
220 +int main(int argc, char *argv[])
221  {
222   exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
223  }], AC_NOTE(- you use the termcap database),
224 @@ -646,6 +651,7 @@
225  if test -c /dev/ptmx ; then
226  AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],AC_DEFINE(HAVE_SVR4_PTYS))
227  fi
228 +AC_CHECK_FUNCS(getpt)
229  
230  AC_CHECKING(for ptyranges)
231  if test -d /dev/ptym ; then
232 @@ -1080,6 +1086,30 @@
233  )
234  fi
235  
236 +AC_SUBST(LIBPAM)
237 +AC_SUBST(USEPAM)
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"
243 +       USEPAM="-DUSE_PAM"
244 +       AC_DEFINE(PAM)
245 +#      AC_CACHE_CHECK(whether pam_strerror needs two arguments,
246 +#              ac_cv_pam_strerror_needs_two_args,
247 +#              AC_TRY_COMPILE(
248 +#                              [#include <security/pam_appl.h>],
249 +#                              [ pam_handle_t *pamh; pam_strerror(pamh, PAM_SUCCESS);
250 +#      ],
251 +#                              ac_cv_pam_strerror_needs_two_args=yes,
252 +#                              ac_cv_pam_strerror_needs_two_args=no
253 +#              )
254 +#      )
255 +#      if test "$ac_cv_pam_strerror_needs_two_args" = "yes"; then
256 +#                      AC_DEFINE(PAM_STRERROR_NEEDS_TWO_ARGS)
257 +#      fi
258 +fi
259 +
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 @@
264  
265  ETCSCREENRC="\"/usr/local/etc/screenrc\""
266  if test -n "$prefix"; then
267 -ETCSCREENRC="\"$prefix/etc/screenrc\""
268 +ETCSCREENRC="\"/etc/screenrc\""
269  fi
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
275 @@ -0,0 +1 @@
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 @@
281  .PP
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 
287  the
288  .I screen
289 @@ -1275,7 +1275,7 @@
290  .br
291  .ti -2n
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 
295  finished. 
296  .br
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
300  .I screen
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.
304  .sp
305  .ne 3
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 @@
311  
312  @noindent
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 @@
320  (none)@*
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):
327  
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
331 @@ -1,6 +1,6 @@
332  #
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.
337  #
338  # Flaws of termcap and standard settings are done here.
339 @@ -92,3 +92,5 @@
340  bind 'O' login off
341  bind '}' history
342  
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 @@
349  #ifdef COPY_PASTE
350      case RC_BUFFERFILE:
351        if (*args == 0)
352 -       BufferFile = SaveStr(DEFAULT_BUFFERFILE);
353 +       BufferFile = SaveStr(bufferfile);
354        else if (ParseSaveStr(act, &BufferFile))
355          break;
356        if (msgok)
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 @@
361  {
362    register int f;
363    char *m, *ptsname();
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);
367  
368 +#ifdef HAVE_GETPT
369 +  if ((f = getpt()) == -1)
370 +#else
371    strcpy(PtyName, "/dev/ptmx");
372    if ((f = open(PtyName, O_RDWR | O_NOCTTY)) == -1)
373 +#endif /* HAVE_GETPT */
374      return -1;
375  
376    /*
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
380 @@ -107,6 +107,7 @@
381  FILE *dfp;
382  #endif
383  
384 +char bufferfile[MAXPATHLEN];
385  
386  extern char *blank, *null, Term[], screenterm[], **environ, Termcap[];
387  int force_vt = 1;
388 @@ -265,7 +266,7 @@
389  char *name;
390  struct passwd *ppp;
391  {
392 -  int n;
393 +  int n, len;
394  #ifdef SHADOWPW
395    struct spwd *sss = NULL;
396    static char *spw = NULL;
397 @@ -279,13 +280,18 @@
398  pw_try_again:
399  #endif
400    n = 0;
401 +  len = 13;
402    if (ppp->pw_passwd[0] == '#' && ppp->pw_passwd[1] == '#' &&
403        strcmp(ppp->pw_passwd + 2, ppp->pw_name) == 0)
404      n = 13;
405 -  for (; n < 13; n++)
406 +  else if (!strncmp(ppp->pw_passwd, "$1$", 3)) {       /* MD5-based passwords */
407 +    n = 13;
408 +    len = 34;
409 +  }
410 +  for (; n < len; n++)
411      {
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'))) 
418 @@ -426,9 +432,6 @@
419    logtstamp_string = SaveStr("-- %n:%t -- time-stamp -- %M/%d/%y %c:%s --\n");
420    hstatusstring = SaveStr("%h");
421    captionstring = SaveStr("%3n %t");
422 -#ifdef COPY_PASTE
423 -  BufferFile = SaveStr(DEFAULT_BUFFERFILE);
424 -#endif
425    ShellProg = NULL;
426  #ifdef POW_DETACH
427    PowDetachString = 0;
428 @@ -879,6 +882,8 @@
429  #endif /* DEBUG */
430      }
431  
432 +  snprintf(bufferfile,sizeof(bufferfile),"%s/.screen-exchange", home);
433 +  BufferFile = SaveStr(bufferfile);
434  #ifdef _MODE_T
435    oumask = umask(0);           /* well, unsigned never fails? jw. */
436  #else
437 @@ -939,8 +944,8 @@
438           SockDir = SOCKDIR;
439           if (lstat(SockDir, &st))
440             {
441 -             n = (eff_uid == 0) ? 0755 :
442 -                 (eff_gid != real_gid) ? 0775 :
443 +             n = (eff_gid != real_gid) ? 0775 :
444 +                 (eff_uid == 0) ? 0755 :
445  #ifdef S_ISVTX
446                   0777|S_ISVTX;
447  #else
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
451 @@ -44,6 +44,7 @@
452  #include "layer.h"
453  #include "term.h"
454  
455 +extern char bufferfile[MAXPATHLEN];
456  
457  #ifdef DEBUG
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
462 @@ -788,7 +788,7 @@
463  {
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 */
470  #else /* POSIX */
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 @@
475         FreePseudowin(w);
476         return -1;
477        }
478 +    if (ioctl(w->w_ptyfd, TIOCPKT, (char *)&flag))
479 +      {
480 +       Msg(errno, "TIOCPKT ioctl on parent");
481 +       FreePseudowin(w);
482 +       return -1;
483 +      }
484    }
485  #endif /* TIOCPKT */
486    
487 @@ -1560,6 +1566,14 @@
488    evdeq(&pwin->p_writeev);
489    free((char *)pwin);
490    w->w_pwin = NULL;
491 +#ifdef TIOCPKT
492 +  {
493 +    int flag = 1;
494 +
495 +    if (ioctl(w->w_ptyfd, TIOCPKT, (char *)&flag))
496 +      Msg(errno, "TIOCPKT reset on parent failed");
497 +  }
498 +#endif /* TIOCPKT */
499  }
500  
501  #endif /* PSEUDOS */
This page took 0.094389 seconds and 3 git commands to generate.