]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/mgetty/mgetty-1.1.30/debian.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / mgetty / mgetty-1.1.30 / debian.patch
1 --- mgetty-1.1.30.orig/doc/faxrunqd.8in
2 +++ mgetty-1.1.30/doc/faxrunqd.8in
3 @@ -276,23 +276,25 @@
4  behaviour, you can send it the following signals:
5  
6  .TP
7 -.B SIGHUP
8 -.TP
9  .B SIGINT
10  .TP
11  .B SIGTERM
12  remove lock file, remove pid file, terminate immediately.
13  
14  .TP
15 +.B SIGHUP
16 +finish all fax jobs that are currently being sent, then terminate  (this
17 +is used to signal faxrunqd "I want you to terminate" without disturbing
18 +the normal flow of operation - SIGINT/TERM etc. can lead to some faxes being
19 +sent twice).
20 +
21 +.TP
22  .B SIGUSR1
23  close, roll, and re-open log file.
24  
25  .TP
26  .B SIGUSR2
27 -finish all fax jobs that are currently being sent, then terminate  (this
28 -is used to signal faxrunqd "I want you to terminate" without disturbing
29 -the normal flow of operation - SIGHUP etc. can lead to some faxes being
30 -sent twice).
31 +dump current modem success/failure statistics to log file.
32  
33  .IX fax
34  .SH BUGS
35 --- mgetty-1.1.30.orig/doc/mgetty.8in
36 +++ mgetty-1.1.30/doc/mgetty.8in
37 @@ -42,10 +42,13 @@
38  .B -p <login prompt>
39  Use the given string to prompt users for their login names. Various
40  tokens are allowed in this string. These tokens are: @ for the system
41 -name, \\n, \\r, \\g, \\v, \\f, \\t for newline, carriage return, bell,
42 -vertical tab, form feed, and tab, respectively. \\P and \\L will expand to
43 -the tty name ("ttyS0"). \\I will give the "CONNECT foobar" string returned
44 +name, \\n, \\r, \\g, \\b, \\v, \\f, \\t for newline, carriage return, bell,
45 +backspace, vertical tab, form feed, and tab, respectively.
46 +\\P and \\L will expand to the tty name ("ttyS0"). \\Y will give the Caller
47 +ID, \\I the "CONNECT foobar" string returned
48  by the modem, and \\S will output the port speed.
49 +\\s, \\m, \\V, \\R represent the operating system, the hardware name,
50 +the OS version, the OS release.
51  \\N and \\U give the number of users currently logged in.
52  \\C will be changed into the result of ctime(), and \\D and \\T will
53  output the date and time, respectively. Finally, \\<digit> will use digit
54 --- mgetty-1.1.30.orig/doc/mgetty.texi-in
55 +++ mgetty-1.1.30/doc/mgetty.texi-in
56 @@ -1,6 +1,6 @@
57  \input texinfo    @c -*-texinfo-*-
58  @c %**start of header
59 -@c $Id: mgetty.texi-in,v 4.58 2002/11/17 21:19:45 gert Exp $ (c) 1993-2000 Gert Doering and Klaus Weidner
60 +@c $Id: mgetty.texi-in,v 4.59 2003/04/06 14:09:09 gert Exp $ (c) 1993-2000 Gert Doering and Klaus Weidner
61  @setfilename mgetty.info
62  @settitle mgetty + sendfax
63  @c %**end of header
64 @@ -1096,6 +1096,9 @@
65  @samp{/etc/issue}.  Some special characters are substituted by connect
66  speed, date, etc. - see below (login-prompt) for a list.
67  
68 +Note: maximum line length after substitution is 300 characters, so be 
69 +careful with ASCII art banners with lots of color settings and such.
70 +
71  @item @code{prompt-waittime} @var{msecs}
72  
73  This specifies how long @code{mgetty} will wait for modem and line to
74 @@ -1117,6 +1120,10 @@
75  @item \b backspace (ascii 010)
76  @item \f form feed (ascii 013)
77  @item \t TAB
78 +@item \s operating system (OS)
79 +@item \m hardware name
80 +@item \V OS version
81 +@item \R OS release
82  @item \P (and \L) port name (e.g. ttyS0)
83  @item \C date and time, in "ctime()" format
84  @item \I Connection string (e.g. 2400/REL)
85 @@ -1128,7 +1135,7 @@
86  @item \@var{digit} character with the specified octal code
87  @end itemize
88  
89 -The maximum lenght of the login prompt is limited to 140 characters (after
90 +The maximum lenght of the login prompt is limited to 300 characters (after
91  expansion).
92  
93  @item @code{login-time} @var{secs}
94 @@ -3039,11 +3046,22 @@
95  implemented since Linux 2.4.10, or in earlier Versions with Jan
96  Oberlaender's patch
97  (http://www.stud.uni-karlsruhe.de/~uslk/i4l-callednumber.tar.gz).
98 +(@strong{NOTE}: This doesn't seem to work for at least Linux 2.4.20
99 +as shipped by RedHat 8.0 - anyone with some details??!)
100  
101  Alternatively, you can set @code{ATS23.0=1}. This will make i4l signal
102 -the dialed MSN number as @code{RING/12345}.  Unfortunately, it will be
103 -recognized by mgetty as caller ID, not destination MSN, so you might need
104 -to do some fiddling with 'ring.c' to get this fixed.
105 +the dialed MSN number as @code{RING/12345}.  This was problematic in the
106 +past, as lots of other modems have a similar format to report the Caller ID
107 +(like @code{RING;4321} in ELSA modems) but recent mgetty versions handle 
108 +this properly.  With this, you can run a single mgetty instance for all
109 +your telephone numbers: just set @code{AT&L*} in your init string - this
110 +tells isnd4linux that @strong{all} incoming calls are to be signalled
111 +to mgetty, not only specific MSN.
112 +
113 +@c init-chat "" ATZ OK AT&L* OK ATS23.0=1S23.2=1S0=0 OK
114 +@c fax-only yes
115 +@c rings 2
116 +@c modem-quirks 1
117  
118  For the full list of available AT commands, consult the i4l docs
119  (for example in @file{/usr/src/linux/Documentation/isdn/README}.
120 @@ -3063,8 +3081,9 @@
121  
122  There's a small catch: modem autodetection will make mgetty think that
123  your ttyI device doesn't support fax (because most cards can't do it).  So 
124 -you need to set @code{modem-type c2.0} in @file{mgetty.config} and/or
125 -@file{sendfax.config} to force class 2.0 mode.
126 +you need to set @code{modem-type cls} in @file{mgetty.config} and/or
127 +@file{sendfax.config} to force class 2 mode.  Class 2.0 mode is not
128 +supported.
129  
130  Voice support with @code{vgetty} should work (use your ttyI device 
131  as an answering machine, etc.).  I have not tried it yet - talk to the
132 --- mgetty-1.1.30.orig/fax/faxspool.in
133 +++ mgetty-1.1.30/fax/faxspool.in
134 @@ -3,7 +3,7 @@
135  # faxspool - sample script how to spool fax input data to a spool
136  #            directory, creating jobs to be run by faxrunq
137  #
138 -# sccsid: $Id: faxspool.in,v 4.22 2002/11/23 15:14:57 gert Exp $ (c) Gert Doering
139 +# sccsid: $Id: faxspool.in,v 4.25 2003/06/28 20:44:04 gert Exp $ (c) Gert Doering
140  #
141  # syntax: faxspool [flags] <phone-number> <job(s)>
142  #
143 @@ -26,6 +26,15 @@
144  #  3.10.93: use "hp2hig3" for hp-pcl4-files (cl)
145  # 19.10.93: phone directories (caz)
146  # $Log: faxspool.in,v $
147 +# Revision 4.25  2003/06/28 20:44:04  gert
148 +# reset umask after creating temp directory
149 +#
150 +# Revision 4.24  2003/04/09 21:05:14  gert
151 +# fix case of "faxing without header" (-h -) - wasn't copying G3 files
152 +#
153 +# Revision 4.23  2003/01/21 13:27:12  gert
154 +# abort if input file names contain whitespace or quote characters
155 +#
156  # Revision 4.22  2002/11/23 15:14:57  gert
157  # revert 4.14 -> 4.15 change: faxqueue_done is now back in $FAX_SPOOL_OUT
158  # (new permission concept, faxrunq/faxrunqd no longer running as root)
159 @@ -577,11 +586,15 @@
160  fi
161  
162  #
163 -# check, if all the files exist & are readable
164 +# check, if all the file names are "clean", that the files exist & are readable
165  #
166  
167  for file
168  do
169 +    if [ `echo "$file" | tr -d ' \011\012\015\047\140"' ` != "$file" ]
170 +    then
171 +       $echo "$0: invalid characters in file name '$file'!" >&2 ; exit 5
172 +    fi
173      if [ ! -r $file -a x$file != x- ]
174      then
175         $echo "$0: cannot open '$file'!" >&2 ; exit 5
176 @@ -617,12 +630,14 @@
177  #
178  spooldir=${TMP:-/tmp}/$new_seq.$$.`date +%S`
179  
180 +oldumask=`umask`
181  umask 077
182  if mkdir $spooldir ; then
183      $echo "spooling to $spooldir (->$new_seq)..."
184  else
185      $echo "ERROR: can't create work dir '$spooldir', giving up" >&2 ; exit 6
186  fi
187 +umask $oldumask
188  
189  #
190  # process all input files
191 @@ -847,22 +862,23 @@
192  fi
193  
194  #      
195 -# concatenate header with pages
196 +# concatenate header with pages (optionally) and copy over to spool dir
197  #
198 -if [ -z "$FAX_HEADER" ]
199 +if [ -n "$FAX_HEADER" ]
200  then
201 -    finalpg="$pages"                           # don't :)
202 -else
203      $echo "\nPutting Header lines on top of pages..."
204  
205      hdrfont=$PBMFONT_HEADER_F
206      test -z "$normal_res" || hdrfont=$PBMFONT_HEADER_N
207 +fi
208  
209 -    finalpg=""
210 -    for f in $pages
211 -    do
212 +finalpg=""
213 +for f in $pages
214 +do
215         nr=`expr $nr + 1`
216  
217 +    if [ -n "$FAX_HEADER" ]
218 +    then
219         cat $FAX_HEADER | sed -e "s;@T@;$phone;g" -e "s;@P@;$nr;g" \
220                               -e "s;@M@;$maxnr;g" -e "s;@U@;$USER;g" \
221                               -e "s;@N@;$FULLNAME;g" \
222 @@ -873,9 +889,13 @@
223         | g3cat - $f | \
224         $FAXQ_HELPER input $new_seq f$nr.g3 \
225         && rm $f
226 +    else
227 +       g3cat $f | \
228 +       $FAXQ_HELPER input $new_seq f$nr.g3 \
229 +       && rm $f
230 +    fi
231         finalpg="$finalpg f$nr.g3"
232 -    done
233 -fi                             # end "if ! -z $FAX_HEADER"
234 +done
235  
236  if [ -z "$finalpg" -a -z "$poll_req" ]
237  then
238 --- mgetty-1.1.30.orig/fax/faxrunqd.in
239 +++ mgetty-1.1.30/fax/faxrunqd.in
240 @@ -9,10 +9,19 @@
241  #
242  # initial version: Feb 17, 1997
243  #
244 -$rcs_id='RCS: $Id: faxrunqd.in,v 1.63 2002/11/23 16:52:18 gert Exp $';
245 +$rcs_id='RCS: $Id: faxrunqd.in,v 1.65 2003/01/14 14:16:09 gert Exp $';
246  #
247  # Change Log:
248 +#
249  # $Log: faxrunqd.in,v $
250 +# Revision 1.65  2003/01/14 14:16:09  gert
251 +# include "total success" counter in the per_phone_statistics
252 +#
253 +# Revision 1.64  2003/01/07 14:48:52  gert
254 +# If a job is re-queued, heavily penalize previously used modem.
255 +# This way, a defective modem (or a modem that has problems connecting to
256 +# just a few destination numbers) has less impact on overall stability.
257 +#
258  # Revision 1.63  2002/11/23 16:52:18  gert
259  # make messages more clear, print warning if running as root
260  #
261 @@ -608,6 +617,7 @@
262  #   - no other job for this phone number already queued
263  #   - this modem must be allowed for that job
264  #   - if multiple queues allowed, take the shortest one
265 +#   - the modem used previously is heavily penalized
266  #
267  # called whenever a job's $queue{$job}->{status} changes to 'active'
268  #
269 @@ -661,6 +671,9 @@
270                                @{$queue{$j}->{ttys}} : @standard_ttys;
271  
272      # find tty with the shortest queue (among those that are allowed)
273 +    #
274 +    # the previously used modem always gets a queue len of "9998", and is 
275 +    # thus only used if no other modem is available
276      my $min_l = 9999;
277      my $min_t = $ttys[0];
278  
279 @@ -674,9 +687,12 @@
280             $tty_in_use{$t}=0;
281         }
282  
283 -       if ( $mq_length{$t}+$mq_badness{$t} < $min_l )
284 +       my $this_q_len = ( $t eq $queue{$j}->{last_modem} ) ? 9998 :
285 +                               $mq_length{$t}+$mq_badness{$t};
286 +
287 +       if ( $this_q_len < $min_l )
288         {
289 -           $min_l = $mq_length{$t}+$mq_badness{$t}; $min_t = $t;
290 +           $min_l = $this_q_len; $min_t = $t;
291         }
292      }
293  
294 @@ -701,7 +717,7 @@
295      $queue{$j}->{weight} = 1 + scalar( @{$queue{$j}->{pages}} );
296      $mq_length{$min_t} += $queue{$j}->{weight};
297  
298 -    print LOG "$j: possible ttys: " . join( ':', @ttys ) . " -> queue selected: $min_t (l: $min_l->" . $mq_length{$min_t} . ")\n"  if $opt_d;
299 +    print LOG "$j: possible ttys: " . join( ':', @ttys ) . " last: ". $queue{$j}->{last_modem} . " -> queue selected: $min_t (l: $min_l->" . $mq_length{$min_t} . ")\n"  if $opt_d;
300  
301      # rotate @standard_ttys, to distribute load more evenly among modems
302      push @standard_ttys, (shift @standard_ttys);
303 @@ -804,6 +820,7 @@
304         }
305  
306         $queue{$job}->{'tries'} = $queue{$job}->{'tries_c'} = 0;
307 +       $queue{$job}->{'last_modem'} = 'unknown';
308  
309         while( <J> )
310         {
311 @@ -1264,15 +1281,13 @@
312      $tty_statistics{$t}{total}++;
313      $tty_statistics{$t}{$ex}++;
314  
315 -    # and, in case of errors, for per-remote-phone statistics
316 -    if ( $ex > 0 )
317 -    {
318 +    # and for per-remote-phone statistics
319          my $ph = $queue{$j}->{'phone'};
320 -       if ( ! defined( $per_phone_statistics{$ph} ) || 
321 -            ! defined( $per_phone_statistics{$ph}{$ex} ) )
322 +    if ( ! defined( $per_phone_statistics{$ph} ) )
323 +           { $per_phone_statistics{$ph}{0} = 0; }
324 +    if ( ! defined( $per_phone_statistics{$ph}{$ex} ) )
325                 { $per_phone_statistics{$ph}{$ex} = 0; }
326         $per_phone_statistics{$ph}{$ex}++;
327 -    }
328  
329      # now handle return codes.  This is tricky if multiple jobs have been 
330      # combined into one sendfax call - might have failed in the middle...
331 @@ -1443,6 +1458,9 @@
332         my $fstr = ( $ex<10 )? "failed" : "FATAL FAILURE";
333         &wstat( $j, "Status " . localtime() . " $fstr, exit($ex): $verb_ex\n");
334  
335 +       # remember tty used (try to get another one for next call)
336 +       $queue{$j}->{last_modem} = $tty;
337 +
338         # write acct.log
339         &wacct($j, "fail $ex: $verb_ex");
340  
341 @@ -1704,7 +1722,7 @@
342      foreach $t (keys %tty_statistics)
343      {
344         print LOG "modem statistics for tty '$t'\n";
345 -       print LOG "    total faxes sent: ${tty_statistics{$t}{'total'}}\n";
346 +       print LOG "    total fax calls : ${tty_statistics{$t}{'total'}}\n";
347         print LOG "    total success   : ${tty_statistics{$t}{'0'}}\n";
348         foreach (sort(keys %{$tty_statistics{$t}}))
349         {
350 @@ -1719,8 +1737,10 @@
351      foreach $t (sort (keys %per_phone_statistics))
352      {
353         print LOG "error statistics for remote number '$t'\n";
354 +       print LOG "    total success   : ${per_phone_statistics{$t}{'0'}}\n";
355         foreach (sort(keys %{$per_phone_statistics{$t}}))
356         {
357 +           next if ( $_ eq '0' );
358              printf LOG "    error code %-2d   : %d [%s]\n",
359                 $_, $per_phone_statistics{$t}{$_}, 
360                 $exitcodes[$_];
361 --- mgetty-1.1.30.orig/fax/faxrm.in
362 +++ mgetty-1.1.30/fax/faxrm.in
363 @@ -7,7 +7,7 @@
364  # There are still a lot rough edges - but it works, and should give you an
365  # idea how to improve it
366  #
367 -# SCCS: $Id: faxrm.in,v 4.5 2002/11/16 22:16:51 gert Exp $ Copyright (C) 1994 Gert Doering
368 +# SCCS: $Id: faxrm.in,v 4.6 2003/02/04 16:46:36 gert Exp $ Copyright (C) 1994 Gert Doering
369  
370  FAX_SPOOL=@FAX_SPOOL@
371  FAX_SPOOL_OUT=@FAX_SPOOL_OUT@
372 @@ -16,7 +16,7 @@
373  echo="@ECHO@"
374  #
375  # helper program for privileged queue access
376 -FAXQ_HELPER=/usr/local/lib/mgetty+sendfax/faxq-helper
377 +FAXQ_HELPER=@LIBDIR@/faxq-helper
378  #
379  
380  if [ ! -d $FAX_SPOOL_OUT ]
381 --- mgetty-1.1.30.orig/fax/faxq-helper.c
382 +++ mgetty-1.1.30/fax/faxq-helper.c
383 @@ -71,6 +71,8 @@
384  int    fax_out_uid;            /* user ID to chown() fax jobs to */
385  int    fax_out_gid;            /* group ID ... */
386  
387 +#define        ROOT_UID        0       /* root's user ID - override checks */
388 +
389  #define FAX_SEQ_FILE   ".Sequence"
390  #define FAX_SEQ_LOCK   "LCK..seq"
391  
392 @@ -370,7 +372,7 @@
393  
394      while( *p != '\0' )
395      {
396 -       if ( *p != '.' && *p != ':' && ! isalnum(*p) )
397 +       if ( *p == '/' || *p == '\\' || isspace(*p) || !isprint(*p) )
398         {
399             eout( "invalid char. '%c' in file name '%s', abort\n",
400                   *p, outfilename );
401 @@ -386,7 +388,7 @@
402  
403      sprintf( pathbuf, "%s/%s", dir1, outfilename );
404  
405 -    fd = open( pathbuf, O_WRONLY | O_CREAT | O_EXCL, 0600 );
406 +    fd = open( pathbuf, O_WRONLY | O_CREAT | O_EXCL, 0644 );
407      if ( fd < 0 )
408      {
409         eout( "can't open '%s' for writing: %s\n", pathbuf, strerror(errno));
410 @@ -543,6 +545,9 @@
411  
412      sprintf( buf, "%s/JOB", dir1 );
413  
414 +    /* the JOB file has to be world-readable, relax umask */
415 +    umask( 0022 );
416 +
417  /* TODO: check if this portably catches symlinks to non-existant files! */
418      if ( ( fd = open( buf, O_WRONLY | O_CREAT | O_EXCL, 0644 ) ) < 0 )
419      {
420 @@ -571,7 +576,8 @@
421  
422         if ( strncmp(buf, "user ", 5) == 0 )
423         {
424 -           if ( strcmp( buf+5, real_user_name ) != 0 )
425 +           if ( real_user_id != ROOT_UID &&
426 +                strcmp( buf+5, real_user_name ) != 0 )
427             {
428                 eout( "user name mismatch (%s <-> %s)\n", buf+5, real_user_name );
429                 break;
430 @@ -678,7 +684,8 @@
431  
432         if ( strncmp(buf, "user ", 5) == 0 )
433         {
434 -           if ( strcmp( buf+5, real_user_name ) != 0 )
435 +           if ( real_user_id != ROOT_UID &&
436 +                strcmp( buf+5, real_user_name ) != 0 )
437             {
438                 fprintf( stderr, "%s: not your job, can't do anything (%s <-> %s)\n", jfile, buf+5, real_user_name );
439                 unlink( lfile );
440 @@ -803,8 +810,11 @@
441  
442      /* common things to check and prepare */
443  
444 -    /* directories and JOB files have to be readable */
445 -    umask(0022);
446 +    /* make sure people do not play umask tricks on us - the only
447 +     * bits that are accepted in a user umask are "044" - permit/prevent 
448 +     * read access by group/other.  Write access is always denied.
449 +     */
450 +    umask( ( umask(0) & 0044 ) | 0022 );
451  
452      /* get numeric uid/gid for fax user */
453      pw = getpwnam( FAX_OUT_USER );
454 --- mgetty-1.1.30.orig/TODO
455 +++ mgetty-1.1.30/TODO
456 @@ -352,6 +352,8 @@
457  246) fix "RING/<msn>" handling for i4l
458  
459  248) include script to rotate/move log files on a regular basis
460 +     (base on contrib/mvlog, move to tools/, run through sedscript for
461 +     location and naming for the log files)
462  
463  250) move prototype for time() to mgetty.h, remove everywhere else
464  
465 @@ -373,3 +375,37 @@
466  
467  257) generalize calling $(MAKE) in subdirs - put all $(MAKE) arguments
468       in one common variable
469 +
470 +261) faxrunqd: don't count "modem locked" as "failure" for a given job
471 +     (but *do* delay by a certain time)
472 +     (hmmm - maybe not.  If all modems are locked for a long period of
473 +     time, it might be useful to flag the fax as "failed" to get people to
474 +     notice.  Combine with 259 - should resolve problem)
475 +
476 +262) faxrunqd: smarter algorithm for "modem is broken"
477 +     (locked = doesn't count, can't init = +1, NO CARRIER = +0.2)
478 +
479 +263) faxspool.rules: add sample mappings for PDF (via acroread, xpdf,
480 +     recent ghostscript versions)
481 +
482 +264) faxrunqd: timeout on "hanging" sendfax processes
483 +     (timeout > 15 min + 5 minutes * number of pages, or something like that)
484 +
485 +265) faxrunqd: write tty to acct.log (format change / WEB gui)
486 +
487 +260) faxrunqd: bump up priority of "exit 12" jobs
488 +266) faxunrqd: if a job fails half-way through (12), increase priority
489 +     to re-send missing parts quickly
490 +
491 +267) faxrunqd: sort per-modem statistics numerically (watchout: "total")
492 +
493 +268) faxrunq+faxrunqd: have configurable counters for 
494 +        "send-a-warning after <x> tries, fail after <y>"
495 +     have separate counter for "modem-locked"
496 +              costing-failures    tries-except-modem-locked    total-tries
497 +       warning        -                     10                    10
498 +       failure        5                     30                   100
499 +
500 +269) faxrunqd: have configurable threshold for "everything is broken"
501 +     -> if that threshold is reached, generate STOP file, warning e-mail, 
502 +     and suspend itself  (like "the local in-house PABX is broken")
503 --- mgetty-1.1.30.orig/Makefile
504 +++ mgetty-1.1.30/Makefile
505 @@ -1,6 +1,6 @@
506  # Makefile for the mgetty fax package
507  #
508 -# SCCS-ID: $Id: Makefile,v 4.56 2002/12/16 13:08:23 gert Exp $ (c) Gert Doering
509 +# SCCS-ID: $Id: Makefile,v 4.58 2003/06/12 07:52:51 gert Exp $ (c) Gert Doering
510  #
511  # this is the C compiler to use (on SunOS, the standard "cc" does not
512  # grok my code, so please use gcc there. On ISC 4.0, use "icc".).
513 @@ -213,6 +213,7 @@
514  FAX_SPOOL_OUT=$(FAX_SPOOL)/outgoing
515  #
516  # the user that owns the "outgoing fax queue" (FAX_SPOOL_OUT)
517 +# this user must exist in the system, otherwise faxspool will not work!
518  #
519  # faxrunq and faxrunqd should run under this user ID, and nothing else.  
520  # This user needs access to the modems of course.  
521 @@ -300,8 +301,8 @@
522  # Nothing to change below this line ---------------------------------!
523  #
524  MR=1.1
525 -SR=30
526 -DIFFR=1.1.29
527 +SR=31
528 +DIFFR=1.1.30
529  #
530  #
531  OBJS=mgetty.o logfile.o do_chat.o locks.o utmp.o logname.o login.o \
532 @@ -511,7 +512,7 @@
533         ssh home.leo.org -l doering 'cd $$HOME ; ./beta'
534  
535  # send to Marc and Knarf
536 -       head -30 ChangeLog |mail -s "mgetty$(MR).$(SR).tar.gz on greenie/alpha" knarf@camelot.de marc marcs
537 +       head -30 ChangeLog |mail -s "mgetty$(MR).$(SR).tar.gz on greenie/alpha" mgetty@knarf.de marc marcs
538  #      -./ftp.sh $(MR).$(SR) ftp.camelot.de /pub/incoming
539  #      -./ftp.sh $(MR).$(SR) poseidon.thphy.uni-duesseldorf.de /incoming
540  
541 @@ -600,9 +601,9 @@
542  # data files + directories
543  #
544         test -d $(LIBDIR)  || \
545 -               ( ./mkidirs $(LIBDIR) ; chmod 755 $(LIBDIR) )
546 +               ( ./mkidirs $(LIBDIR) &&  chmod 755 $(LIBDIR) )
547         test -d $(CONFDIR) || \
548 -               ( ./mkidirs $(CONFDIR); chmod 755 $(CONFDIR))
549 +               ( ./mkidirs $(CONFDIR) && chmod 755 $(CONFDIR))
550         test -f $(CONFDIR)/login.config || \
551                 $(INSTALL) -o root -m 600 login.config $(CONFDIR)/
552         test -f $(CONFDIR)/mgetty.config || \
553 @@ -627,17 +628,17 @@
554  # fax spool directories
555  #
556         test -d $(spool) || \
557 -               ( mkdir $(spool) ; chmod 755 $(spool) )
558 +               ( mkdir $(spool) && chmod 755 $(spool) )
559         test -d $(FAX_SPOOL) || \
560 -               ( mkdir $(FAX_SPOOL) ; \
561 -                 chown $(FAX_OUT_USER) $(FAX_SPOOL) ; \
562 +               ( mkdir $(FAX_SPOOL) && \
563 +                 chown $(FAX_OUT_USER) $(FAX_SPOOL) && \
564                   chmod 755 $(FAX_SPOOL) )
565         test -d $(FAX_SPOOL_IN) || \
566 -               ( mkdir $(FAX_SPOOL_IN) ; chmod 755 $(FAX_SPOOL_IN) )
567 +               ( mkdir $(FAX_SPOOL_IN) && chmod 755 $(FAX_SPOOL_IN) )
568         test -d $(FAX_SPOOL_OUT) || \
569 -               ( mkdir $(FAX_SPOOL_OUT) ; \
570 -                 chown $(FAX_OUT_USER) $(FAX_SPOOL_OUT) ; \
571 -                 chmod 755 $(FAX_SPOOL_OUT) )
572 +                 mkdir $(FAX_SPOOL_OUT)
573 +       chown $(FAX_OUT_USER) $(FAX_SPOOL_OUT)
574 +       chmod 755 $(FAX_SPOOL_OUT)
575  #
576  # g3 tool programs
577  #
578 --- mgetty-1.1.30.orig/voice/libutil/access.c
579 +++ mgetty-1.1.30/voice/libutil/access.c
580 @@ -5,7 +5,7 @@
581   * exactly one unnested call to voice_desimpersonify() for each
582   * voice_impersonify() because of the static umask below.
583   *
584 - * $Id: access.c,v 1.2 1999/07/04 07:15:52 marcs Exp $
585 + * $Id: access.c,v 1.3 2003/04/23 08:49:16 gert Exp $
586   *
587   */
588  
589 @@ -32,14 +32,14 @@
590             &gid);
591  
592     if (setegid(gid)) {
593 -      lprintf(L_WARN, "%s: cannot set effective GID to %d",
594 -             program_name, gid);
595 +      lprintf(L_WARN, "%s: cannot set effective GID to %d: %s",
596 +             program_name, gid, strerror(errno));
597        return 0;
598     }
599  
600     if (seteuid(uid)) {
601 -      lprintf(L_WARN, "%s: cannot set effective UID to %d",
602 -             program_name, uid);
603 +      lprintf(L_WARN, "%s: cannot set effective UID to %d: %s",
604 +             program_name, uid, strerror(errno));
605        return 0;
606     }
607  
608 @@ -52,14 +52,14 @@
609  
610  int voice_desimpersonify(void) {
611     if (seteuid(getuid())) {
612 -      lprintf(L_WARN, "%s: cannot switch back to effective UID %d",
613 -             program_name, getuid());
614 +      lprintf(L_WARN, "%s: cannot switch back to effective UID %d: %s",
615 +             program_name, getuid(), strerror(errno));
616        return 0;
617     }
618  
619     if (setegid(getgid())) {
620 -      lprintf(L_WARN, "%s: cannot switch back to effective GID %d",
621 -             program_name, getgid());
622 +      lprintf(L_WARN, "%s: cannot switch back to effective GID %d: %s",
623 +             program_name, getgid(), strerror(errno));
624        return 0;
625     }
626  
627 --- mgetty-1.1.30.orig/voice/libvoice/V253modem.c
628 +++ mgetty-1.1.30/voice/libvoice/V253modem.c
629 @@ -16,7 +16,7 @@
630    Hint: Recorded voice files are in .ub format (refer to the sox manpage about this) except the header.
631          So you can use this files with sox.
632   *
633 - * $Id: V253modem.c,v 1.6 2002/11/25 21:14:51 gert Exp $
634 + * $Id: V253modem.c,v 1.7 2003/01/08 22:03:18 gert Exp $
635   *
636   */
637  
638 @@ -352,7 +352,7 @@
639  
640  /* Only verifies the RMD name */
641  #define V253modem_RMD_NAME "V253modem"
642 -#define ELSA_RMD_NAME "ELSA"
643 +#define ELSA_RMD_NAME "Elsa"
644  int V253_check_rmd_adequation(char *rmd_name) 
645  {
646     return !strncmp(rmd_name,
647 --- mgetty-1.1.30.orig/faxrecp.c
648 +++ mgetty-1.1.30/faxrecp.c
649 @@ -94,13 +94,13 @@
650  
651  #ifdef SHORT_FILENAMES
652      sprintf(temp, "%s/f%c%07x%s.%02d", directory,
653 -                fax_par_d.vr == 0? 'n': 'f',
654 +                (fax_par_d.vr == 0 || fax_par_d.vr == 8) ? 'n': 'f',
655                  (int) call_start & 0xfffffff,
656                  DevId, pagenum );
657  #else
658      /* include sender's fax id - if present - into filename */
659      sprintf(temp, "%s/f%c%07x%s-", directory,
660 -               fax_par_d.vr == 0? 'n': 'f',
661 +               (fax_par_d.vr == 0 || fax_par_d.vr == 8) ? 'n': 'f',
662                 (int) call_start & 0xfffffff,
663                 DevId );
664      i = strlen(temp);
665 --- mgetty-1.1.30.orig/logfile.c
666 +++ mgetty-1.1.30/logfile.c
667 @@ -3,13 +3,6 @@
668  #include <stdio.h>
669  #include <unistd.h>
670  #include <fcntl.h>
671 -#ifdef USE_VARARGS
672 -# if !defined(NeXT) || defined(NEXTSGTTY)
673 -#  include <varargs.h>
674 -# endif
675 -#else
676 -# include <stdarg.h>
677 -#endif
678  #include <sys/types.h>
679  #include <time.h>
680  #include <errno.h>
681 @@ -19,6 +12,15 @@
682  #include "mgetty.h"
683  #include "policy.h"
684  
685 +/* this must be included after ugly.h (sets USE_VARARGS on non-ANSI cc's) */
686 +#ifdef USE_VARARGS
687 +# if !defined(NeXT) || defined(NEXTSGTTY)
688 +#  include <varargs.h>
689 +# endif
690 +#else
691 +# include <stdarg.h>
692 +#endif
693 +
694  #ifdef SYSLOG
695  #include <syslog.h>
696  
697 --- mgetty-1.1.30.orig/faxlib.c
698 +++ mgetty-1.1.30/faxlib.c
699 @@ -178,8 +178,10 @@
700  
701             if ( line[ix+1] == ',' &&           /* +FPS:s,lc,blc */
702                  sscanf( &line[ix+2],
703 -                        (modem_type==Mt_class2_0)?"%x,%x,%x,%x"
704 -                                                 :"%d,%d,%d,%d",
705 +                        ( modem_type == Mt_class2 || 
706 +                         (modem_quirks & MQ_FPS_NOT_HEX) )
707 +                                                 ?"%d,%d,%d,%d"
708 +                                                 :"%x,%x,%x,%x",
709                          &fhs_lc, &fhs_blc, &fhs_cblc, &fhs_lbc ) >= 2 )
710             {
711                 lprintf( L_NOISE, "%d lines received, %d lines bad, %d bytes lost", fhs_lc, fhs_blc, fhs_lbc );
712 @@ -636,7 +638,7 @@
713           case 1445:
714             lprintf( L_MESG, "USR Courier/Sportster v32bis detected (buggy fax implementation)" );
715             modem_type=Mt_class2_0;
716 -           modem_quirks |= MQ_USR_FMINSP;
717 +           modem_quirks |= MQ_USR_FMINSP | MQ_FPS_NOT_HEX;
718             break;
719           case 2886:
720           case 3361:
721 @@ -645,17 +647,20 @@
722           case 3367:
723             lprintf( L_MESG, "USR Courier/Sportster V.34(+) detected" );
724             modem_type=Mt_class2_0;
725 +           modem_quirks |= MQ_FPS_NOT_HEX;
726             mis = mdm_get_idstring( "ATI3", 1, fd );
727             break;
728           case 5601:
729           case 5607:
730             lprintf( L_MESG, "USR Courier/Sportster 56k detected" );
731             modem_type=Mt_class2_0;
732 +           modem_quirks |= MQ_FPS_NOT_HEX;
733             mis = mdm_get_idstring( "ATI3", 1, fd );
734             break;
735           case 6401:
736             lprintf( L_MESG, "USR I-Modem detected" );
737             modem_type=Mt_class2_0;
738 +           modem_quirks |= MQ_FPS_NOT_HEX;
739             mis = mdm_get_idstring( "ATI3", 1, fd );
740             break;
741           case 62:      /* sure? */
742 @@ -813,6 +818,7 @@
743         {
744             lprintf( L_MESG, "USR Courier/Sportster V90 (national variant?) detected" );
745             modem_type=Mt_class2_0;
746 +           modem_quirks |= MQ_FPS_NOT_HEX;
747             mis = mdm_get_idstring( "ATI3", 1, fd );
748         }
749         /* grrr, another one of those - Bill Nugent <whn@topelo.lopi.com> */
750 @@ -835,6 +841,12 @@
751             modem_type=Mt_class2;
752             modem_quirks |= MQ_NEED2;
753         }
754 +       else if ( strncmp( l, "LT V.92", 7 ) == 0 )     /* gert */
755 +       {
756 +           lprintf( L_MESG, "Multitech MT5634ZBA-V92 detected" );
757 +           modem_type=Mt_class2_0;
758 +           modem_quirks |= MQ_FPS_NOT_HEX;
759 +       }
760      }
761  
762      if ( mis != NULL ) 
763 --- mgetty-1.1.30.orig/faxrec.c
764 +++ mgetty-1.1.30/faxrec.c
765 @@ -208,7 +208,7 @@
766      fprintf( pipe_fp, "\nModem device: %s\n", Device );
767      fprintf( pipe_fp, "\nCommunication parameters: %s\n", fax_param );
768      fprintf( pipe_fp, "    Resolution : %s\n",
769 -                     fax_par_d.vr == 0? "normal" :"fine");
770 +             (fax_par_d.vr == 0 || fax_par_d.vr == 8) ? "normal" :"fine");
771      fprintf( pipe_fp, "    Bit Rate   : %d\n", ( fax_par_d.br+1 ) * 2400 );
772      fprintf( pipe_fp, "    Page Width : %d pixels\n", fax_par_d.wd == 0? 1728:
773                       ( fax_par_d.wd == 1 ? 2048: 2432 ) );
774 --- mgetty-1.1.30.orig/logname.c
775 +++ mgetty-1.1.30/logname.c
776 @@ -51,7 +51,7 @@
777  
778  char * ln_escape_prompt _P1( (ep), char * ep )
779  {
780 -#define MAX_PROMPT_LENGTH 140
781 +#define MAX_PROMPT_LENGTH 300
782      static char * p = NULL;
783      int    i;
784      static struct utsname un;
785 @@ -191,7 +191,7 @@
786      
787      if ( *ep != 0 )
788      {
789 -       lprintf( L_WARN, "buffer overrun - input prompt too long" );
790 +       lprintf( L_WARN, "ln_escape_prompt: input line too long - data truncated" );
791      }
792  
793      return p;
794 --- mgetty-1.1.30.orig/README.1st
795 +++ mgetty-1.1.30/README.1st
796 @@ -72,7 +72,7 @@
797  
798  Generic questions ("it doesn't work") should go to the mgetty mailing list
799  (mgetty@muc.de), because I just don't have time to explain it all again
800 -and again.
801 +and again.  (Un-)Subscription is done via mgetty-request@muc.de.
802  
803  And... please do not forget that I'm doing this kind of support entirely
804  in my spare time - sometimes my answers will be very short, or it may
805 --- mgetty-1.1.30.orig/ugly.h
806 +++ mgetty-1.1.30/ugly.h
807 @@ -38,5 +38,10 @@
808  #define const
809  #define volatile
810  
811 +/* <stdarg.h> and function(fmt,...) is incompatible with K&R protoypes */
812 +#ifndef USE_VARARGS
813 +#  define USE_VARARGS
814 +#endif
815 +
816  #endif
817  
818 --- mgetty-1.1.30.orig/ChangeLog
819 +++ mgetty-1.1.30/ChangeLog
820 @@ -1,3 +1,79 @@
821 +Wed Aug 20 12:39:53 MEST 2003  Gert Doering (gert@greenie.muc.de)
822 +
823 +       * fax/faxrunqd.in: change signal handling - use HUP for graceful
824 +           exit, and dump statistics to logfile upon receipt of USR2
825 +
826 +Sat Jun 28 22:14:35 MEST 2003  Gert Doering (gert@greenie.muc.de)
827 +
828 +       * fax/faxq-helper.c: honour user umask when spooling G3 files
829 +         (user decides whether group/other can read faxes)
830 +
831 +       * fax/faxspoool.in: reset umask after creating tmpdir (with umask 077)
832 +
833 +       * fax/faxq-helper.c: file name validation was overly strict - 
834 +         accept anything that's printable, not a space, '/' or '\'
835 +
836 +Thu Jun 12 16:56:44 MEST 2003  Gert Doering (gert@greenie.muc.de)
837 +
838 +       * faxlib.c: Multitech and USR return class 2.0/2.1 +FPS:<x>,<lc>
839 +         values in decimal, not hex -> change +FPS: parser to do decimal
840 +         for those modems (via modem_quirks |= MQ_FPS_NOT_HEX)
841 +
842 +       * fax_lib.h: add MQ_FPS_NOT_HEX modem quirk bit
843 +
844 +       * faxrec.c, faxrecp.c: understand VR=8 for "normal mode" (200x100 dpi)
845 +
846 +Mon Apr 28 19:41:14 MEST 2003  Gert Doering (gert@greenie.muc.de)
847 +
848 +       * logname: make "buffer overrun" error message more precise
849 +
850 +Wed Apr 23 10:49:25 MEST 2003  John R. Jackson <jrj@purdue.edu>
851 +
852 +       * voice/libutil/access.c: more verbose error reporting
853 +
854 +Wed Apr  9 23:05:23 MEST 2003  Gert Doering (gert@greenie.muc.de)
855 +
856 +       * fax/faxspool.in: fix spooling without header line (-h -)
857 +
858 +Sun Apr  6 16:09:14 MEST 2003  Andreas Barth <aba@not.so.argh.org>
859 +
860 +       * mgetty.8in, mgetty.texi-in: document escape sequences for
861 +         /etc/issue and login prompt.
862 +
863 +Wed Mar  5 21:37:38 MET 2003  Gert Doering (gert@greenie.muc.de)
864 +
865 +       * Makefile: abort "make install" before installing faxspool
866 +         if fax user does not exist
867 +
868 +       * Makefile: unconditionally chown $FAX_SPOOL_OUT to fax user
869 +
870 +Tue Feb  4 17:46:45 MET 2003  Gert Doering (gert@greenie.muc.de)
871 +
872 +       * fax/faxq-helper.c: uid=0 overrides access permission checks
873 +
874 +       * fax/faxrm.in: bugfix: get faxq-helper path from sedscript
875 +
876 +Tue Jan 21 14:27:39 MET 2003  Gert Doering (gert@greenie.muc.de)
877 +
878 +       * fax/faxspool.in: abort with a proper error message on input file
879 +         names containing white space or quote characters
880 +
881 +Tue Jan 14 14:30:42 MET 2003  Gert Doering (gert@greenie.muc.de)
882 +
883 +       * fax/faxrunqd.in: include "success" counter in per_phone_statistics
884 +
885 +       * ugly.h: #define USE_VARARGS for non-Ansi C compilers
886 +
887 +       * logfile.c: change #include<> sequence to catch USE_VARARGS def.
888 +
889 +Wed Jan  8 23:03:26 MET 2003  Gert Doering (gert@greenie.muc.de)
890 +
891 +       * fax/faxrunqd.in: if a fax job fails, reschedule on different
892 +         modem (if possible)
893 +
894 +       * voice/libvoice/V253modem.c: fix ELSA_RMD_NAME (used for
895 +         V.253 modem <-> other modem RMD equivalency checks)
896 +
897  Mon Dec 16 14:08:06 MET 2002  Gert Doering (gert@greenie.muc.de)
898  
899         * release 1.1.30
900 --- mgetty-1.1.30.orig/version.h
901 +++ mgetty-1.1.30/version.h
902 @@ -1 +1 @@
903 -char * mgetty_version = "experimental test release 1.1.30-Dec16";
904 +char * mgetty_version = "experimental test release 1.1.31-Sep23";
905 --- mgetty-1.1.30.orig/fax_lib.h
906 +++ mgetty-1.1.30/fax_lib.h
907 @@ -102,3 +102,6 @@
908  #define MQ_NO_XON      0x08    /* do not wait for XON char when sending */
909  #define MQ_USR_FMINSP  0x20    /* USR: +FCC=1,<max> sets MIN speed instead */
910  #define MQ_SHOW_NSF    0x40    /* set AT+FNR=1,1,1,1 (with NSFs) */
911 +#define MQ_FPS_NOT_HEX 0x80    /* +FPS:<status>,<lc> reported as decimal */
912 +
913 +/* note: 0x100 and 0x200 currently used for teergrubing - faxrecp.c */