packages: SysVinit/SysVinit.spec, SysVinit/sysvinit-alt-fixes.patch, SysVin...
wiget
wiget at pld-linux.org
Sun Dec 4 00:11:56 CET 2011
Author: wiget Date: Sat Dec 3 23:11:56 2011 GMT
Module: packages Tag: HEAD
---- Log message:
- up to 2.88
- removed patches applied or fixed upstream:
sysvinit-blowfish.patch sysvinit-chroot.patch
sysvinit-console-open.patch sysvinit-godot.patch
sysvinit-haltname.patch sysvinit-ipv6.patch
sysvinit-maxproclen.patch sysvinit-md5-bigendian.patch
sysvinit-no-abort.patch sysvinit-selinux.patch
sysvinit-timeval.patch
---- Files affected:
packages/SysVinit:
SysVinit.spec (1.160 -> 1.161) , sysvinit-alt-fixes.patch (1.3 -> 1.4) , sysvinit-killall5.patch (1.2 -> 1.3) , sysvinit-lastlog.patch (1.1 -> 1.2) , sysvinit-man.patch (1.7 -> 1.8) , sysvinit-paths.patch (1.11 -> 1.12) , sysvinit-pidof.patch (1.2 -> 1.3) , sysvinit-wtmp.patch (1.1 -> 1.2) , sysvinit-blowfish.patch (1.1 -> NONE) (REMOVED), sysvinit-chroot.patch (1.1 -> NONE) (REMOVED), sysvinit-console-open.patch (1.1 -> NONE) (REMOVED), sysvinit-godot.patch (1.1 -> NONE) (REMOVED), sysvinit-haltname.patch (1.1 -> NONE) (REMOVED), sysvinit-ipv6.patch (1.1 -> NONE) (REMOVED), sysvinit-maxproclen.patch (1.1 -> NONE) (REMOVED), sysvinit-md5-bigendian.patch (1.1 -> NONE) (REMOVED), sysvinit-no-abort.patch (1.1 -> NONE) (REMOVED), sysvinit-selinux.patch (1.11 -> NONE) (REMOVED), sysvinit-timeval.patch (1.1 -> NONE) (REMOVED)
---- Diffs:
================================================================
Index: packages/SysVinit/SysVinit.spec
diff -u packages/SysVinit/SysVinit.spec:1.160 packages/SysVinit/SysVinit.spec:1.161
--- packages/SysVinit/SysVinit.spec:1.160 Tue Nov 29 00:49:58 2011
+++ packages/SysVinit/SysVinit.spec Sun Dec 4 00:11:50 2011
@@ -14,38 +14,27 @@
Summary(tr.UTF-8): System V başlatma programı
Summary(uk.UTF-8): Програми, що керують базовими системними процесами
Name: SysVinit
-Version: 2.86
-Release: 29
+Version: 2.88
+Release: 0.1
License: GPL
Group: Base
-Source0: ftp://ftp.cistron.nl/pub/people/miquels/software/sysvinit-%{version}.tar.gz
-# Source0-md5: 7d5d61c026122ab791ac04c8a84db967
+Source0: http://download.savannah.gnu.org/releases/sysvinit/sysvinit-%{version}dsf.tar.bz2
+# Source0-md5: 6eda8a97b86e0a6f59dabbf25202aa6f
Source1: sysvinit.logrotate
Source2: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/sysvinit-non-english-man-pages.tar.bz2
# Source2-md5: 9ae8a63a4685368fae19707f95475cca
Patch0: sysvinit-paths.patch
Patch1: sysvinit-bequiet.patch
-Patch2: sysvinit-md5-bigendian.patch
Patch3: sysvinit-wtmp.patch
Patch4: sysvinit-man.patch
Patch5: sysvinit-halt.patch
-Patch6: sysvinit-blowfish.patch
Patch7: sysvinit-autofsck.patch
Patch8: sysvinit-pidof.patch
Patch9: sysvinit-killall5.patch
-Patch10: sysvinit-selinux.patch
Patch11: sysvinit-nopowerstates-single.patch
Patch12: sysvinit-lastlog.patch
Patch13: sysvinit-alt-fixes.patch
-Patch14: sysvinit-chroot.patch
-Patch15: sysvinit-console-open.patch
-Patch16: sysvinit-godot.patch
-Patch17: sysvinit-haltname.patch
-Patch18: sysvinit-ipv6.patch
-Patch19: sysvinit-maxproclen.patch
Patch20: sysvinit-quiet.patch
-Patch21: sysvinit-timeval.patch
-Patch22: sysvinit-no-abort.patch
Patch23: sysvinit-rebootconfirmation.patch
%if %{with selinux}
BuildRequires: libselinux-devel >= 1.28
@@ -131,37 +120,27 @@
management.
%prep
-%setup -q -n sysvinit-%{version}
+%setup -q -n sysvinit-%{version}dsf
%patch0 -p1
%patch1 -p1
-%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
-%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
-%{?with_selinux:%patch10 -p1}
%patch11 -p1
%patch12 -p1
%patch13 -p1
-%patch14 -p1
-%patch15 -p1
-%patch16 -p1
-%patch17 -p1
-%patch18 -p1
-%patch19 -p1
%patch20 -p1
-%patch21 -p1
-%patch22 -p1
%patch23 -p0
%build
%{__make} -C src \
+ %{?with_selinux:WITH_SELINUX=yes} \
CC="%{__cc}" \
LCRYPT="-lcrypt" \
- OPTIMIZE="%{rpmcflags}" \
+ CFLAGS="%{rpmcflags}" \
LDFLAGS="%{rpmldflags}"
%install
@@ -178,6 +157,7 @@
ln -s ../var/run/initrunlvl $RPM_BUILD_ROOT%{_sysconfdir}
ln -s killall5 $RPM_BUILD_ROOT%{_sbindir}/pidof
+ln -s utmpdump $RPM_BUILD_ROOT%{_bindir}/utmpx-dump
> $RPM_BUILD_ROOT%{_sysconfdir}/ioctl.save
> $RPM_BUILD_ROOT/var/log/btmpx
@@ -187,6 +167,7 @@
> $RPM_BUILD_ROOT/var/run/initrunlvl
echo .so last.1 > $RPM_BUILD_ROOT%{_mandir}/man1/lastb.1
+echo .so utmpdump.1 > $RPM_BUILD_ROOT%{_mandir}/man1/utmpx-dump.1
echo .so halt.8 > $RPM_BUILD_ROOT%{_mandir}/man8/poweroff.8
echo .so halt.8 > $RPM_BUILD_ROOT%{_mandir}/man8/reboot.8
echo .so init.8 > $RPM_BUILD_ROOT%{_mandir}/man8/telinit.8
@@ -321,6 +302,7 @@
%files tools
%defattr(644,root,root,755)
%attr(755,root,root) /bin/pidof
+%attr(755,root,root) %{_sbindir}/fstab-decode
%attr(755,root,root) %{_sbindir}/killall5
%attr(755,root,root) %{_sbindir}/lastlog
%attr(755,root,root) %{_sbindir}/pidof
@@ -328,6 +310,7 @@
%attr(755,root,root) %{_bindir}/last
%attr(755,root,root) %{_bindir}/lastb
%attr(755,root,root) %{_bindir}/mesg
+%attr(755,root,root) %{_bindir}/utmpdump
%attr(755,root,root) %{_bindir}/utmpx-dump
%attr(755,root,root) %{_bindir}/wall
%attr(640,root,root) %ghost /var/log/faillog
@@ -336,9 +319,12 @@
%{_mandir}/man1/lastb.1*
%{_mandir}/man1/mesg.1*
%{_mandir}/man1/wall.1*
+%{_mandir}/man1/utmpdump.1*
+%{_mandir}/man1/utmpx-dump.1*
%{_mandir}/man8/killall5.8*
%{_mandir}/man8/pidof.8*
%{_mandir}/man8/sulogin.8*
+%{_mandir}/man8/fstab-decode.8*
%lang(cs) %{_mandir}/cs/man8/lastlog.8*
%lang(es) %{_mandir}/es/man1/last.1*
%lang(es) %{_mandir}/es/man1/lastb.1
@@ -399,6 +385,16 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.161 2011/12/03 23:11:50 wiget
+- up to 2.88
+- removed patches applied or fixed upstream:
+ sysvinit-blowfish.patch sysvinit-chroot.patch
+ sysvinit-console-open.patch sysvinit-godot.patch
+ sysvinit-haltname.patch sysvinit-ipv6.patch
+ sysvinit-maxproclen.patch sysvinit-md5-bigendian.patch
+ sysvinit-no-abort.patch sysvinit-selinux.patch
+ sysvinit-timeval.patch
+
Revision 1.160 2011/11/28 23:49:58 gotar
- moved /var/log/{fail,last}log to tools too, other cosmetics, rel. 29
================================================================
Index: packages/SysVinit/sysvinit-alt-fixes.patch
diff -u packages/SysVinit/sysvinit-alt-fixes.patch:1.3 packages/SysVinit/sysvinit-alt-fixes.patch:1.4
--- packages/SysVinit/sysvinit-alt-fixes.patch:1.3 Tue Nov 13 11:07:26 2007
+++ packages/SysVinit/sysvinit-alt-fixes.patch Sun Dec 4 00:11:50 2011
@@ -1,29 +1,15 @@
-diff -upk.orig sysvinit-2.86.orig/src/bootlogd.c sysvinit-2.86/src/bootlogd.c
---- sysvinit-2.86.orig/src/bootlogd.c 2007-01-06 14:37:36 +0000
-+++ sysvinit-2.86/src/bootlogd.c 2007-01-06 14:38:09 +0000
-@@ -232,6 +232,9 @@ int consolename(char *res, int rlen)
- #ifdef TIOCGDEV
- if (ioctl(0, TIOCGDEV, &kdev) == 0)
- return findtty(res, rlen, (dev_t)kdev);
-+#ifndef ENOIOCTLCMD
-+#define ENOIOCTLCMD 515
-+#endif
- if (errno != ENOIOCTLCMD) return -1;
- #endif
-
-diff -upk.orig sysvinit-2.86.orig/src/init.c sysvinit-2.86/src/init.c
---- sysvinit-2.86.orig/src/init.c 2007-01-06 14:37:36 +0000
-+++ sysvinit-2.86/src/init.c 2007-01-06 14:38:09 +0000
-@@ -785,7 +785,7 @@ char **init_buildenv(int child)
- for (n = 0; environ[n]; n++)
- ;
- n += NR_EXTRA_ENV + 8;
+--- sysvinit-2.88dsf/src/init.c.wiget 2011-12-03 23:39:16.988206898 +0100
++++ sysvinit-2.88dsf/src/init.c 2011-12-03 23:47:53.761427001 +0100
+@@ -880,7 +880,7 @@ char **init_buildenv(int child)
+ n += NR_EXTRA_ENV;
+ if (child)
+ n += 8;
- e = calloc(n, sizeof(char *));
+ e = imalloc(n * sizeof(char *));
for (n = 0; environ[n]; n++)
e[n] = istrdup(environ[n]);
-@@ -814,6 +814,9 @@ void init_freeenv(char **e)
+@@ -911,6 +911,9 @@ void init_freeenv(char **e)
{
int n;
@@ -33,7 +19,7 @@
for (n = 0; e[n]; n++)
free(e[n]);
free(e);
-@@ -1834,7 +1837,7 @@ void re_exec(void)
+@@ -1976,7 +1979,7 @@ void re_exec(void)
CHILD *ch;
sigset_t mask, oldset;
pid_t pid;
@@ -42,15 +28,12 @@
int fd;
if (strchr("S0123456",runlevel) == NULL)
-@@ -1885,11 +1885,13 @@
- exit(0);
- }
-
-- /*
-- * The existing init process execs a new init binary.
-- */
+@@ -2027,8 +2030,13 @@ void re_exec(void)
+ /*
+ * The existing init process execs a new init binary.
+ */
- env = init_buildenv(0);
-- execl(myname, myname, "--init", NULL, env);
+- execle(myname, myname, "--init", NULL, env);
+ if (pid > 0) {
+ /*
+ * The existing init process execs a new init binary.
@@ -61,7 +44,7 @@
/*
* We shouldn't be here, something failed.
-@@ -2557,7 +2562,7 @@ int telinit(const char *progname, int ar
+@@ -2729,7 +2737,7 @@ int telinit(char *progname, int argc, ch
if (!strchr("0123456789SsQqAaBbCcUu", argv[optind][0]))
usage(progname);
request.cmd = INIT_CMD_RUNLVL;
================================================================
Index: packages/SysVinit/sysvinit-killall5.patch
diff -u packages/SysVinit/sysvinit-killall5.patch:1.2 packages/SysVinit/sysvinit-killall5.patch:1.3
--- packages/SysVinit/sysvinit-killall5.patch:1.2 Mon Dec 27 00:21:51 2004
+++ packages/SysVinit/sysvinit-killall5.patch Sun Dec 4 00:11:50 2011
@@ -1,36 +1,40 @@
---- sysvinit-2.86/src/killall5.c.orig 2004-12-26 23:07:15.505343096 +0100
-+++ sysvinit-2.86/src/killall5.c 2004-12-26 23:20:43.017582576 +0100
-@@ -193,6 +193,7 @@
- if (p->argv0) free(p->argv0);
+diff -u sysvinit-2.88dsf/src/killall5.c sysvinit-2.88dsf/src/killall5.c
+--- sysvinit-2.88dsf/src/killall5.c 2011-12-03 23:12:52.373139250 +0100
++++ sysvinit-2.88dsf/src/killall5.c 2011-12-03 23:19:21.498025134 +0100
+@@ -479,6 +479,7 @@
if (p->argv1) free(p->argv1);
+ if (p->statname) free(p->statname);
if (p->pathname) free(p->pathname);
+ if (p->statname) free(p->statname);
free(p);
}
plist = NULL;
-@@ -210,7 +211,7 @@
+@@ -496,7 +497,7 @@
/* Open the status file. */
- snprintf(path, sizeof(path), "/proc/%s/stat", d->d_name);
+ snprintf(path, sizeof(path), "%s/stat", d->d_name);
- /* Read SID & statname from it. */
+ /* Read statname from it. */
- if ((fp = fopen(path, "r")) != NULL) {
+ if ((fp = fopen(path, "r")) != NULL) {
buf[0] = 0;
fgets(buf, sizeof(buf), fp);
-@@ -223,11 +224,11 @@
+@@ -509,7 +510,6 @@
/* Read program name. */
q = strrchr(buf, ')');
if (q == NULL) {
- p->sid = 0;
nsyslog(LOG_ERR,
- "can't get program name from %s\n",
+ "can't get program name from /proc/%s\n",
path);
+@@ -517,6 +517,7 @@
+ if (p->argv1) free(p->argv1);
+ if (p->statname) free(p->statname);
free(p);
+ fclose(fp);
continue;
}
s++;
-@@ -242,20 +243,23 @@
+@@ -531,23 +532,26 @@
/* Get session, startcode, endcode. */
startcode = endcode = 0;
@@ -52,6 +56,9 @@
- path);
+ nsyslog(LOG_ERR, "can't read sid for pid %d\n", pid);
+ free(p->statname);
+ if (p->argv0) free(p->argv0);
+ if (p->argv1) free(p->argv1);
+ if (p->statname) free(p->statname);
free(p);
continue;
}
@@ -60,4 +67,4 @@
- fclose(fp);
} else {
/* Process disappeared.. */
- free(p);
+ if (p->argv0) free(p->argv0);
================================================================
Index: packages/SysVinit/sysvinit-lastlog.patch
diff -u packages/SysVinit/sysvinit-lastlog.patch:1.1 packages/SysVinit/sysvinit-lastlog.patch:1.2
--- packages/SysVinit/sysvinit-lastlog.patch:1.1 Wed Aug 22 17:06:53 2007
+++ packages/SysVinit/sysvinit-lastlog.patch Sun Dec 4 00:11:50 2011
@@ -1,120 +1,320 @@
-diff -urN sysvinit-2.86/man/intl/cs/man8/lastlog.8 sysvinit-2.86-lastlog/man/intl/cs/man8/lastlog.8
---- sysvinit-2.86/man/intl/cs/man8/lastlog.8 1970-01-01 01:00:00.000000000 +0100
-+++ sysvinit-2.86-lastlog/man/intl/cs/man8/lastlog.8 2006-08-03 12:00:56.000000000 +0200
-@@ -0,0 +1,40 @@
-+.\" @(#)lastlog.8 3.3 08:24:58 29 Sep 1993 (National Guard Release)
-+.\" $Id$
-+.\"
-+.TH LASTLOG 8
-+.SH JMÉNO
-+lastlog \- prozkoumá soubor lastlog
-+.SH SYNTAXE
-+.B lastlog
-+.RB [ \-u
-+.IR přihlašovací\-jméno ]
-+.RB [ \-t
-+.IR dny ]
-+.SH POPIS
-+\fBlastlog\fR setřídí a zobrazí obsah souboru
-+\fI/var/log/lastlog\fR,
-+který obsahuje záznamy o přihlašování a odhlašování uživatelů v systému.
-+Zobrazí se \fBpřihlašovací jméno\fR, \fBjméno terminálu\fR a \fBčas posledního
-+přihlašení\fR.
-+Standardně (tj. bez dalších voleb) lastlog zobrazí záznamy setříděné
-+podle čísla UID.
-+Použití přepínače \fB\-u \fIpřihlašovací\-jméno\fR
-+způsobí, že bude vytištěn pouze poslední záznam o přihlášení příslušného uživatele.
-+Zadáním \fB\-t \fIdny\fR se zobrazí pouze
-+ta přihlášení, které jsou dřívější než zadané \fIdny\fR.
-+Parametr \fB\-t\fR překryje případný parametr \fB\-u\fR.
-+.PP
-+Pokud se uživatel ještě nikdy nepřihlásil, zobrazí se zpráva \fB"**Never logged in**"\fR (Nikdy nepřihlášen)
-+místo jména terminálu a času.
-+.SH SOUBORY
-+/var/log/lastlog \- soubor se záznamy o přihlášení a odhlášení
-+.SH NÁMITKY
-+Velké rozdíly v UID číslech jsou způsobeny tím, že lastlog program běžel dlouho bez
-+výstupu na obrazovku (např. mmdf=800 a poslední uid=170, program se bude
-+jevit jako s uid 171\-799).
-+.SH AUTOŘI
-+Julianne Frances Haugh (jfh at austin.ibm.com)
-+.br
-+Phillip Street
-+.SH PŘELOŽIL
-+Ondřej Pavlíček (mox at post.cz).
-diff -urN sysvinit-2.86/man/intl/fr/man8/lastlog.8 sysvinit-2.86-lastlog/man/intl/fr/man8/lastlog.8
---- sysvinit-2.86/man/intl/fr/man8/lastlog.8 1970-01-01 01:00:00.000000000 +0100
-+++ sysvinit-2.86-lastlog/man/intl/fr/man8/lastlog.8 2006-08-03 12:00:56.000000000 +0200
-@@ -0,0 +1,66 @@
+--- sysvinit-2.88dsf/src/Makefile.wiget 2010-04-11 11:30:27.000000000 +0200
++++ sysvinit-2.88dsf/src/Makefile 2011-12-03 23:38:27.970109228 +0100
+@@ -15,13 +15,13 @@ STATIC =
+
+ # For some known distributions we do not build all programs, otherwise we do.
+ BIN =
+-SBIN = init halt shutdown runlevel killall5 fstab-decode
++SBIN = init halt shutdown runlevel killall5 fstab-decode lastlog
+ USRBIN = last mesg
+
+ MAN1 = last.1 lastb.1 mesg.1
+ MAN5 = initscript.5 inittab.5
+ MAN8 = halt.8 init.8 killall5.8 pidof.8 poweroff.8 reboot.8 runlevel.8
+-MAN8 += shutdown.8 telinit.8 fstab-decode.8
++MAN8 += shutdown.8 telinit.8 fstab-decode.8 lastlog.8
+
+ ifeq ($(DISTRO),)
+ BIN += mountpoint
+@@ -96,6 +96,9 @@ halt: halt.o ifdown.o hddown.o utmp.o r
+
+ last: last.o oldutmp.h
+
++lastlog: lastlog.o
++ $(CC) $(LDFLAGS) -o $@ lastlog.o
++
+ mesg: mesg.o
+
+ mountpoint: mountpoint.o
+--- sysvinit-2.88dsf/src/lastlog.c.wiget 2011-12-03 23:31:01.697380950 +0100
++++ sysvinit-2.88dsf/src/lastlog.c 2011-12-03 23:31:01.697380950 +0100
+@@ -0,0 +1,217 @@
++/*
++ * Copyright 1989 - 1994, Julianne Frances Haugh
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of Julianne F. Haugh nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``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 JULIE HAUGH OR CONTRIBUTORS 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.
++ */
++
++#ident "$Id$"
++
++#include <getopt.h>
++#include <lastlog.h>
++#include <pwd.h>
++#include <stdio.h>
++#include <sys/stat.h>
++#include <sys/types.h>
++#include <time.h>
++#include <stdlib.h>
++/*
++ * Needed for MkLinux DR1/2/2.1 - J.
++ */
++#ifndef LASTLOG_FILE
++#define LASTLOG_FILE "/var/log/lastlog"
++#endif
++/*
++ * Global variables
++ */
++static FILE *lastlogfile; /* lastlog file stream */
++static off_t user; /* one single user, specified on command line */
++static int days; /* number of days to consider for print command */
++static time_t seconds; /* that number of days in seconds */
++static int inverse_days; /* number of days to consider for print command */
++static time_t inverse_seconds; /* that number of days in seconds */
++
++
++static int uflg = 0; /* set if user is a valid user id */
++static int tflg = 0; /* print is restricted to most recent days */
++static int bflg = 0; /* print excludes most recent days */
++static struct lastlog lastlog; /* scratch structure to play with ... */
++static struct stat statbuf; /* fstat buffer for file size */
++static struct passwd *pwent;
++
++#define NOW (time ((time_t *) 0))
++
++static void usage (void)
++{
++ fprintf (stdout, "Usage: lastlog [options]\n"
++ "\n"
++ "Options:\n"
++ " -b, --before DAYS print only lastlog records older than DAYS\n"
++ " -h, --help display this help message and exit\n"
++ " -t, --time DAYS print only lastlog records more recent than DAYS\n"
++ " -u, --user LOGIN print lastlog record for user with specified LOGIN\n"
++ "\n");
++ exit(1);
++}
++
++static void print_one (const struct passwd *pw)
++{
++ static int once;
++ char *cp;
++ struct tm *tm;
++ time_t ll_time;
++
++#ifdef HAVE_STRFTIME
++ char ptime[80];
++#endif
++
++ if (!pw)
++ return;
++
++ if (!once) {
++#ifdef HAVE_LL_HOST
++ printf ("Username Port From Latest\n");
++#else
++ printf ("Username Port Latest\n");
++#endif
++ once++;
++ }
++ ll_time = lastlog.ll_time;
++ tm = localtime (&ll_time);
++#ifdef HAVE_STRFTIME
++ strftime (ptime, sizeof (ptime), "%a %b %e %H:%M:%S %z %Y", tm);
++ cp = ptime;
++#else
++ cp = asctime (tm);
++ cp[24] = '\0';
++#endif
++
++ if (lastlog.ll_time == (time_t) 0)
++ cp = "**Never logged in**\0";
++
++#ifdef HAVE_LL_HOST
++ printf ("%-16s %-8.8s %-16.16s %s\n", pw->pw_name,
++ lastlog.ll_line, lastlog.ll_host, cp);
++#else
++ printf ("%-16s\t%-8.8s %s\n", pw->pw_name, lastlog.ll_line, cp);
++#endif
++}
++
++static void print (void)
++{
++ off_t offset;
++
++ if (uflg) {
++ offset = user * sizeof lastlog;
++
++ if (fstat (fileno (lastlogfile), &statbuf)) {
++ perror (LASTLOG_FILE);
++ return;
++ }
++ if (offset >= statbuf.st_size)
++ return;
++
++ fseeko (lastlogfile, offset, SEEK_SET);
++ if (fread ((char *) &lastlog, sizeof lastlog, 1,
++ lastlogfile) == 1)
++ print_one (pwent);
++ else
++ perror (LASTLOG_FILE);
++ } else {
++ setpwent ();
++ while ((pwent = getpwent ())) {
++ user = pwent->pw_uid;
++ offset = user * sizeof lastlog;
++
++ fseeko (lastlogfile, offset, SEEK_SET);
++ if (fread ((char *) &lastlog, sizeof lastlog, 1,
++ lastlogfile) != 1)
++ continue;
++
++ if (tflg && NOW - lastlog.ll_time > seconds)
++ continue;
++
++ if (bflg && NOW - lastlog.ll_time < inverse_seconds)
++ continue;
++
++ print_one (pwent);
++ }
++ }
++}
++
++int main (int argc, char **argv)
++{
++ int c;
++ static struct option const longopts[] = {
++ {"help", no_argument, NULL, 'h'},
++ {"time", required_argument, NULL, 't'},
++ {"before", required_argument, NULL, 'b'},
++ {"user", required_argument, NULL, 'u'},
++ {NULL, 0, NULL, '\0'}
++ };
++
++ while ((c = getopt_long (argc, argv, "ht:b:u:", longopts, NULL)) != -1) {
++ switch (c) {
++ case 'h':
++ usage ();
++ break;
++ case 't':
++ days = atoi (optarg);
++ seconds = days * (24L*3600L);
++ tflg++;
++ break;
++ case 'b':
++ inverse_days = atoi (optarg);
++ inverse_seconds = inverse_days * (24L*3600L);
++ bflg++;
++ break;
++ case 'u':
++ pwent = getpwnam (optarg);
++ if (!pwent) {
++ fprintf (stderr, "Unknown User: %s\n", optarg);
++ exit (1);
++ }
++ uflg++;
++ user = pwent->pw_uid;
++ break;
++ default:
++ usage ();
++ break;
++ }
++ }
++ if (argc > optind) {
++ fprintf (stderr, "lastlog: unexpected argument: %s\n", argv[optind]);
++ usage();
++ }
++
<<Diff was trimmed, longer than 597 lines>>
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/SysVinit/SysVinit.spec?r1=1.160&r2=1.161&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/SysVinit/sysvinit-alt-fixes.patch?r1=1.3&r2=1.4&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/SysVinit/sysvinit-killall5.patch?r1=1.2&r2=1.3&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/SysVinit/sysvinit-lastlog.patch?r1=1.1&r2=1.2&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/SysVinit/sysvinit-man.patch?r1=1.7&r2=1.8&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/SysVinit/sysvinit-paths.patch?r1=1.11&r2=1.12&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/SysVinit/sysvinit-pidof.patch?r1=1.2&r2=1.3&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/SysVinit/sysvinit-wtmp.patch?r1=1.1&r2=1.2&f=u
More information about the pld-cvs-commit
mailing list