diff options
| author | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
|---|---|---|
| committer | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
| commit | 709c4d66e0b107ca606941b988bad717c0b45d9b (patch) | |
| tree | 37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/mgetty | |
| parent | fa6cd5a3b993f16c27de4ff82b42684516d433ba (diff) | |
rename packages/ to recipes/ per earlier agreement
See links below for more details:
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816
Signed-off-by: Denys Dmytriyenko <denis@denix.org>
Acked-by: Mike Westerhof <mwester@dls.net>
Acked-by: Philip Balister <philip@balister.org>
Acked-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Marcin Juszkiewicz <hrw@openembedded.org>
Acked-by: Koen Kooi <koen@openembedded.org>
Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/mgetty')
33 files changed, 3409 insertions, 0 deletions
diff --git a/recipes/mgetty/mgetty-1.1.30/00-g3_Makefile b/recipes/mgetty/mgetty-1.1.30/00-g3_Makefile new file mode 100644 index 0000000000..d12ead44b4 --- /dev/null +++ b/recipes/mgetty/mgetty-1.1.30/00-g3_Makefile @@ -0,0 +1,11 @@ +--- mgetty-1.1.27.orig/g3/Makefile ++++ mgetty-1.1.27/g3/Makefile +@@ -5,7 +5,7 @@ + # + + CC=gcc +-CFLAGS=-O2 -I.. -g ++CFLAGS=-O2 -I.. #-g + + G3_PROGRAMS=pbm2g3 g3cat g32pbm + diff --git a/recipes/mgetty/mgetty-1.1.30/01-adjust-path b/recipes/mgetty/mgetty-1.1.30/01-adjust-path new file mode 100644 index 0000000000..9ea223f6d3 --- /dev/null +++ b/recipes/mgetty/mgetty-1.1.30/01-adjust-path @@ -0,0 +1,113 @@ +--- mgetty-1.1.27.orig/frontends/winword2/WinFaxServ.pl ++++ mgetty-1.1.27/frontends/winword2/WinFaxServ.pl +@@ -11,8 +11,8 @@ + # notice if redistributing. + # + +-$MAILER="/usr/lib/sendmail"; +-$DIR="/usr/spool/fax/winword"; ++$MAILER="/usr/sbin/sendmail"; ++$DIR="/var/spool/fax/winword"; + + open(LOG, ">>/usr/adm/errors"); + select LOG; $| = 1;select STDOUT; +--- mgetty-1.1.27.orig/voice/scripts/new_voice.craig_southern ++++ mgetty-1.1.27/voice/scripts/new_voice.craig_southern +@@ -43,7 +43,7 @@ + outputfn=$fn.$extension + + # convert file into correct format +-/usr/local/bin/rmdtopvf $fn | /usr/local/bin/pvftowav 2>/dev/null > $outputfn ++/usr/bin/rmdtopvf $fn | /usr/bin/pvftowav 2>/dev/null > $outputfn + + echo --$seperator >> $tempfn + echo Content-Type: $contenttype\; name=\"$pagefn\" >> $tempfn +--- mgetty-1.1.27.orig/samples/new_fax.all/new_fax ++++ mgetty-1.1.27/samples/new_fax.all/new_fax +@@ -1,4 +1,4 @@ +-#!/bin/ksh ++#!/bin/sh + # + # Written 1996 by Darko Krizic + # +@@ -6,10 +6,11 @@ + # mgetty from Gert Doering. See the README file for more information. + + # Do the settings here +-home=/usr/local/newfax # The home directory +-config=$home/faxlist # The configuration file +-from="Fax Subsystem <faxadmin@xplor.ipf.de>" # From this user +-log=/var/log/faxlog # logfile ++home=/etc/mgetty/newfax.d/ # The home directory ++config=/etc/mgetty/faxlist # The configuration file ++this_host=`hostname` ++from="Fax Subsystem <faxmaster@$this_host>" # From this user ++log=/var/log/mgetty/faxlog # logfile + + # Usually nothing to configure beyond this line + PATH=/usr/bin:/bin:/usr/local/bin:/usr/bin/X11 +--- mgetty-1.1.27.orig/login.cfg.in ++++ mgetty-1.1.27/login.cfg.in +@@ -30,7 +30,7 @@ + # (Big advantage: tuucp can use the same passwd file for serial dial-in + # and tcp dial-in [uucico running as in.uucpd]). Works from 1.05 up. + # +-#U* uucp @ /usr/lib/uucp/uucico -l -u @ ++#U* uucp @ /usr/sbin/uucico -l -u @ + + # + # Use this one for fido calls (login name /FIDO/ is handled specially) +@@ -39,7 +39,7 @@ + # mgetty has to be compiled with "-DFIDO", otherwise a fido call won't + # be detected. + # +-#/FIDO/ uucp fido /usr/local/lib/fnet/ifcico @ ++#/FIDO/ uucp fido /usr/lib/fnet/ifcico @ + + # + # Automatic PPP startup on receipt of LCP configure request (AutoPPP). +@@ -57,7 +57,7 @@ + # + # NOTE4: max. 9 arguments allowed. + # +-#/AutoPPP/ - a_ppp /usr/sbin/pppd auth -chap +pap login debug ++/AutoPPP/ - a_ppp /usr/sbin/pppd auth -chap +pap login debug + + # + # +--- mgetty-1.1.30.old/faxrunq.config 1998-11-12 10:26:00.000000000 -0500 ++++ mgetty-1.1.30/faxrunq.config 2003-07-01 19:14:55.000000000 -0400 +@@ -42,7 +42,7 @@ + #delete-sent-jobs y + + # accounting log file (default: see beginning of faxrunq/faxrunqd script) +-#acct-log /var/log/acct.log ++#acct-log /var/log/mgetty/fax/acct.log + + # The following options are for faxrunqd only: + +@@ -51,11 +51,11 @@ + #fax-devices ttyS0:ttyS1 + + # log file for faxrunqd (default: see beginning of faxrunqd script) +-#faxrunqd-log /var/log/faxrunqd.log ++#faxrunqd-log /var/log/mgetty/fax/faxrunqd.log + + # number of logfiles to keep around when rolling (default: 3) + #faxrunqd-keep-logs 5 + + # configuration file for policy routing, see faxrunqd man page for + # details (default: none, i.e. don't use policy routing) +-#policy-config /usr/local/lib/mgetty+sendfax/policy.config ++#policy-config /etc/mgetty/policy.config +--- mgetty-1.1.27.orig/callback/README ++++ mgetty-1.1.27/callback/README +@@ -5,7 +5,7 @@ + # + # callback experiments + # +-cback-gert - - /usr/local/sbin/callback -S 11223344 ++cback-gert - - /usr/sbin/callback -S 11223344 + + to call you back on "11223344" upon entering of a login name of + "cback-gert". If you don't specify a number on the command line, diff --git a/recipes/mgetty/mgetty-1.1.30/02-pending-fix-includes b/recipes/mgetty/mgetty-1.1.30/02-pending-fix-includes new file mode 100644 index 0000000000..8b27dddcd0 --- /dev/null +++ b/recipes/mgetty/mgetty-1.1.30/02-pending-fix-includes @@ -0,0 +1,49 @@ +--- mgetty-1.1.27.orig/g3/g3cat.c ++++ mgetty-1.1.27/g3/g3cat.c +@@ -21,6 +21,7 @@ + #endif + #include <unistd.h> + #include <fcntl.h> ++#include <string.h> + + extern int optind; + extern char * optarg; +--- mgetty-1.1.27.orig/compat/newslock.c ++++ mgetty-1.1.27/compat/newslock.c +@@ -6,6 +6,7 @@ + * TAKEN UNMODIFIED FROM C-NEWS BY Geoffrey Collyer AND Henry Spencer + */ + #include <stdio.h> ++#include <stdlib.h> + #include <unistd.h> + + int +--- mgetty-1.1.27.orig/voice/libmgsm/code.c ++++ mgetty-1.1.27/voice/libmgsm/code.c +@@ -8,13 +8,14 @@ + + #include "config.h" + +- + #ifdef HAS_STDLIB_H + #include <stdlib.h> + #else + # include "proto.h" + extern char * memcpy P((char *, char *, int)); + #endif ++ ++#include <string.h> + + #include "private.h" + #include "gsm.h" +--- mgetty-1.1.27.orig/voice/libutil/test_wildmat.c ++++ mgetty-1.1.27/voice/libutil/test_wildmat.c +@@ -3,6 +3,8 @@ + */ + + #include <stdio.h> ++#include <stdlib.h> ++#include <string.h> + + extern int wildmat(char *text, char *p, int length); + diff --git a/recipes/mgetty/mgetty-1.1.30/03-callback_Makefile b/recipes/mgetty/mgetty-1.1.30/03-callback_Makefile new file mode 100644 index 0000000000..4ef5e088f2 --- /dev/null +++ b/recipes/mgetty/mgetty-1.1.30/03-callback_Makefile @@ -0,0 +1,20 @@ +--- mgetty-1.1.27.orig/callback/Makefile ++++ mgetty-1.1.27/callback/Makefile +@@ -5,7 +5,7 @@ + # + + CC=gcc +-CFLAGS=-O2 -I.. -g ++CFLAGS=-O2 -I.. + + zigzag: + cd .. ; $(MAKE) call-back +@@ -40,7 +40,7 @@ + # install programs + # + install: all +- $(INSTALL) -s -m 700 -o root callback $(SBINDIR) ++ $(INSTALL) -s -m 755 -o root callback $(SBINDIR) + $(INSTALL) -s -m 4711 -o root ct $(BINDIR) + + # source modules diff --git a/recipes/mgetty/mgetty-1.1.30/04-new_fax.pbm b/recipes/mgetty/mgetty-1.1.30/04-new_fax.pbm new file mode 100644 index 0000000000..a3642482b9 --- /dev/null +++ b/recipes/mgetty/mgetty-1.1.30/04-new_fax.pbm @@ -0,0 +1,8 @@ +--- mgetty-1.1.30.orig/samples/new_fax.pbm Thu Jan 2 15:40:12 1997 ++++ mgetty-1.1.30/samples/new_fax.pbm Sun Sep 28 16:46:09 2003 +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + # From: michael@hal6000.thp.uni-duisburg.de (Michael Staats) + # Subject: Re: Fax notify without in/output redirection? + # To: mgetty@greenie.muc.de diff --git a/recipes/mgetty/mgetty-1.1.30/06-pending-contrib_g3tolj.c b/recipes/mgetty/mgetty-1.1.30/06-pending-contrib_g3tolj.c new file mode 100644 index 0000000000..d0ab83fe84 --- /dev/null +++ b/recipes/mgetty/mgetty-1.1.30/06-pending-contrib_g3tolj.c @@ -0,0 +1,49 @@ +--- mgetty-1.1.27.orig/contrib/g3tolj.c ++++ mgetty-1.1.27/contrib/g3tolj.c +@@ -57,6 +57,7 @@ + #include <sys/types.h> + #include <ctype.h> + #include <stdio.h> ++#include <stdlib.h> + + typedef unsigned char bit; + +@@ -303,6 +304,8 @@ + + #endif /* _G3_H_ */ + ++void skiptoeol (void); ++ + FILE * + pm_openr (name) + char *name; +@@ -552,7 +555,7 @@ + return (0); + } + +-skiptoeol () ++void skiptoeol () + { + while (rawzeros < 11) + (void) rawgetbit (); +@@ -707,9 +710,9 @@ + newpage (fd); + }; + +-void main (argc, argv) +- int argc; +- char *argv[]; ++int main (argc, argv) ++ int argc; ++ char *argv[]; + { + int argn, rows, wrows, cols, wcols, row, wrow, col, wcol, i; + int vval, hval; +@@ -864,5 +867,6 @@ + break; + } + putrest (); +- exit (0); ++ ++ return 0; + } diff --git a/recipes/mgetty/mgetty-1.1.30/07-pending-contrib_g3toxwd.c b/recipes/mgetty/mgetty-1.1.30/07-pending-contrib_g3toxwd.c new file mode 100644 index 0000000000..97f59dd484 --- /dev/null +++ b/recipes/mgetty/mgetty-1.1.30/07-pending-contrib_g3toxwd.c @@ -0,0 +1,46 @@ +--- mgetty-1.1.27.orig/contrib/g3toxwd.c ++++ mgetty-1.1.27/contrib/g3toxwd.c +@@ -26,6 +26,8 @@ + #include <sys/types.h> + #include <ctype.h> + #include <stdio.h> ++#include <stdlib.h> ++#include <string.h> + + typedef unsigned char bit; + +@@ -331,6 +333,8 @@ + + #endif /* _G3_H_ */ + ++void skiptoeol (void); ++ + FILE * + pm_openr (name) + char *name; +@@ -604,7 +608,7 @@ + return (0); + } + +-skiptoeol () ++void skiptoeol () + { + while (rawzeros < 11) + (void) rawgetbit (); +@@ -732,7 +736,7 @@ + putchar (byte); + }; + +-void main (argc, argv) ++int main (argc, argv) + int argc; + char *argv[]; + { +@@ -883,5 +887,6 @@ + xwd_writerow (stdout, writerow, wcols); + wrow++; + } +- exit (0); ++ ++ return 0; + } diff --git a/recipes/mgetty/mgetty-1.1.30/09-doc_Makefile b/recipes/mgetty/mgetty-1.1.30/09-doc_Makefile new file mode 100644 index 0000000000..1af8ca4771 --- /dev/null +++ b/recipes/mgetty/mgetty-1.1.30/09-doc_Makefile @@ -0,0 +1,91 @@ +--- mgetty-1.1.28.copy/doc/Makefile 1997-11-27 15:33:26.000000000 -0500 ++++ mgetty-1.1.28/doc/Makefile 2002-07-30 03:27:31.000000000 -0400 +@@ -4,6 +4,8 @@ + # + + NROFF=nroff ++ ++INSTALL=install + # + # + MAN1PAGES=g32pbm.1 g3cat.1 pbm2g3.1 fax.1 \ +@@ -12,11 +14,11 @@ + MAN5PAGES=faxqueue.5 + MAN8PAGES=sendfax.8 mgetty.8 callback.8 faxrunqd.8 + MANSRC=$(MAN1PAGES) $(MAN4PAGES) $(MAN5PAGES) $(MAN8PAGES) +-MAN1DIR=/usr/local/man/man1 +-MAN4DIR=/usr/local/man/man4 +-MAN5DIR=/usr/local/man/man5 +-MAN8DIR=/usr/local/man/man8 +-INFODIR=/usr/local/info ++MAN1DIR=$(PREFIX)/usr/share/man/man1 ++MAN4DIR=$(PREFIX)/usr/share/man/man4 ++MAN5DIR=$(PREFIX)/usr/share/man/man5 ++MAN8DIR=$(PREFIX)/usr/share/man/man8 ++INFODIR=$(PREFIX)/usr/share/info + + # + # formatted man pages +@@ -26,18 +28,19 @@ + + all: + +-doc-all: mgetty.asc mgetty.info mgetty.dvi mgetty.ps fmt-manpages $(MANSRC) ++doc-all: mgetty.info mgetty.dvi mgetty.ps fmt-manpages $(MANSRC) # mgetty.asc + + manpages: $(MANSRC) + + fmt-manpages: + -$(MAKE) `for i in $(MANSRC) ; do echo \`expr $$i : "\([^.]*\)"\`.man ; done ` + +-mgetty.asc: mgetty.ms +- -$(NROFF) -ms mgetty.ms >mgetty.asc ++# commented out since I couldn't find texi2roff ++#mgetty.asc: mgetty.ms ++# -$(NROFF) -ms mgetty.ms >mgetty.asc + +-mgetty.ms: mgetty.texi +- -texi2roff -ms <mgetty.texi >mgetty.ms ++#mgetty.ms: mgetty.texi ++# -texi2roff -ms <mgetty.texi >mgetty.ms + + mgetty.html: mgetty.texi + -texi2html -verbose mgetty.texi +@@ -62,10 +65,12 @@ + + fullclean: clean + rm -f mgetty.ps mgetty.dvi mgetty.aux mgetty.info* mgetty.ms \ +- *.man *.[1-9] mgetty.texi ++ *.man *.[1-9] mgetty.texi # mgetty.asc ++ ++install: install.man install.info + +-install: $(MANSRC) mgetty.info +- -mkdir `dirname $(MAN1DIR)` $(MAN1DIR) $(MAN4DIR) $(MAN5DIR) $(MAN8DIR) 2>/dev/null ++install.man: $(MANSRC) ++ -mkdir -p `dirname $(MAN1DIR)` $(MAN1DIR) $(MAN4DIR) $(MAN5DIR) $(MAN8DIR) 2>/dev/null + for i in $(MAN1PAGES) ; do \ + $(INSTALL) -m 644 $$i $(MAN1DIR) ; \ + done +@@ -78,8 +83,10 @@ + for i in $(MAN8PAGES) ; do \ + $(INSTALL) -m 644 $$i $(MAN8DIR) ; \ + done ++ ++install.info: + if [ -f mgetty.info ] ; then\ +- test -d $(INFODIR) || mkdir $(INFODIR) 2>/dev/null ; \ ++ test -d $(INFODIR) || mkdir -p $(INFODIR) 2>/dev/null ; \ + for i in mgetty.info* ; do \ + $(INSTALL) -m 644 $$i $(INFODIR) ; \ + done ; \ +@@ -92,8 +99,8 @@ + ../mgetty0$(VS)doc.tar.gz: doc-all mgetty.html + gtar cvvf ../mgetty0$(VS)doc.tar mgetty.texi mgetty.info* \ + mgetty.dvi mgetty.ps \ +- mgetty.ms mgetty.asc \ + mgetty.html *.man ++# mgetty.ms mgetty.asc + gzip -f -9 -v ../mgetty0$(VS)doc.tar + + # explicit man page dependencies diff --git a/recipes/mgetty/mgetty-1.1.30/10-doc_faxrunqd.8in b/recipes/mgetty/mgetty-1.1.30/10-doc_faxrunqd.8in new file mode 100644 index 0000000000..5d29580c50 --- /dev/null +++ b/recipes/mgetty/mgetty-1.1.30/10-doc_faxrunqd.8in @@ -0,0 +1,60 @@ +--- mgetty-1.1.30.old/doc/faxrunqd.8in 2002-11-23 11:47:17.000000000 -0500 ++++ mgetty-1.1.30/doc/faxrunqd.8in 2003-07-15 16:08:22.000000000 -0400 +@@ -3,7 +3,7 @@ + .SH NAME + faxrunqd \- daemon to send fax jobs queued by faxspool(1) + .SH SYNOPSIS +-.B faxrunqd [-v] [-d] [-l <ttys>] [-u <user>] [-V] ++.B faxrunqd [-v] [-d] [-D] [-l <ttys>] [-u <user or uid>] [ -g <group or gid> ] [-V] + .SH DESCRIPTION + Runs in the background, and regularily checks the fax queue set up by + faxspool(1). Sends all jobs that are due, records results, and takes +@@ -59,7 +59,7 @@ + would do (send a mail, delete the JOB directory, execute a named program, + etc.). Both programs are fully compatible in this respect. + +-.B faxrunqd [-v] [-d] [-l <ttys>] [-u <user>] [-V] ++.B faxrunqd [-v] [-d] [-D] [-l <ttys>] [-u <user or uid>] [ -g <group or gid> ] [-V] + .SH OPTIONS + .TP + .B -v +@@ -67,17 +67,22 @@ + .I faxrunqd + to write progress information to the log file. + .TP ++.B -D ++Tells ++.I faxrunqd ++to run in the background, as a daemon. ++.TP + .B -d + Tells + .I faxrunqd + to write debugging information to stdout and the log file (usually used +-together with -v) ++together with -v). + .TP + .B -l <ttyS> + Specifies the list of modem devices to use. Multiple devices are + separated with ':', e.g. '-l ttyS0:ttyS1'. + .TP +-.B -u <user> ++.B -u <user or uid> + .I faxrunqd + can now (since 1.1.29) run as unprivileged user. If you start it as root + from /etc/inittab or from one of the /etc/rc* scripts, it's strongly +@@ -86,7 +91,13 @@ + .I faxrunqd + drop all its privileges at startup, and run as the specified user. Running + .I faxrunqd +-as root user might lead to security problems - don't do it. ++as root user might lead to security problems - don't do it. This ++parameter takes either a uid or a username as argument. ++.TP ++.B -g <group or gid> ++.I Same effect as above but for the group id. Indicates the group which ++should own the fax files. This parameter takes either a gid or a ++groupname as argument. + .TP + .B -V + print version number and exit diff --git a/recipes/mgetty/mgetty-1.1.30/12-fax_faxrunqd.in b/recipes/mgetty/mgetty-1.1.30/12-fax_faxrunqd.in new file mode 100644 index 0000000000..4d043de3b9 --- /dev/null +++ b/recipes/mgetty/mgetty-1.1.30/12-fax_faxrunqd.in @@ -0,0 +1,178 @@ +--- mgetty-1.1.30/fax/faxrunqd.in.orig 2003-09-13 11:04:12.000000000 +0000 ++++ mgetty-1.1.30-5.1/fax/faxrunqd.in 2003-09-13 11:12:47.000000000 +0000 +@@ -13,6 +13,9 @@ + # + # Change Log: + # ++# Debian 1.1.30-5.1 2003/07/20 Andreas Barth <aba@not.so.argh.org> ++# Can specify group per commandline. ++# + # $Log: faxrunqd.in,v $ + # Revision 1.63 2002/11/23 16:52:18 gert + # make messages more clear, print warning if running as root +@@ -45,6 +48,11 @@ + # a "low prio" job for phone number 123 could be attached to a high prio + # job to 123, and thus be sent before a high prio job to 456) + # ++# Debian 1.1.28-4 2002/11/27 18:32:23 Wolfgang Sourdeau <was@debian.org> ++# Quit quietly when received signal TERM or HUP since it is expected the ++# user knows what is happening already. The quit message is still written ++# into the logfile. ++# + # Revision 1.56 2002/01/04 17:52:42 gert + # pass sendfax exit code as 2nd argument to success/failure program + # +@@ -55,6 +63,9 @@ + # Revision 1.54 2001/12/16 14:26:25 gert + # stop queue handling if a file named 'stop' exists + # ++# Add a -D option to allow for running in the background as a Daemon ++# Philip Hands <phil@hands.com> ++# + # Revision 1.53 2000/08/06 14:28:37 gert + # go from using $fax_spool_out/.last_run to VARRUNDIR/faxqueue_done + # +@@ -129,6 +140,8 @@ + # + # + require 5.004; ++ ++use Fcntl; + use POSIX; + use IO::Handle; + use Getopt::Std; +@@ -143,10 +156,10 @@ + $mail='@MAILER@'; + + $faxrunq_cf='@CONFDIR@/faxrunq.config'; +-$fax_acct='@FAX_SPOOL@/acct.log'; +-$faxrd_log='@FAX_SPOOL@/faxrunqd.log'; ++$fax_acct='/var/log/mgetty/fax/acct.log'; ++$faxrd_log='/var/log/mgetty/fax/faxrunqd.log'; + +-$faxrd_pid='@FAX_SPOOL_OUT@/faxrunqd.pid'; ++$faxrd_pid='/var/run/mgetty-fax/faxrunqd.pid'; + $last_run='@FAX_SPOOL_OUT@/faxqueue_done'; + + $policy_config=''; +@@ -189,8 +202,10 @@ + $opt_V = 0; # print version number + $opt_l = ''; # ttys to use + $opt_u = ''; # user id to setuid() to +-getopts( 'dvVl:u:' ) || +- die "Valid options: -d (debug), -v (verbose), -l tty<n>, -u uid, -V (version)\n"; ++$opt_g = ''; # group id to setgid() to ++$opt_D = 0; # daemon ++getopts( 'DdvVl:u:g:' ) || ++ die "Valid options: -D (daemon), -d (debug), -v (verbose), -l tty<n>, -u uid, -g uid, -V (version)\n"; + + if ( $opt_d ) { $opt_v=1; } + +@@ -201,32 +216,63 @@ + mgetty+sendfax by Gert Doering + $rcs_id + +-config file read from '$faxrunq_cf' ++config read from '$faxrunq_cf' + + EOF + exit 0; + } + ++$uid=$>; ++$gid=$); ++ + if ( $opt_u ne '' ) # set user ID to $opt_u + { +- my ( $uid, $gid ) = ( getpwnam( $opt_u ) )[2,3]; ++ ( $uid, $gid ) = ( ( $opt_u =~ /^[0-9]+$/ ) ++ ? getpwuid( $opt_u ) ++ : getpwnam( $opt_u ) )[2,3]; + + if ( !defined($uid) || !defined($gid) ) + { die "$0: no such user: '$opt_u'\n"; } + + print "change user ID to '$opt_u' (numeric uid: $uid, gid: $gid)\n" + if $opt_d; +- $( = $) = $gid; +- $< = $> = $uid; +- +- if ( $> != $uid || $) != $gid ) +- { die "$0: can't set uid to $uid / gid to $gid: $!\n"; } + } ++ ++if ( $opt_g ne '' ) ++ { ++ $gid = ( ( $opt_g =~ /^[0-9]+$/ ) ++ ? getgrgid( $opt_g ) ++ : getgrnam( $opt_g ) )[2]; ++ die "$0: no such group: '$opt_g'\n" unless defined ($gid); ++ } ++ ++$( = $) = $gid; ++$< = $> = $uid; ++ ++if ( $> != $uid || $) != $gid ) ++ { die "$0: can't set uid to $uid / gid to $gid: $!\n"; } ++ + if ( $> == 0 ) # root check + { + print STDERR "$0: running with root privileges is not recommended\n"; + } + ++# fork as a daemon if invoked with -D ++if ( $opt_D ) { ++ $pid = fork ; ++ die "Cannot fork: $!" unless defined $pid ; ++ if (0 == $pid) { ++ # Child process: become leader of a new session, lose STDIN, log STDOUT/ERR ++ POSIX::setsid(); ++ umask(022); ++ open(STDIN, "/dev/null") ; ++ open(STDOUT, ">&LOG") ; ++ open(STDERR, ">&LOG") ; ++ } else { ++ exit 0; # parent process ++ } ++} ++ + # + # startup... write PID file, make sure no other faxrunqd runs + # +@@ -262,7 +308,7 @@ + + $SIG{USR1} = \&signal_handler_USR1; # roll log file + $roll_log_file_requested = 0; +-$roll_level=3; # keep 3 old files around ++$roll_level=7; # keep 7 old files around + + $SIG{USR2} = \&signal_handler_USR2; # graceful exit + $graceful_exit_requested = 0; +@@ -355,7 +401,7 @@ + # + # open log file + # +-open( LOG, ">>$faxrd_log" ) || ++sysopen( LOG, "$faxrd_log", O_CREAT | O_APPEND | O_WRONLY, 0640 ) || + die "can't write log file '$faxrd_log'"; + LOG->autoflush(1); + print LOG "\n" . localtime() .": faxrunqd starting, pid=$$\n"; +@@ -552,7 +598,7 @@ + $roll_log_file_requested=0; + + # start new +- open( LOG, ">$faxrd_log" ) || ++ sysopen( LOG, "$faxrd_log", O_CREAT | O_APPEND | O_WRONLY, 0640 ) || + die "can't re-open log file '$faxrd_log'"; + LOG->autoflush(1); + print LOG localtime() .": -- new log file started --\n"; +@@ -1639,7 +1685,8 @@ + { + my $sig = shift; + +- print "\nfaxrunqd: signal handler: got signal $sig, goodbye...\n"; ++ print "\nfaxrunqd: signal handler: got signal $sig, goodbye...\n" ++ if ($sig ne 'TERM' && $sig ne 'HUP' && $sig ne 'USR2'); + print LOG "\nfaxrunqd: signal handler: got signal $sig, goodbye...\n"; + + # save tty statistics diff --git a/recipes/mgetty/mgetty-1.1.30/13-fax_faxspool.in b/recipes/mgetty/mgetty-1.1.30/13-fax_faxspool.in new file mode 100644 index 0000000000..ba7a994258 --- /dev/null +++ b/recipes/mgetty/mgetty-1.1.30/13-fax_faxspool.in @@ -0,0 +1,237 @@ +--- mgetty-1.1.30.orig/fax/faxspool.in 2002-11-23 10:14:57.000000000 -0500 ++++ mgetty-1.1.30/fax/faxspool.in 2003-04-27 23:48:56.000000000 -0400 +@@ -70,7 +70,7 @@ + FAX_SPOOL=@FAX_SPOOL@ + FAX_SPOOL_OUT=@FAX_SPOOL_OUT@ + FAX_SEQ=$FAX_SPOOL_OUT/.Sequence +-FAX_SEQ_LOCKDIR=$FAX_SPOOL_OUT/locks ++FAX_SEQ_LOCKDIR=/var/lock/fax + FAX_SEQ_LOCK=$FAX_SEQ_LOCKDIR/LCK..seq + LAST_RUN=@FAX_SPOOL_OUT@/faxqueue_done + +@@ -145,7 +145,7 @@ + # + fs_cvt_pbm() + { +- pbm2g3 $1 >$2.001 ++ pbm2g3 "$1" >"$2".001 + } + + # +@@ -153,7 +153,7 @@ + # + fs_cvt_pgm() + { +- pgmtopbm $1 | pbm2g3 >$2.001 ++ pgmtopbm "$1" | pbm2g3 >"$2".001 + } + + # +@@ -161,7 +161,7 @@ + # + fs_cvt_ppm() + { +- ppmtopgm $1 | pgmtopbm | pbm2g3 >$2.001 ++ ppmtopgm "$1" | pgmtopbm | pbm2g3 >"$2".001 + } + + # +@@ -171,7 +171,7 @@ + # + fs_cvt_g3() + { +- g3cat $1 >$2.001 ++ g3cat "$1" >"$2".001 + } + + # +@@ -183,14 +183,14 @@ + fs_cvt_xwd() + { + REDUCE="cat" +- test X$3 = X-n && REDUCE="pnmscale -yscale 0.5" ++ test X"$3" = X-n && REDUCE="pnmscale -yscale 0.5" + +- xwdtopnm $1 |\ ++ xwdtopnm "$1" |\ + pnmscale -xysize 1728 2000 |\ + $REDUCE |\ + ppmtopgm |\ + pgmtopbm |\ +- pbm2g3 >$2.001 ++ pbm2g3 >"$2".001 + } + + # +@@ -201,14 +201,14 @@ + fs_cvt_gif() + { + REDUCE="cat" +- test X$3 = X-n && REDUCE="pnmscale -yscale 0.5" ++ test X"$3" = X-n && REDUCE="pnmscale -yscale 0.5" + +- giftoppm $1 |\ ++ giftopnm "$1" |\ + pnmscale -xysize 1728 2000 |\ + $REDUCE |\ + ppmtopgm |\ + pgmtopbm |\ +- pbm2g3 >$2.001 ++ pbm2g3 >"$2".001 + } + + # +@@ -219,14 +219,14 @@ + fs_cvt_tif() + { + REDUCE="cat" +- test X$3 = X-n && REDUCE="pnmscale -yscale 0.5" ++ test X"$3" = X-n && REDUCE="pnmscale -yscale 0.5" + +- tifftopnm $1 |\ ++ tifftopnm "$1" |\ + pnmscale -xysize 1728 2000 |\ + $REDUCE |\ + ppmtopgm |\ + pgmtopbm |\ +- pbm2g3 >$2.001 ++ pbm2g3 >"$2".001 + } + + # +@@ -235,11 +235,11 @@ + # + fs_cvt_lj() + { +- if [ X$3 = X-n ] ++ if [ X"$3" = X-n ] + then +- hp2log3 -r$2 <$1 ++ hp2log3 -r"$2" <"$1" + else +- hp2hig3 -r$2 <$1 ++ hp2hig3 -r"$2" <"$1" + fi + } + +@@ -251,10 +251,10 @@ + fs_cvt_ps() + { + driver="$GS_DRIVER_HI" +- test X$3 = X-n && driver="$GS_DRIVER_LO" ++ test X"$3" = X-n && driver="$GS_DRIVER_LO" + +- cat $1 | +- gs $driver -sOutputFile=$2%03d -dNOPAUSE -q -dSAFER - ++ cat "$1" | ++ gs $driver -sOutputFile="$2"%03d -dNOPAUSE -q -dSAFER - + } + + # +@@ -268,19 +268,19 @@ + # via Ghostscript: + + driver="$GS_DRIVER_HI" +- test X$3 = X-n && driver="$GS_DRIVER_LO" ++ test X"$3" = X-n && driver="$GS_DRIVER_LO" + +- gs $driver -sOutputFile=$2%03d -dNOPAUSE \ +- -- gslp.ps -fCourier-Bold10 -B $1 ++ gs $driver -sOutputFile="$2"%03d -dNOPAUSE \ ++ -- gslp.ps -fCourier-Bold10 -B "$1" + + ##### + # via hp2pbm: + # (convert "LF" to "CR+LF" via awk) + + # pgm=hp2hig3 +-# test X$3 = X-n && pgm=hp2log3 ++# test X"$3" = X-n && pgm=hp2log3 + # |
