Compare commits
45 commits
for-divege
...
1.5
Author | SHA1 | Date | |
---|---|---|---|
![]() |
90a3d933a7 | ||
![]() |
99c35a4572 | ||
![]() |
69f002acd2 | ||
![]() |
2a47637d5e | ||
![]() |
007c2d3ccf | ||
![]() |
097a93441b | ||
![]() |
5469d5ec00 | ||
![]() |
42731b5ced | ||
![]() |
696a3973f1 | ||
![]() |
256a972787 | ||
![]() |
f5f7cf8153 | ||
![]() |
a0af8075ce | ||
![]() |
be15d1fc76 | ||
![]() |
9201509738 | ||
![]() |
8077ae6004 | ||
![]() |
e680e16ff8 | ||
![]() |
80e7839b97 | ||
![]() |
311fe03ec8 | ||
![]() |
a60ff18d3c | ||
![]() |
fd6525652d | ||
![]() |
dbf40dbc53 | ||
![]() |
f72a68acd9 | ||
![]() |
a0b03ac870 | ||
![]() |
c272cf17db | ||
![]() |
d8f6dd3b5e | ||
![]() |
6b03dd0ebd | ||
![]() |
ccac62f7e7 | ||
![]() |
608f4fb896 | ||
![]() |
e6c8f1b6c1 | ||
![]() |
d1e322d12d | ||
![]() |
16e428b36f | ||
![]() |
6fc342929c | ||
![]() |
27a087ac3d | ||
![]() |
06c238d486 | ||
![]() |
e4c67052ef | ||
![]() |
37f91bf330 | ||
![]() |
9869a3657d | ||
![]() |
261b0c5084 | ||
![]() |
24e4896584 | ||
![]() |
1ed5ce8edf | ||
![]() |
848c784e7f | ||
![]() |
2bd4a73b56 | ||
![]() |
d03d713004 | ||
![]() |
dc23fca1ce | ||
![]() |
0bfd961a8c |
14 changed files with 737 additions and 1248 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,2 +0,0 @@
|
||||||
timeoutd
|
|
||||||
*.o
|
|
27
Makefile
27
Makefile
|
@ -1,11 +1,22 @@
|
||||||
CFLAGS=-fomit-frame-pointer -O2 -s -g -Wall -Wno-unused-result
|
CFLAGS = -g -Wall
|
||||||
timeoutd: timeoutd.c Makefile
|
|
||||||
#$(CC) $(CFLAGS) -o timeoutd timeoutd.c
|
timeoutd: timeoutd.c
|
||||||
$(CC) $(CFLAGS) -o timeoutd.o -c timeoutd.c -DTIMEOUTDX11
|
$(CC) $(CFLAGS) -o timeoutd.o -c timeoutd.c -DTIMEOUTDX11
|
||||||
$(CC) $(CFLAGS) -o timeoutd -L/usr/X11R6/lib timeoutd.o -lXss -lXext -lX11
|
$(CC) $(CFLAGS) -o timeoutd timeoutd.o -lX11 -lXss
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-rm -f timeoutd timeoutd.o
|
||||||
|
|
||||||
install:
|
install: timeoutd /etc/timeouts
|
||||||
install -o root -g system -m 2111 timeoutd /usr/etc/timeoutd
|
install timeoutd /usr/sbin/timeoutd
|
||||||
install -o man -g info -m 444 timeoutd.8 /usr/man/man8
|
install timeoutd.8 /usr/share/man/man8
|
||||||
install -o man -g info -m 444 timeouts.5 /usr/man/man5
|
install timeouts.5 /usr/share/man/man5
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
rm /usr/sbin/timeoutd
|
||||||
|
rm /usr/share/man/man8/timeoutd.8
|
||||||
|
rm /usr/share/man/man5/timeouts.5
|
||||||
|
rm /etc/timeouts
|
||||||
|
|
||||||
|
/etc/timeouts:
|
||||||
|
install timeouts /etc
|
||||||
|
|
8
README
8
README
|
@ -14,18 +14,18 @@ your preferred compilation options, then simply:
|
||||||
|
|
||||||
make
|
make
|
||||||
|
|
||||||
The next step is to install a timeouts file in /usr/etc specifying
|
The next step is to install a timeouts file in /etc specifying
|
||||||
the parameters for each line/user/group combination. You can use
|
the parameters for each line/user/group combination. You can use
|
||||||
the sample file provided in the distribution as a starting point
|
the sample file provided in the distribution as a starting point
|
||||||
after reading the timeoutd.8 and timeouts.5 man pages.
|
after reading the timeoutd.8 and timeouts.5 man pages.
|
||||||
|
|
||||||
Once you have installed the timeouts file in /usr/etc, you can type:
|
Once you have installed the timeouts file in /etc, you can type:
|
||||||
|
|
||||||
make install
|
make install
|
||||||
|
|
||||||
to install the timeoutd binaries and man pages.
|
to install the timeoutd binaries and man pages.
|
||||||
|
|
||||||
Then it is just a matter of running /usr/etc/timeoutd. You may want
|
Then it is just a matter of running /usr/sbin/timeoutd. You may want
|
||||||
to add a line to your /etc/rc or /etc/rc.local (or whatever) to run
|
to add a line to your /etc/rc or /etc/rc.local (or whatever) to run
|
||||||
timeoutd at boot time.
|
timeoutd at boot time.
|
||||||
|
|
||||||
|
@ -40,5 +40,5 @@ line in /etc/profile near the top of the file:
|
||||||
/usr/etc/timeoutd `whoami` `basename \`tty\`` || exit
|
/usr/etc/timeoutd `whoami` `basename \`tty\`` || exit
|
||||||
|
|
||||||
|
|
||||||
Please sends bugs, comments, suggestions to:
|
Please send bugs, comments, suggestions to:
|
||||||
shanea@bigpond.net.au (Shane Alderton)
|
shanea@bigpond.net.au (Shane Alderton)
|
||||||
|
|
1
VERSION
1
VERSION
|
@ -1 +0,0 @@
|
||||||
1.5
|
|
7
debian/.gitignore
vendored
7
debian/.gitignore
vendored
|
@ -1,7 +0,0 @@
|
||||||
files
|
|
||||||
timeoutd.debhelper.log
|
|
||||||
timeoutd.postinst.debhelper
|
|
||||||
timeoutd.postrm.debhelper
|
|
||||||
timeoutd.prerm.debhelper
|
|
||||||
timeoutd.substvars
|
|
||||||
timeoutd
|
|
14
debian/changelog
vendored
14
debian/changelog
vendored
|
@ -1,11 +1,11 @@
|
||||||
timeoutd (1.5-10.2) unstable; urgency=low
|
timeoutd (1.5-10.1ubuntu1~1.gbp45a983) UNRELEASED; urgency=low
|
||||||
* Non-maintainer upload
|
|
||||||
* Resolve the missing symbol XOpenDisplay by linking with libX11
|
|
||||||
* Update debian/control Standards-Version: 3.9.5
|
|
||||||
* Ignore files generated by building debian package
|
|
||||||
* Update debian/compat to version 5
|
|
||||||
|
|
||||||
-- Clark Rawlins <clark@bit63.org> Sun, 14 Dec 2014 09:28:59 -0800
|
** SNAPSHOT build @45a9836343ec6efa904b51360713c52fb623d6d8 **
|
||||||
|
|
||||||
|
* UNRELEASED
|
||||||
|
* Fixed local X session handling
|
||||||
|
|
||||||
|
-- Shawn Willden <shawn@kahlan.willden.org> Sun, 04 Jan 2009 23:17:57 -0700
|
||||||
|
|
||||||
timeoutd (1.5-10.1) unstable; urgency=low
|
timeoutd (1.5-10.1) unstable; urgency=low
|
||||||
|
|
||||||
|
|
2
debian/compat
vendored
2
debian/compat
vendored
|
@ -1 +1 @@
|
||||||
5
|
4
|
||||||
|
|
4
debian/control
vendored
4
debian/control
vendored
|
@ -2,12 +2,12 @@ Source: timeoutd
|
||||||
Section: admin
|
Section: admin
|
||||||
Priority: extra
|
Priority: extra
|
||||||
Maintainer: Dennis Stampfer <seppy@debian.org>
|
Maintainer: Dennis Stampfer <seppy@debian.org>
|
||||||
Standards-Version: 3.9.5
|
Standards-Version: 3.6.2
|
||||||
Build-Depends: debhelper (>= 4), libx11-dev, libxss-dev
|
Build-Depends: debhelper (>= 4), libx11-dev, libxss-dev
|
||||||
|
|
||||||
Package: timeoutd
|
Package: timeoutd
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
Depends: ${shlibs:Depends}
|
||||||
Conflicts: suidmanager (<< 0.50)
|
Conflicts: suidmanager (<< 0.50)
|
||||||
Description: Flexible user timeout daemon with X11 support
|
Description: Flexible user timeout daemon with X11 support
|
||||||
timeoutd enforces the time restrictions specified for each or all users.
|
timeoutd enforces the time restrictions specified for each or all users.
|
||||||
|
|
5
debian/rules
vendored
5
debian/rules
vendored
|
@ -4,9 +4,6 @@
|
||||||
|
|
||||||
# Uncomment this to turn on verbose mode.
|
# Uncomment this to turn on verbose mode.
|
||||||
#export DH_VERBOSE=1
|
#export DH_VERBOSE=1
|
||||||
build-arch: build
|
|
||||||
|
|
||||||
build-indep: build
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
$(MAKE) timeoutd
|
$(MAKE) timeoutd
|
||||||
|
@ -23,7 +20,7 @@ clean:
|
||||||
install: build
|
install: build
|
||||||
dh_testdir
|
dh_testdir
|
||||||
dh_testroot
|
dh_testroot
|
||||||
dh_prep
|
dh_clean -k
|
||||||
dh_installdirs
|
dh_installdirs
|
||||||
|
|
||||||
# Add here commands to install the package into debian/<packagename>
|
# Add here commands to install the package into debian/<packagename>
|
||||||
|
|
1
debian/source/format
vendored
1
debian/source/format
vendored
|
@ -1 +0,0 @@
|
||||||
3.0 (git)
|
|
2
debian/timeoutd.init.d
vendored
2
debian/timeoutd.init.d
vendored
|
@ -16,8 +16,6 @@ DESC="user timeout daemon"
|
||||||
|
|
||||||
test -x $DAEMON || exit 0
|
test -x $DAEMON || exit 0
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
|
68
dump_wtmp.c
68
dump_wtmp.c
|
@ -1,68 +0,0 @@
|
||||||
#include <stdio.h>
|
|
||||||
#include <utmp.h>
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
FILE *fp;
|
|
||||||
struct utmp ut;
|
|
||||||
struct tm *tm;
|
|
||||||
char user[9];
|
|
||||||
char host[17];
|
|
||||||
char line[13];
|
|
||||||
|
|
||||||
if ((fp = fopen(UTMP_FILE, "r")) == NULL)
|
|
||||||
{
|
|
||||||
printf("Could not open wtmp file!");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Go to end of file minus one structure */
|
|
||||||
fseek(fp, -1L * sizeof(struct utmp), SEEK_END);
|
|
||||||
|
|
||||||
while (fread(&ut, sizeof(struct utmp), 1, fp) == 1)
|
|
||||||
{
|
|
||||||
tm = localtime(&ut.ut_time);
|
|
||||||
|
|
||||||
/*
|
|
||||||
if (tm->tm_year != now.tm_year || tm->tm_yday != now.tm_yday)
|
|
||||||
break;
|
|
||||||
*/
|
|
||||||
|
|
||||||
printf("%02d:%02d type=", tm->tm_hour,tm->tm_min);
|
|
||||||
switch (ut.ut_type)
|
|
||||||
{
|
|
||||||
#ifndef SUNOS
|
|
||||||
case RUN_LVL: printf("RUN_LVL");
|
|
||||||
break;
|
|
||||||
case BOOT_TIME: printf("BOOT_TIME");
|
|
||||||
break;
|
|
||||||
case NEW_TIME: printf("NEW_TIME");
|
|
||||||
break;
|
|
||||||
case OLD_TIME: printf("OLD_TIME");
|
|
||||||
break;
|
|
||||||
case INIT_PROCESS: printf("INIT_PROCESS");
|
|
||||||
break;
|
|
||||||
case LOGIN_PROCESS: printf("LOGIN_PROCESS");
|
|
||||||
break;
|
|
||||||
case USER_PROCESS: printf("USER_PROCESS");
|
|
||||||
break;
|
|
||||||
case DEAD_PROCESS: printf("DEAD_PROCESS");
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
default: printf("UNKNOWN!(type=%d)", ut.ut_type);
|
|
||||||
}
|
|
||||||
strncpy(user, ut.ut_user, 8);
|
|
||||||
user[8] = 0;
|
|
||||||
strncpy(host, ut.ut_host, 16);
|
|
||||||
host[16] = 0;
|
|
||||||
strncpy(line, ut.ut_line, 12);
|
|
||||||
line[12] = 0;
|
|
||||||
printf(" line=%s host=%s user=%s\n", line, host, user);
|
|
||||||
|
|
||||||
|
|
||||||
/* Position the file pointer 2 structures back */
|
|
||||||
if (fseek(fp, -2 * sizeof(struct utmp), SEEK_CUR) < 0) break;
|
|
||||||
}
|
|
||||||
fclose(fp);
|
|
||||||
}
|
|
10
timeoutd.8
10
timeoutd.8
|
@ -54,7 +54,15 @@ to login at that time, or whether they have exceeded their daily time limit.
|
||||||
When invoked in this way, by passing a username and tty (without the leading
|
When invoked in this way, by passing a username and tty (without the leading
|
||||||
/dev) on the command line,
|
/dev) on the command line,
|
||||||
.B timeoutd
|
.B timeoutd
|
||||||
returns one of the following exit codes:
|
returns an exit code and may leave an appropriate message.
|
||||||
|
.SH EXIT STATUS
|
||||||
|
When run in daemon mode,
|
||||||
|
.B timeoutd
|
||||||
|
may exit with an exit status of 1, in case of fatal error, or 0, if it has been
|
||||||
|
terminated by another process.
|
||||||
|
.PP
|
||||||
|
When invoked as a normal command, it will exit
|
||||||
|
with one of the following exit codes:
|
||||||
.IP "0 User is allowed to login
|
.IP "0 User is allowed to login
|
||||||
.IP "1 Fatal error
|
.IP "1 Fatal error
|
||||||
.IP "5 Incorrect command line format
|
.IP "5 Incorrect command line format
|
||||||
|
|
958
timeoutd.c
958
timeoutd.c
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue