]> git.pld-linux.org Git - packages/openssh.git/blob - openssh-sigpipe.patch
- enhanced openssh-chroot.patch with UseChroot configuration option
[packages/openssh.git] / openssh-sigpipe.patch
1 diff -Naur openssh-3.5p1/clientloop.c openssh-3.5p1-p/clientloop.c
2 --- openssh-3.5p1/clientloop.c  Wed Sep  4 08:32:13 2002
3 +++ openssh-3.5p1-p/clientloop.c        Tue Nov  5 15:46:26 2002
4 @@ -96,6 +96,9 @@
5   */
6  extern char *host;
7  
8 +/* if we process SIGPIPE */
9 +extern int enable_sigpipe;
10 +
11  /*
12   * Flag to indicate that we have received a window change signal which has
13   * not yet been processed.  This will cause a message indicating the new
14 @@ -892,6 +895,10 @@
15         signal(SIGINT, signal_handler);
16         signal(SIGQUIT, signal_handler);
17         signal(SIGTERM, signal_handler);
18 +
19 +       if (enable_sigpipe)
20 +               signal(SIGPIPE, signal_handler);
21 +
22         if (have_pty)
23                 signal(SIGWINCH, window_change_handler);
24  
25 diff -Naur openssh-3.5p1/ssh.1 openssh-3.5p1-p/ssh.1
26 --- openssh-3.5p1/ssh.1 Mon Sep 30 04:00:56 2002
27 +++ openssh-3.5p1-p/ssh.1       Tue Nov  5 15:51:54 2002
28 @@ -48,7 +48,7 @@
29  .Op Ar command
30  .Pp
31  .Nm ssh
32 -.Op Fl afgknqstvxACNTX1246
33 +.Op Fl afgknqstvxABCNTX1246
34  .Op Fl b Ar bind_address
35  .Op Fl c Ar cipher_spec
36  .Op Fl e Ar escape_char
37 @@ -412,6 +412,10 @@
38  .It Fl b Ar bind_address
39  Specify the interface to transmit from on machines with multiple
40  interfaces or aliased addresses.
41 +.It Fl B
42 +Enables processing of SIGPIPE. Useful when using ssh output as input for
43 +another process, for example in a shell script. Be careful - it may break
44 +port/X11 forwarding when used.
45  .It Fl c Ar blowfish|3des|des
46  Selects the cipher to use for encrypting the session.
47  .Ar 3des
48 diff -Naur openssh-3.5p1/ssh.c openssh-3.5p1-p/ssh.c
49 --- openssh-3.5p1/ssh.c Thu Sep 19 04:05:04 2002
50 +++ openssh-3.5p1-p/ssh.c       Tue Nov  5 15:44:57 2002
51 @@ -143,6 +143,9 @@
52  /* Should we execute a command or invoke a subsystem? */
53  int subsystem_flag = 0;
54  
55 +/* Enable sigpipe */
56 +int enable_sigpipe = 0;
57 +
58  /* # of replies received for global requests */
59  static int client_global_request_id = 0;
60  
61 @@ -161,6 +164,7 @@
62         fprintf(stderr, "  -F config   Config file (default: ~/%s).\n",
63              _PATH_SSH_USER_CONFFILE);
64         fprintf(stderr, "  -A          Enable authentication agent forwarding.\n");
65 +       fprintf(stderr, "  -B          Enable SIGPIPE processing.\n");
66         fprintf(stderr, "  -a          Disable authentication agent forwarding (default).\n");
67  #ifdef AFS
68         fprintf(stderr, "  -k          Disable Kerberos ticket and AFS token forwarding.\n");
69 @@ -275,7 +279,7 @@
70  
71  again:
72         while ((opt = getopt(ac, av,
73 -           "1246ab:c:e:fgi:kl:m:no:p:qstvxACD:F:I:L:NPR:TVX")) != -1) {
74 +           "1246ab:c:e:fgi:kl:m:no:p:qstvxABCD:F:I:L:NPR:TVX")) != -1) {
75                 switch (opt) {
76                 case '1':
77                         options.protocol = SSH_PROTO_1;
78 @@ -314,6 +318,9 @@
79                 case 'A':
80                         options.forward_agent = 1;
81                         break;
82 +               case 'B':
83 +                       enable_sigpipe = 1;
84 +                       break;
85  #ifdef AFS
86                 case 'k':
87                         options.kerberos_tgt_passing = 0;
This page took 0.040562 seconds and 3 git commands to generate.