diff options
author | Patrick J Volkerding <volkerdi@slackware.com> | 2009-08-26 10:00:38 -0500 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2018-05-31 22:41:17 +0200 |
commit | 5a12e7c134274dba706667107d10d231517d3e05 (patch) | |
tree | 55718d5acb710fde798d9f38d0bbaf594ed4b296 /source/a/getty-ps | |
download | current-5a12e7c134274dba706667107d10d231517d3e05.tar.gz |
Slackware 13.0slackware-13.0
Wed Aug 26 10:00:38 CDT 2009
Slackware 13.0 x86_64 is released as stable! Thanks to everyone who
helped make this release possible -- see the RELEASE_NOTES for the
credits. The ISOs are off to the replicator. This time it will be a
6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD.
We're taking pre-orders now at store.slackware.com. Please consider
picking up a copy to help support the project. Once again, thanks to
the entire Slackware community for all the help testing and fixing
things and offering suggestions during this development cycle.
As always, have fun and enjoy! -P.
Diffstat (limited to 'source/a/getty-ps')
-rwxr-xr-x | source/a/getty-ps/getty-ps.SlackBuild | 79 | ||||
-rw-r--r-- | source/a/getty-ps/getty.bugfixes.diff | 356 | ||||
-rw-r--r-- | source/a/getty-ps/getty_ps-2.1.0.lsm | 26 | ||||
-rw-r--r-- | source/a/getty-ps/slack-desc | 19 |
4 files changed, 480 insertions, 0 deletions
diff --git a/source/a/getty-ps/getty-ps.SlackBuild b/source/a/getty-ps/getty-ps.SlackBuild new file mode 100755 index 00000000..76e4012d --- /dev/null +++ b/source/a/getty-ps/getty-ps.SlackBuild @@ -0,0 +1,79 @@ +#!/bin/sh + +# Copyright 2008, 2009 Patrick J. Volkerding, Sebeka, Minnesota, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +VERSION=2.1.0b +ARCH=${ARCH:-x86_64} +BUILD=${BUILD:-1} + +CWD=$(pwd) +TMP=${TMP:-/tmp} +PKG=$TMP/package-getty-ps + +rm -rf $PKG +mkdir -p $TMP $PKG + +cd $TMP +tar xzvf $CWD/getty_ps-$VERSION.tar.gz +cd getty_ps-$VERSION +zcat $CWD/getty.bugfixes.diff.gz | patch -p1 --verbose || exit +# Prevent "error: conflicting types for 'send'" +# because send is already defined in <sys/net.h> +sed -i -e "s/send/gettysend/g" funcs.c +chown -R root:root . +make clean +rm getty uugetty +make +strip getty uugetty +mkdir $PKG/sbin +cat getty > $PKG/sbin/getty +cat uugetty > $PKG/sbin/uugetty +chmod 755 $PKG/sbin/* +mkdir $PKG/etc +cat Examples/gettydefs > $PKG/etc/gettydefs +#cat Examples/ttytype > $PKG/etc/ttytype +mkdir $PKG/etc/default +cp -a Examples/default/* $PKG/etc/default +chown root:root $PKG/etc/default/* +mkdir -p $PKG/usr/man/man1 +cat man/getty.1 | gzip -9c > $PKG/usr/man/man1/getty.1.gz +( cd $PKG/usr/man/man1 ; ln -sf getty.1.gz uugetty.1.gz ) +mkdir -p $PKG/usr/man/man5 +cat man/gettydefs.5 | gzip -9c > $PKG/usr/man/man5/gettydefs.5.gz +mkdir -p $PKG/usr/doc/getty-ps-$VERSION +cp -a \ + ANNOUNCE ChangeLog README.* Examples *.lsm INSTALL \ + $PKG/usr/doc/getty-ps-$VERSION +find $PKG/usr/doc/getty-ps-$VERSION -type d -exec chmod 755 {} \; +find $PKG/usr/doc/getty-ps-$VERSION -type f -exec chmod 644 {} \; +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +# Build the package: +cd $PKG +makepkg -l y -c n $TMP/getty-ps-$VERSION-$ARCH-$BUILD.txz + +# Clean up the extra stuff: +if [ "$1" = "--cleanup" ]; then + rm -rf $TMP/getty_ps-$VERSION + rm -rf $PKG +fi diff --git a/source/a/getty-ps/getty.bugfixes.diff b/source/a/getty-ps/getty.bugfixes.diff new file mode 100644 index 00000000..6a1ed29e --- /dev/null +++ b/source/a/getty-ps/getty.bugfixes.diff @@ -0,0 +1,356 @@ +This patch contains the following bugfixes: + +* the TIMEOUT (and -t flag) has now different effect for getty and uugetty: + with uugetty, TIMEOUT set will now cause uugetty exit no matter whether + there has been any input from the user (the counting will start immediately + after login() has been spawned - pre- getty-2.1.0 behavior), while for + getty, it will make the counter start after single input has been detected + from the user + * getty.1 manpage updated accordingly + +* @F issue substitution now works as expected + +* @V / VERSION functionality documentation fix in getty.1 manpage + +* fixed a bunch of memleaks (if not all): + * Fputs() made strdup()-free (we now use static structs where possible) + * avoided unnecessary dual strdup() for Version in defs() + * freeing of "DEF **def" including its internals is now handled, as well as + feeing of other variables in defs() pointing to strdup()ed memory areas + +Jan Rafaj + +--- ./man/getty.1.orig 2002-09-13 09:05:03.000000000 +0200 ++++ ./man/getty.1 2005-07-21 10:24:53.000000000 +0200 +@@ -307,7 +307,18 @@ + to exit (which + .I init + should then respawn), if the login is not completed within timeout seconds +-(after the login name is entered) ++(after the login name is entered). This option behaves differently for ++.I getty ++and ++.I uugetty. ++If ++.I getty ++is used, the counting will start after single input from the user has been ++detected, whileas with ++.I uugetty, ++the counting will start immediately after ++.IR login (1m) ++has been spawned, no matter the input from the user. + + Giving + .B \-w +@@ -388,9 +399,12 @@ + If + .I string + begins with a '/' character, it is assumed to be the full pathname of a +-file, and ++text file, and + .B @V +-is set to be the contents of that file. The default is /proc/version. ++is set to be the contents of the first line in that file (line has to be ++terminated by newline character or by end of file). ++.br ++The default is /proc/version. + .TP + LOGIN=\fIname\fR + Sets the name of the login program to +@@ -503,6 +517,14 @@ + to exit if no user name is accepted before the + .I number + of seconds elapse after the login prompt is displayed. ++With ++.I getty, ++the counting will start as soon as a single character ++has been entered by the user, whileas with ++.I uugetty, ++the counting will start immediately after the login prompt ++is displayed, no matter the input from the user. ++.br + The default is to wait indefinitely for the user name. + .TP + CONNECT=\fIstring\fR +@@ -865,6 +887,11 @@ + .IR cu (1) + and others). This prevents two or more processes from having conficting + use of a tty port. ++.br ++.I Uugetty ++also differs from ++.I getty ++by handling the -t parameter and TIMEOUT option. + .PP + When + .I uugetty +--- ./main.c.orig 2004-04-11 03:34:34.000000000 +0200 ++++ ./main.c 2005-07-21 11:37:19.000000000 +0200 +@@ -78,6 +78,8 @@ + void debugstart(); + #endif /* DEBUG */ + ++DEF **def; ++ + /* trivial globals */ + + char buf[MAXLINE]; +@@ -86,7 +88,7 @@ + char tbuf[64]; + + #define Perror(s) { debug(D_INIT, "Line %d: %s: Error %d: %s\n", \ +- __LINE__, s, errno, sys_errlist[errno]); \ ++ __LINE__, s, errno, strerror(errno)); \ + exit(errno); \ + } + +@@ -149,6 +151,50 @@ + } + } + ++/* ++ * Why a lot of programmers ignore the fact that memory area returned ++ * by strdup() and *alloc() has to be freed upon exit? :(( -JR ++ */ ++void free_def(void) ++{ ++ register DEF **deflist = def; ++ ++ for (; *deflist != (DEF *)NULL; deflist++) { ++ free((*deflist)->name); ++ free((*deflist)->value); ++ free(*deflist); ++ } ++} ++ ++void free_sysname(void) ++{ ++ if (SysName) ++ free(SysName); ++ SysName = NULL; ++} ++ ++void free_version(void) ++{ ++ if (Version) ++ free(Version); ++ Version = NULL; ++} ++ ++#ifdef UUGETTY ++void free_lock(void) ++{ ++ if (lock) ++ free(lock); ++ lock = NULL; ++} ++ ++void free_altlock(void) ++{ ++ if (altlock) ++ free(altlock); ++ altlock = NULL; ++} ++#endif + + /* + ** main +@@ -320,7 +366,6 @@ + char **args; + { + register int c; +- DEF **def; + char *p; + char termcap[1024]; + +@@ -416,22 +461,27 @@ + /* now, get all that info in the defaults file */ + + def = defbuild(defname); ++ atexit(free_def); + #ifdef DEBUG + if ((p = defvalue(def, "DEBUG"))) (void) sscanf(p, "%o", &Debug); + if (Debug) debugstart(); + #endif /* DEBUG */ + SysName = strdup(getuname()); ++ atexit(free_sysname); + if (p = defvalue(def, "SYSTEM")) SysName = p; +- if (p = defvalue(def, "VERSION")) +- Version = strdup(p); +- if (*Version == '/') +- { if ((fp = fopen(Version, "r"))) +- { fgets(buf, MAXLINE, fp); +- fclose(fp); +- buf[strlen(buf)-1] = '\0'; +- Version = strdup(buf); ++ if (p = defvalue(def, "VERSION")) { ++ if (*p == '/') { ++ if ((fp = fopen(p, "r"))) { ++ fgets(buf, MAXLINE, fp); ++ fclose(fp); ++ buf[strlen(buf)-1] = '\0'; ++ Version = strdup(buf); + } +- } ++ } else { ++ Version = strdup(p); ++ } ++ atexit(free_version); ++ } + if((p = defvalue(def, "LOGIN"))) login_pgm = p; + if((p = defvalue(def, "ISSUE"))) issue = p; + if((p = defvalue(def, "CLEAR")) && (strequal(p, "NO"))) +@@ -489,12 +539,15 @@ + #ifdef UUGETTY + (void) sprintf(buf, LOCK, Device); + lock = strdup(buf); ++ atexit(free_lock); + if((p = defvalue(def, "ALTLOCK"))) { + (void) sprintf(buf, LOCK, p); + altlock = strdup(buf); ++ atexit(free_altlock); + } else if(! strequal(Device, InitDevice)) { + (void) sprintf(buf, LOCK, InitDevice); + altlock = strdup(buf); ++ atexit(free_altlock); + } + + debug(D_LOCK, "lock = (%s), altlock = (%s)", lock, altlock); +@@ -625,8 +678,8 @@ + with the uts struct filled above. + */ + +- debug(D_UTMP, "adding utmp entry: type: %d, pid: %d, line: %s, +- id: %c%c, time: %d, user: %s, host: %s, addr: %d", ++ debug(D_UTMP, "adding utmp entry: type: %d, pid: %d, line: %s, " ++ "id: %c%c, time: %d, user: %s, host: %s, addr: %d", + uts.ut_type, uts.ut_pid, uts.ut_line, + (uts.ut_id[0] ? uts.ut_id[0] : ' '), + (uts.ut_id[1] ? uts.ut_id[1] : ' '), +@@ -1077,16 +1130,20 @@ + login_prompt: + (void) ioctl(STDIN, TCFLSH, 0); + #ifdef FIDO +- if (emsi && (strcmp(emsi,"yes") == 0)) +- (void) Fputs("**EMSI_REQA77E\r", stdout); ++ if (emsi && (strcmp(emsi,"yes") == 0)) ++ (void) Fputs("**EMSI_REQA77E\r", stdout); + #endif + (void) Fputs(gtab->login, stdout); +- ++#ifndef UUGETTY + login_result=getlogname(&termio, buf, MAXLINE); ++#endif + if(TimeOut > 0) { + (void) signal(SIGALRM, timeout); + (void) alarm((unsigned) TimeOut); + } ++#ifdef UUGETTY ++ login_result=getlogname(&termio, buf, MAXLINE); ++#endif + + switch(login_result) { + #ifdef FIDO +@@ -1114,6 +1171,13 @@ + #ifdef SETTERM + setenv("TERM", term, TRUE); + #endif /* SETTERM */ ++ free_def(); ++ free_sysname(); ++ free_version(); ++#ifdef UUGETTY ++ free_lock(); ++ free_altlock(); ++#endif + debug(D_RUN, "execing login"); + (void) execl(login_pgm, + "login", buf, NULLPTR); +--- ./funcs.c.orig 2002-09-25 08:43:28.000000000 +0200 ++++ ./funcs.c 2005-07-20 19:01:55.000000000 +0200 +@@ -87,12 +87,11 @@ + register char *s; + register FILE *stream; + { +- char c, n, tbuf[20], ubuf[MAXBUF]; +- char *cbuf; ++ char c, n, tbuf[20]; + time_t clock; + struct tm *lt; +- struct utsname utsbuf; +- struct hostent *fqdname; ++ static struct utsname utsbuf; ++ static struct hostent *fqdname; + FILE *fp1; + + char *day_name[] = { "Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat" }; +@@ -119,21 +118,8 @@ + return(EOF); + break; + case 'F': /* FQDName */ +- cbuf = strdup(SysName); +-#if 0 /* The does a seg violation - no idea why.... */ + fqdname = gethostbyname(SysName); +-#endif +-#if 0 /* So, we cheat.....! */ +- /* Which also gets a seg violation! */ +- if (fp1 = fopen("/etc/HOSTNAME", "r")) +- { fgets(cbuf, MAXBUF, fp1); +- fclose(fp1); +- cbuf[strlen(cbuf)] = '\0'; +- } +- if (fqdname != NULL) +- cbuf = strdup(fqdname->h_name); +-#endif +- if (Fputs(cbuf, stream) == EOF) ++ if (fqdname && Fputs(fqdname->h_name, stream) == EOF) + return(EOF); + break; + case 'L': /* line */ +@@ -141,18 +127,15 @@ + return(EOF); + break; + case 'M': /* arch of machine */ +- cbuf = strdup(utsbuf.machine); +- if (Fputs(cbuf, stream) == EOF) ++ if (Fputs(utsbuf.machine, stream) == EOF) + return(EOF); + break; + case 'O': /* O/S name */ +- cbuf = strdup(utsbuf.sysname); +- if (Fputs(cbuf, stream) == EOF) ++ if (Fputs(utsbuf.sysname, stream) == EOF) + return(EOF); + break; + case 'R': /* O/S rev_id */ +- cbuf = strdup(utsbuf.release); +- if (Fputs(cbuf, stream) == EOF) ++ if (Fputs(utsbuf.release, stream) == EOF) + return(EOF); + break; + case 'S': /* system node name */ +@@ -166,8 +149,8 @@ + return(EOF); + break; + case 'U': /* number of active users */ +- (void) sprintf(ubuf, "%d", Nusers); +- if (Fputs(ubuf, stream) == EOF) ++ (void) sprintf(tbuf, "%d", Nusers); ++ if (Fputs(tbuf, stream) == EOF) + return(EOF); + break; + case 'V': /* version */ +@@ -175,12 +158,10 @@ + return(EOF); + break; + case 'u': /* user count str */ +- cbuf = malloc(20); + (void) sprintf(tbuf, "%d User", Nusers); + if (Nusers > 1) +- cbuf = strcat(tbuf,"s"); +- else cbuf=strdup(tbuf); +- if (Fputs(cbuf, stream) == EOF) ++ strcat(tbuf, "s"); ++ if (Fputs(tbuf, stream) == EOF) + return(EOF); + break; + case '@': /* in case '@@' was used */ diff --git a/source/a/getty-ps/getty_ps-2.1.0.lsm b/source/a/getty-ps/getty_ps-2.1.0.lsm new file mode 100644 index 00000000..b89d9f50 --- /dev/null +++ b/source/a/getty-ps/getty_ps-2.1.0.lsm @@ -0,0 +1,26 @@ +Begin4 +Title: getty-ps +Version: 2.1.0 +Entered-date: 27SEP02 +Description: A versatile getty/uugetty program designed to allow easy + use of a modem for incoming/outgoing data/fax/voice calls. + It also allows easy set-up of regular login ports. Unlike + agetty, it stores most of it's configuration and port + initialization information in up to 2 files. This usually + results in slightly more involved initial installation, but + easier maintenance than agetty. It also leaves the + inittab entries looking uncluttered. Supports 57600 and + faster speeds, and is compatible with uucp and efax-0.9[a]. + Ringback is provided as an optional feature. +Keywords: getty uugetty serial modem ringback efax uucp +Author: Paul Sutcliffe, Jr. +Maintained-by: Christine Jamison <getty-info@nwmagic.net> +Primary-site: ftp.ibiblio.org:/pub/Linux/system/serial/getty_ps-2.1.0.tar.gz +Alternate-site: ftp.nwmagic.net:/pub/sources/getty_ps-2.1.0.tar.gz +Original-site: Unknown +Platforms: Linux (tested on 1.0.x-2.4.5, Slackware 4.0 thru 8.1); should + compile and work on almost any Unix, after library + compatibility is resolved and paths are checked in tune.h; + compiles clean with gcc 2.7.2.3 & 2.95.3. +Copying-policy: FRS +End diff --git a/source/a/getty-ps/slack-desc b/source/a/getty-ps/slack-desc new file mode 100644 index 00000000..dda6cf7a --- /dev/null +++ b/source/a/getty-ps/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +getty-ps: getty-ps (console or terminal login) +getty-ps: +getty-ps: /sbin/getty and /sbin/uugetty. +getty-ps: These control the process of logging into your system, and may be used +getty-ps: instead of 'agetty', which is the default getty included with the +getty-ps: util-linux package. getty-ps supports a number of enhancements such as +getty-ps: ringback support. +getty-ps: +getty-ps: getty-ps was originally written by Paul Sutcliffe, Jr, and is +getty-ps: currently maintained by Christine Jamison. +getty-ps: |