socklog-2.1.1+repack/ 0000755 0000000 0000000 00000000000 14702065454 013122 5 ustar root root socklog-2.1.1+repack/doc/ 0000755 0000000 0000000 00000000000 14702065454 013667 5 ustar root root socklog-2.1.1+repack/doc/notify.html 0000644 0000000 0000000 00000010000 14702065454 016054 0 ustar root root
socklog - log events notification
G. Pape
socklog
socklog - log events notification
The service socklog-notify provides instant notification of
log events. There is an interval in seconds for the creation of
notifications to prevent a flood.
Set up the socklog-notify service as described in
Configuration to ensure that the
named pipe /var/log/socklog/.notify exists. Do not delete
this file after creation.
Read disable notifications before stopping the
socklog-notify service once it is started.
socklog-notify is handled by the
uncat program.
how to configure log events
Choose a log controlled by
svlogd
to be watched for log events, say /var/log/socklog/main/.
Make sure the account running this log service is member of the
socklog group adm. If it isn't, change it now. Make sure
that the socklog-notify service is running.
Redirect the standard error output of
svlogd
to the named pipe socklog-notify is reading from.
To do so, insert exec 2> /var/log/socklog/.notify as second
line into /var/service/socklog-unix/log/run:
#!/bin/sh
exec 2> /var/log/socklog/.notify
exec setuidgid log svlogd \
main/main main/auth main/cron main/daemon main/debug main/ftp \
main/kern main/local main/mail main/news main/syslog main/user
svlogd's
error messages are always log events.
To configure additional log events in
/var/log/socklog/main/, use the e instruction in the
config file of this log, see the
svlogd man page.
For example, if you want to be notified about all log messages of the
priority alert, add a corresponding e instruction to the
config file /var/log/socklog/main/config like this:
s999999
n10
e*.alert: *
Then tell the log service to re-read the config files:
# sv hup socklog-unix/log
how to configure the notification
Per default, socklog-notify injects a mail to a specified
address containing the log events, but the behavior is configurable, so
you can change it to use instant or short messaging service for example.
To configure the kind of notification, edit
/etc/sv/socklog-notify/run and change the prog argument
of uncat to your needs. This example
uses sms_client to notify:
#!/bin/sh -e
PIPE=/var/log/socklog/.notify
if [ ! -p "$PIPE" ]; then mkfifo -m0620 "$PIPE"; chown log:adm "$PIPE"; fi
exec <> "$PIPE"
exec setuidgid log uncat -s49999 -t90 \
sh -c 'head -c140 | sms_client pager'
Then restart the service:
# sv restart socklog-notify
Another example using wall:
exec setuidgid log uncat -vs49999 -t180 sh -c 'head | wall'
Disable log event notifications
You need to disable all log event notifications before stopping
the socklog-notify service. To check which services are configured
for sending log events, run:
# grep -F /var/log/socklog/.notify /var/service/*/log/run
For each of these services, edit the corresponding log/run script
to remove the exec 2>/var/log/socklog/.notify line and the
configured log event(s) and restart its log service:
# sv restart <service>/log
Now it is safe to stop the socklog-notify service.
Gerrit Pape <pape@smarden.org>
socklog-2.1.1+repack/doc/benefits.html 0000644 0000000 0000000 00000011476 14702065454 016365 0 ustar root root
socklog - benefits
G. Pape
socklog
socklog - benefits
Log file rotation based on file size
Selecting and de-selecting log entries
Modular, reliable network logging
Sortable logs
Small code size
Most of the benefits described here are actually benefits of
svlogd and
multilog.
But since socklog uses
svlogd
as its back-end, the benefits apply
to syslogging with socklog.
svlogd
supports automatically rotated logs, there is no need for any other
tool running from cron or similar to rotate the logs.
svlogd
keeps a specified number of log files with a maximum file size, so it is
possible to calculate a log file partition properly.
For example, this log/run file
#!/bin/sh
LOGDIR=/var/log/socklog
exec setuidgid log svlogd ${LOGDIR}/main ${LOGDIR}/debug
with these log config files
# cat /var/log/socklog/main/config
s4999999
n10
# cat /var/log/socklog/debug/config
s999999
n5
-*
+*.debug*
causes
svlogd
to hold maximal 10 log files, each of maximal size
4999999 bytes in /var/log/socklog/main/, and maximal 5 log files,
each of maximal size 999999 bytes in /var/log/socklog/debug/.
So the maximal used space for these both logs is less then:
(10 * 5000000) + (5 * 1000000) = 55000000 bytes < 55 MB
If there is any service acting up and filling up your logs rapidly,
you will never run into a filled up log partition, causing loss of new
log entries, even of other services.
You can lose old log entries from this service, but will ever have the
recent ones.
Please note that above numbers could change if you use
svlogd
with a processor.
svlogd
supports selecting and de-selecting log lines based on pattern matching.
This is much more flexible than the usual syslogd support for
selecting log entries by facility and priority.
Of course, selecting entries by facility or priority is
still possible with socklog and
svlogd,
just like the default socklog-unix configuration shows.
This line selection feature is also used for socklog's instant
Log events notification.
The socklog-inet service can be used to replace a syslog
network server, receiving log messages on UDP port 514.
Usually syslog clients try to transmit their logs to that port
using UDP.
socklog does not support this UDP network logging on the client
side.
socklog provides a different modular, reliable
Network logging concept instead.
Logs are transmitted through network using a TCP connection in the default
configuration, log transmission failures are handled.
The modular design of
runit and
socklog makes it possible to insert encryption, authentication,
compression, and more, easily.
If svlogd is
told to prepend log lines with time-stamps, the resulting logs are sortable.
So it is possible to merge different logs and sort them chronologically
without special effort.
One of the socklog project's principles is to keep the code size
minimal. As of version 0.8.0 of socklog, the socklog.c
source contains only about 400 lines of code; the uncat.c source is
about 200 lines of code.
This minimizes the possibility of bugs introduced by programmer's fault,
and makes it more easy for security related people to proofread the source
code.
Of course this also means that socklog never will evolve to a
multi-/over-featured, bloated project.
Gerrit Pape <pape@smarden.org>
socklog-2.1.1+repack/doc/upgrade.html 0000644 0000000 0000000 00000006244 14702065454 016212 0 ustar root root
socklog - upgrading from previous versions
G. Pape
socklog
socklog - upgrading from previous versions
2.1.0 to 2.1.1
No further action from you is required.
2.0.x to 2.1.0
For new installations, the socklog-conf
program now creates the socklog service directories in /etc/sv/
and names them socklog-unix, socklog-klog, ...;
you don't necessarily need to adapt existing installations.
Additionally socklog-conf now by default
creates a ./check script in the socklog-unix service
directory, which is utilized by runit's
sv program when starting
or checking the service.
To update existing installations, you can create the script manually:
# cd /var/service/socklog-unix
# cat >check <<EOT
#!/bin/sh
exec socklog-check unix /dev/log
EOT
# chmod 755 check
1.5.0 to 2.0.x
The tryto program supports a new option -P to run
the program given at the command line in a new session, and signal the
process group on timeouts.
1.4.1 or 1.4.2 to 1.5.0
This version introduces the socklog-check
program which can be used to check for the availability of a syslog service
listening on /dev/log or other sockets.
The socklog program now understands the -U
option in unix mode to create unix domain sockets with permissions other
than 777.
1.3.0 or 1.3.1 to 1.4.1 or 1.4.2
No further action from you is required.
1.2.0 to 1.3.0 or 1.3.1
With this version socklog supports old-style syslog network logging through
UDP in cooperation with the runit
package.
The web page about network logging has been
updated accordingly.
1.1.0 or 1.1.1 to 1.2.0
The socklog-conf program now creates
slightly different run scripts that utilize the new
chpst program from the
runit package.
Please refer to the examples if you want to adapt
your current run scripts.
1.0.0 to 1.1.0 or 1.1.1
The socklog package now cooperates with the runit package instead of the
daemontools package to provide syslog services.
If you don't want to change your current configuration to utilize the
programs from the runit package, you don't need to upgrade.
If you want to upgrade nonetheless, but still use the programs from the
daemontools package, no further action from you but installing the new
socklog version is required.
If you want to switch your configuration to utilize the runit package, you
need to re-create your service directories using the
socklog-conf program.
Gerrit Pape <pape@smarden.org>
socklog-2.1.1+repack/doc/uncat.1.html 0000644 0000000 0000000 00000005340 14702065454 016030 0 ustar root root
uncat(1) manual page
G. Pape
socklog
uncat - continuously reads stdin, splits up the data either by timeout
or number of bytes read to process it
uncat [-vo] [-t seconds] [-s
size] prog
uncat continuously reads stdin and repeatedly processes
the data either after seconds timeout or maximal number of bytes size read.
To process the data, uncat starts prog and feeds the data into prog’s standard
input. prog’s standard output is redirected to standard error. uncat never
writes to standard output.
prog consist of one or more arguments.
If prog
exits non-zero, uncat prints an error message, discards the data and continues
to read stdin.
Note that uncat is not crash proof.
uncat is used to run the
socklog-notify service.
- -v
- verbose. Print verbose messages to stderr.
- -o
- once. Exit on end of input. Normally uncat continues waiting for data on
standard input, even on end of file.
- -t seconds
- timeout. Set the timeout to
seconds seconds. Default is 300.
- -s size
- Set the maximal number of bytes to
size. Default is 1024.
If uncat receives a TERM signal, it starts
to process the data in memory and exits as soon as possible.
uncat also
does this on end of input if the -o option was given.
uncat returns
0 after receiving a TERM signal. uncat returns 111 on error.
socklog(8),
socklog-conf(8), sv(8), runsv(8), svlogd(8), tryto(1)
http://smarden.org/socklog/
http://smarden.org/runit/
Gerrit Pape <pape@smarden.org>
Table of Contents
socklog-2.1.1+repack/doc/install.html 0000644 0000000 0000000 00000002773 14702065454 016234 0 ustar root root
socklog - installation
G. Pape
socklog
socklog - installation
Since version 0.3.0, socklog installs into
/package.
Check that you have the recent version of
runit installed.
Download
socklog-2.1.1.tar.gz into
/package
(sha256sum)
and unpack the archive
# cd /package
# gunzip socklog-2.1.1.tar
# tar -xpf socklog-2.1.1.tar
# rm socklog-2.1.1.tar
# cd admin/socklog-2.1.1
On solaris read using socklog on solaris
before proceeding.
Compile and install the socklog programs
# package/install
If you want to make the man pages available in the /usr/local/man/
hierarchy, do:
# package/install-man
To report success:
# mail pape-socklog-2.1.1@xxiv.smarden.org <compile/sysdeps
If you use socklog regularly, please
contribute to the project.
Refer to Configuration for
configuring and setting up socklog services.
Gerrit Pape <pape@smarden.org>
socklog-2.1.1+repack/doc/index.html 0000644 0000000 0000000 00000012342 14702065454 015666 0 ustar root root
socklog - system and kernel logging services
G. Pape
socklog - system and kernel logging services
How to install socklog
Upgrading from previous versions of socklog
How to use dietlibc
Using on solaris
Benefits
Configuration
Examples
Network logging
Log events notification
The socklog-conf program
The socklog program
The tryto program
The uncat program
socklog, in cooperation with the
runit package, is a small and
secure replacement for syslogd.
There are three main features syslogd provides:
-
receiving syslog messages from an unix domain socket
("/dev/log") and writing them to various files on disk
depending on facility and priority.
-
receiving syslog messages from an udp socket
("0.0.0.0:514") and writing them to various files on
disk depending on facility and priority.
-
writing received syslog messages to an udp socket
("a.b.c.d:514")
socklog provides these features with the help of
runit's
runsvdir,
runsv,
and svlogd,
provides a different
network logging concept, and additionally
does log event notification.
svlogd
has a built in
log file rotation based on file size,
so there is no need for any cron jobs or similar to rotate the logs.
Log partitions can be calculated properly.
socklog runs on Linux, glibc 2.1.0 or higher, or dietlibc,
Open-BSD, and Free-BSD.
socklog reportedly runs on Solaris and Net-BSD.
If it runs for you on any other operating systems, please
let me know.
socklog is small, secure, reliable.
socklog is discussed on the
<misc@list.smarden.org>
mailing list. To subscribe send an empty email to
<misc-subscribe@list.smarden.org>. Send an empty email to
<misc-help@list.smarden.org> for more information about this list.
socklog is run under
runit's
runsv,
writing syslog messages it receives from an unix domain
socket path ("/dev/log") or an inet udp socket
ip:port ("0.0.0.0:514") through a pipe
provided by
runsv
to a svlogd
process.
socklog can be run as an
ucspi application to
listen to an unix domain stream socket and for centralized or more
flexible distributed logging (see
network logging).
If socklog listens to an udp socket, it prepends ip:
("a.b.c.d: ") to each syslog message it receives,
where a.b.c.d is the ip address of the connecting system.
If the environment variables $UID and/or $GID are present,
socklog drops permissions to those ids after creating and binding
to the socket (not in
ucspi mode).
socklog converts syslog facility and priority
information to names ("facility.priority") as found in
/usr/include/syslog.h
at compile time if present, you can use this for
svlogd's line
selecting by pattern.
A proper run file for
runsv is:
#!/bin/sh
exec 2>&1
exec chpst -Unobody socklog unix /dev/log
A proper log/run file for
runsv is:
#!/bin/sh
exec chpst -ulog svlogd -t main/*
See INSTALL on how to install socklog
and Configuration for setting up
socklog services.
See http://smarden.org/socklog/
for recent informations.
Gerrit Pape <pape@smarden.org>
socklog-2.1.1+repack/doc/socklog.8.html 0000644 0000000 0000000 00000010364 14702065454 016370 0 ustar root root
socklog(8) manual page
G. Pape
socklog
socklog - small and secure syslogd replacement for use with runit
socklog
[-rRU] [unix] [path]
socklog [-rR] inet [ip] [port]
socklog [-rR] ucspi [args]
socklog is run under runit’s runsv(8),
writing syslog messages it receives from unix domain socket path or an
inet udp socket ip:port through a pipe provided by runsv(8) to a svlogd(8)
process.
socklog can be run as an ucspi application to listen to an unix
domain stream socket and for more flexible distributed logging.
If the environment
variables $UID and/or $GID are present, socklog drops permissions to those
ids after creating and binding the socket (not in ucspi mode).
socklog converts
syslog facility and priority information to names (facility.priority:) as
found in /usr/include/syslog.h at compile time if present.
On solaris socklog
also accepts sun_stream as first argument. Please see the web page for details.
socklog [ unix ] [ path ]
Starting socklog with the 1st argument
unix, socklog will listen to the unix domain socket path. If path is omitted,
the default /dev/log is used.
The 1st argument may be omitted, default is
unix.
socklog inet [ ip ] [ port ]
Starting socklog with the
1st argument inet, socklog will listen to the inet udp socket ip:port.
If
ip starts with 0, socklog will bind to all local interfaces.
If port is
less or equal 1024, socklog must be run by root.
port may be omitted, default
is 514. ip may be omitted, default is 0.
socklog prepends a.b.c.d: to each syslog
message it receives, where a.b.c.d is the ip address of the connecting system.
socklog ucspi [ args ]
Starting socklog with the 1st argument
ucspi, socklog will run as an ucspi application. Normally socklog will only
be started in ucspi mode by an ucspi server tool, such as tcpsvd(8), tcpserver(1)
or unixserver.
For each arg, socklog will prepend $arg: to each syslog message,
if the environment variable $arg is present (maximum is 8).
- -r
- raw.
Write the raw syslog messages (no conversion of facility and priority)
to the pipe, additionally to the log messages with syslog facility and
priority converted to names.
- -R
- raw only. Same as -r above, but write the raw
syslog messages only.
- -U
- respect umask. Don’t set umask to 0 before creating
a unix domain socket, but respect the current setting of umask(2). This
option only takes effect in unix mode.
sv(8), runsvdir(8), runsv(8),
svlogd(8), tryto(1), uncat(1), socklog-check(8), tcpsvd(8), nc(1)
http://smarden.org/socklog/
http://smarden.org/runit/
Gerrit Pape <pape@smarden.org>
Table of Contents
socklog-2.1.1+repack/doc/socklog-check.8.html 0000644 0000000 0000000 00000004313 14702065454 017440 0 ustar root root
socklog-check(8) manual page
G. Pape
socklog
socklog-check - checks for the availability of a socklog(8) service.
socklog-check
[-v] [unix [address]]
socklog-check attempts to connect to a socklog(8)
unix service and reports whether the connection attempt succeeded or not.
It connects to the datagram oriented unix domain socket address, and reports
success through the return code. If address is not specified, socklog-check
attempts to connect to /dev/log.
When running services that use the syslog
facility under runit’s service supervision, socklog-check should be added
to the top of the service’s run script to ensure that no syslog messages
are generated until a syslog service is up and running to process the messages,
e.g.:
#!/bin/sh
socklog-check || exit 1
exec service_using_syslog
- -v
- verbose. Print verbose message to standard error.
On
success socklog-check returns 0.
On error, socklog-check prints a message
to standard error and exits 111.
socklog(8), socklog-conf(8), svlogd(8),
tryto(1), uncat(1), sv(8), runsv(8), runsvdir(8)
http://smarden.org/socklog/
http://smarden.org/runit/
Gerrit Pape <pape@smarden.org>
Table of Contents
socklog-2.1.1+repack/doc/examples.html 0000644 0000000 0000000 00000005746 14702065454 016407 0 ustar root root
socklog - examples
G. Pape
socklog
socklog - examples
listening on unix domain dgram socket /dev/log:
- a sample socklog-unix/run script:
#!/bin/sh
exec 2>&1
exec chpst -Unobody socklog unix /dev/log
- a sample socklog-unix/log/run script:
#!/bin/sh
exec chpst -ulog svlogd \
main/main main/auth main/cron main/daemon main/debug main/ftp \
main/kern main/local main/mail main/news main/syslog main/user
- sample log config files:
# cat main/config
s999999
n10
# cat auth/config
s999999
n5
-*
+auth.*
+authpriv.*
# cat debug/config
s999999
n5
-*
+*.debug*
- if you want additional
tai64n time-stamps
prepended to each message, use this socklog-unix/log/run script
as example:
#!/bin/sh
exec chpst -ulog svlogd -t \
main/main main/auth main/cron main/daemon main/debug main/ftp \
main/kern main/local main/mail main/news main/syslog main/user
listening on udp network socket 0.0.0.0:514:
reading kernel messages from /dev/klog on BSD:
Gerrit Pape <pape@smarden.org>
socklog-2.1.1+repack/doc/network.html 0000644 0000000 0000000 00000013651 14702065454 016254 0 ustar root root
socklog - network logging
G. Pape
socklog
socklog - network logging
Logging through TCP
Logging through UDP
Logging via network connection cannot be made reliable. There is always
a possibility for failures. The network connection itself may be down or
the receiving machine has crashed for example. So there must be a
decision, what to do in such cases.
-
logging is still done locally through
svlogd.
-
the log is transmitted through a network connection (if possible)
when svlogd
decides that current is big enough, using
svlogd's
processor feature.
-
since this transmission cannot be made reliable, there is a tool
tryto that limits the time to try this
transmission. See below for examples.
-
if the transmission of current fails, the log will be saved
locally,
svlogd
remembers the failure in its state and
tryto includes the error messages into
the transmission on the next run, so the remote machine gets the
information of log transmission failures.
There are no restrictions on how to transmit the log data, a separate
process of your choice will do the work, e.g. netcat or
tcpclient.
This modularity lets you easily insert authentication, compression,
encryption and other things.
Example setup
Log Server (machine receiving log data)
Setup a socklog-ucspi-tcp service as described in
Configuration with the following
socklog-ucspi-tcp/run and socklog-ucspi-tcp/log/run
scripts:
socklog-ucspi-tcp/run:
#!/bin/sh
PORT=10116
exec 2>&1
exec tcpsvd -vl0 -unobody 0 "$PORT" socklog ucspi TCPREMOTEIP
socklog-ucspi-tcp/log/run:
#!/bin/sh
exec chpst -ulog svlogd -t main/main main/10.0.0.236
and socklog-ucspi-tcp/log/main/10.0.0.236/config
# cat 10.0.0.236/config
-*
+10.0.0.236:*
You will then find all log data from remote hosts that was successfully
transmitted in main/main/. Log data from 10.0.0.236
will additionally be saved in main/10.0.0.236/.
Log client (machine sending log data)
Change the socklog configuration to use a processor to transmit
the log data:
socklog-unix/log/run:
#!/bin/sh
exec chpst -ulog svlogd ./main/main
socklog-unix/log/main/main/config
s4096
n20
!tryto -pv nc 10.0.0.16 10116
and restart the log service:
# sv restart socklog-unix/log
On each rotation of
svlogd's
current, the data will be transmitted to
10.0.0.16:10116 using tryto
and netcat, failures will be noticed and notified on the next run.
Transmitting log messages through UDP should only be used within private
networks.
Logging through UDP doesn't ensure that the log messages actually reach the
log server, and doesn't provide authentication and authorization.
It's the old-style UNIX syslog remote logging, and supported by
socklog for compatibility reasons.
Example setup
Log Server (machine receiving log data)
Setup a socklog-inet service as described in
Configuration with the following
socklog-inet/run and socklog-inet/log/run scripts, and
the following socklog-inet/log/main/config log configuration:
socklog-inet/run:
#!/bin/sh
exec 2>&1
exec chpst -Unobody socklog inet 0 514
socklog-inet/log/run:
#!/bin/sh
exec chpst -ulog svlogd -t main/main main/10.0.0.236
and socklog-inet/log/main/10.0.0.236/config:
# cat 10.0.0.236/config
-*
+10.0.0.236:*
You will then find all log messages from remote hosts that were successfully
transmitted in main/main/.
Log messages from 10.0.0.236 will additionally be saved in
main/10.0.0.236/.
Log client (machine sending log data)
Tell socklog to write raw syslog messages without converting syslog
priority and facility to names by adding the -R option:
socklog-unix/run:
#!/bin/sh
exec 2>&1
exec chpst -Unobody socklog -R unix /dev/log
Then change the configuration of socklog's main log directory to tell
svlogd to transmit
log messages through UDP:
/var/log/socklog/main/config:
s9999
n2
U10.0.0.16:514
Restart the service, and tell the log service to reload its configuration:
# sv restart socklog-unix
# sv hup socklog-unix/log
Now each log message will be sent through UDP to 10.0.0.16:514, and
not written to the log directory.
If svlogd has trouble
transmitting data through UDP, and is able to detect an error, it logs an
error message followed by the log message to the log directory.
Of course you can configure socklog to log through UDP while keeping
local logging enabled, and also select log messages to be transmitted through
UDP by pattern.
See the documentation of
svlogd for details.
Gerrit Pape <pape@smarden.org>
socklog-2.1.1+repack/doc/tryto.1.html 0000644 0000000 0000000 00000010246 14702065454 016100 0 ustar root root
tryto(1) manual page
G. Pape
socklog
tryto - tries to run a command limited by a timeout or number of tries,
can be used to run as svlogd(8) processor.
tryto [-pPv] [-t sec] [-k
ksec] [-n tries] prog
prog consist of one or more arguments.
tryto
runs and watches prog, feeding its standard input to prog’s standard input.
If prog exits with a return code other then 0, tryto runs prog again after
sleeping one second.
If the number of retries reaches the maximal number
of tries, tryto prints an error message and gives up.
If the timeout sec
seconds is reached and prog is still running, tryto sends a TERM signal
to prog, waits ksec seconds for prog to terminate, then sends a KILL signal
if prog still is there, and exits as soon as possible.
- -t sec
- timeout.
Set the timeout to send TERM to prog to sec seconds. Default is 180.
- -k ksec
- kill timeout. Set the timeout to send KILL to prog to ksec seconds. Default
is 5.
- -n tries
- Set the maximal number of tries to tries. If prog exited with
a return code other that 0, tryto tries to rewind standard input to the
beginning using lseek(2) before starting prog again. Default is 5.
- -p
- processor.
Use this option if you run tryto as a svlogd(8) processor (see below).
- -P
- process group. Run prog in a new session and process group, and send signals
on timeout to prog’s process group instead of its pid.
- -v
- verbose. Print verbose
messages to standard error.
If tryto sees the -p option, tryto runs
as a svlogd(8) or multilog(8) processor, making use of filedescriptors
4 and 5:
Before starting prog, tryto moves the filedescriptor 5 to 2, so
all error messages from tryto and prog will be saved in svlogd(8)’s state
to be processed on the next run of tryto -p.
After starting prog, tryto
first feeds all data it reads from filedescriptor 4 into prog’s standard
input, then all data from filedescriptor 0.
If prog fails by timeout sec
seconds or maximal number of tries, tryto prints all data from standard
input to standard output, an error message to standard error, and exits
with 0.
If tryto itself fails, it returns 111.
If tryto runs as
a svlogd(8) processor, tryto returns 0 in all other cases.
If prog was run
successfully, tryto returns 0.
If prog failed by timeout, tryto returns
100.
If prog failed by maximal number of tries, tryto returns the last return
code from prog.
socklog(8), uncat(1), svlogd(8), multilog(8), lseek(2)
http://smarden.org/socklog/
http://smarden.org/runit/
Gerrit Pape <pape@smarden.org>
Table of Contents
socklog-2.1.1+repack/doc/configuration.html 0000644 0000000 0000000 00000021435 14702065454 017431 0 ustar root root
socklog - configuration
G. Pape
socklog
socklog - configuration
The socklog-unix service listens on the unix domain socket
/dev/log. Usually this service replaces the syslogd
system log daemon.
The socklog-inet service listens on the UDP port
0.0.0.0:514. Usually this service replaces syslogd's
support for remote logging.
The socklog-klog service reads kernel messages from
/proc/kmsg on Linux or /dev/klog on BSD. Usually this
service replaces klogd on Linux or syslogd on BSD.
The socklog-ucspi-tcp service listens on the TCP port
0.0.0.0:10116, this is a server for
socklog network logging, a different remote
logging concept.
The socklog-notify handles
log event notification, scheduled notification
of specified log entries.
How to configure the socklog services
The socklog-unix service
The socklog-inet service
The socklog-klog service
The socklog-ucspi-tcp service
The socklog-notify service
Removing socklog services
Before starting the socklog-unix service, you will have to make two
decisions:
- The socklog-unix account name, normally nobody. The
socklog program runs under this account. If this account does not
exist, create it now.
- The socklog account name, normally log. Logging
programs run under this account. If this account does not exist, create
it now.
Create the service directory and log directories by running the
socklog-conf program:
# socklog-conf unix nobody log
If you are replacing another service providing system logging through the
socket /dev/log, such as syslogd, stop this service now and
ensure that it will not be restarted on runlevel change or system reboot.
Tell runsvdir about
the new service:
# ln -s /etc/sv/socklog-unix /var/service/
Wait five seconds for the service to start and then check the log
directories, e.g.:
# less /var/log/socklog/main/current
Optionally configure the socklog-unix service by
editing
the corresponding run scripts and config files:
- /var/service/socklog-unix/run
- /var/service/socklog-unix/log/run
- /var/log/socklog/*/config
Before starting the socklog-inet service, you will have to make two
decisions:
- The socklog-inet account name, normally nobody. The
socklog program runs under this account. If this account does not
exist, create it now.
- The socklog account name, normally log. Logging
programs run under this account. If this account does not exist, create
it now.
Create the service directory and log directories by running the
socklog-conf program:
# socklog-conf inet nobody log
If you are replacing another service providing system logging through the
syslog UDP port 514, such as syslogd, stop this service now and ensure
that it will not be restarted on runlevel change or system reboot.
Tell runsvdir about
the new service:
# ln -s /etc/sv/socklog-inet /var/service/
Wait five seconds for the service to start and then check the log
directory:
# less /var/log/socklog-inet/main/current
Optionally configure the socklog-inet service by
editing
the corresponding run scripts and config file:
- /var/service/socklog-inet/run
- /var/service/socklog-inet/log/run
- /var/log/socklog-inet/main/config
Before starting the socklog-klog service, you will have to make two
decisions:
- The socklog-klog account name, normally nobody. The
socklog program runs under this account. If this account does not
exist, create it now.
- The socklog account name, normally log. Logging
programs run under this account. If this account does not exist, create
it now.
Create the service directory and log directories by running the
socklog-conf program:
# socklog-conf klog nobody log
If you are replacing another service providing kernel logging, such as
klogd on Linux or syslogd on BSD, stop this service now and
ensure that it will not be restarted on runlevel change or system reboot.
Tell runsvdir about
the new service:
# ln -s /etc/sv/socklog-klog /var/service/
Wait five seconds for the service to start and then check the log
directory:
# less /var/log/socklog-klog/main/current
Optionally configure the socklog-klog service by
editing
the corresponding run scripts and config file:
- /var/service/socklog-klog/run
- /var/service/socklog-klog/log/run
- /var/log/socklog-klog/config
Before starting the socklog-ucspi-tcp service, you will have
to make two decisions:
- The socklog-ucspi-tcp account name, normally nobody.
The socklog program runs under this account. If this account
does not exist, create it now.
- The socklog account name, normally log. Logging
programs run under this account. If this account does not exist, create
it now.
Make sure that you have the ipsvd
package installed.
Then create the service directory and log directories by running the
socklog-conf program:
# socklog-conf ucspi-tcp nobody log
Tell runsvdir about
the new service:
# ln -s /etc/sv/socklog-ucspi-tcp /var/service/
Wait five seconds for the service to start and then check the log
directory:
# less /var/log/socklog-ucspi-tcp/main/current
Optionally configure the socklog-ucspi-tcp service by
editing
the corresponding run scripts and config file:
- /var/service/socklog-ucspi-tcp/run
- /var/service/socklog-ucspi-tcp/log/run
- /var/log/socklog-ucspi-tcp/main/config
Refer to Network logging for setting up clients.
Before starting the socklog-notify service, you will have to
make two decisions:
- The socklog account name, normally log. The
uncat program runs under this account. If this account does not
exist, create it now.
- The socklog group name, normally adm. Logging
programs that report log events to the
socklog-notify service must run under an account that is member
of this group. If this group does not exist, create it now.
Create the service directory by running the
socklog-conf program:
# socklog-conf notify log adm
Tell runsvdir about
the new service:
# ln -s /etc/sv/socklog-notify /var/service/
Wait five seconds for the service to start, you can test the service with:
# echo test | tai64n > /var/log/socklog/.notify
Optionally configure the socklog-notify service by
editing
the corresponding run script:
- /var/service/socklog-notify/run
Read Log events notification before disabling this
service and for configuring arbitrary log services to notify events.
Gerrit Pape <pape@smarden.org>
socklog-2.1.1+repack/doc/socklog-conf.8.html 0000644 0000000 0000000 00000013755 14702065454 017322 0 ustar root root
socklog-conf(8) manual page
G. Pape
socklog
socklog-conf - sets up a socklog(8) service.
socklog-conf unix|inet|klog|ucspi-tcp
acct logacct
socklog-conf notify acct grp
socklog-conf creates /etc/sv if necessary
and a subdirectory that runs the unix, inet, ucspi-tcp or notify service
(see below for each service). Except for the notify service, socklog-conf
also creates a log directory with subdirectories.
acct, logacct and grp
must not contain any special characters.
socklog-conf unix acct
logacct
Running socklog-conf with the 1st argument unix, socklog-conf creates
the service directory /etc/sv/socklog-unix and the log directory /var/log/socklog.
socklog-conf arranges for socklog(8) to run under the uid and gid of acct
and to listen for syslog messages on /dev/log.
It also creates automatically
rotated log directories in /var/log/socklog. The logs are owned by logacct.
The corresponding svlogd(8) process runs under the uid and gid of logacct.
You can run the service under runsvdir(8) by creating a symbolic link in
the service directory:
ln -s /etc/sv/socklog-unix /var/service/
socklog-conf
inet acct logacct
Running socklog-conf with the 1st argument inet, socklog-conf
creates the service directory /etc/sv/socklog-inet and the log directory
/var/log/socklog-inet.
socklog-conf arranges for socklog(8) to run under the
uid and gid of acct and to listen for syslog messages on the UDP socket
0.0.0.0:514.
It also creates automatically rotated log directories in /var/log/socklog-inet.
The logs are owned by logacct. The corresponding svlogd(8) process runs
under the uid and gid of logacct.
You can run the service under runsvdir(8)
by creating a symbolic link in the service directory:
ln -s /etc/sv/socklog-inet
/var/service/
socklog-conf klog acct logacct
Running socklog-conf
with the 1st argument klog, socklog-conf creates the service directory /etc/sv/socklog-klog
and the log directory /var/log/socklog-klog.
socklog-conf arranges for socklog(8)
to run under the uid and gid of acct and to read kernel messages from /proc/kmsg
on Linux, or /dev/socklog-klog on BSD.
It also creates automatically rotated
log directories in /var/log/socklog-klog. The logs are owned by logacct. The
corresponding svlogd(8) process runs under the uid and gid of logacct.
You
can run the service under runsvdir(8) by creating a symbolic link in the
service directory:
ln -s /etc/sv/socklog-klog /var/service/
socklog-conf
ucspi-tcp acct logacct
Running socklog-conf with the 1st argument ucspi-tcp,
socklog-conf creates the service directory /etc/sv/socklog-ucspi-tcp and the
log directory /var/log/socklog-ucspi-tcp.
socklog-conf arranges for tcpsvd(1)
to run socklog(8) under the uid and gid of acct and to listen on the TCP
socket 0.0.0.0:10116.
It also creates automatically rotated log directories
in /var/log/socklog-ucspi-tcp. The logs are owned by logacct. The corresponding
svlogd(8) process runs under the uid and gid of logacct.
You can run the
service under runsvdir(8) by creating a symbolic link in the service directory:
ln -s /etc/sv/socklog-ucspi-tcp /var/service/
socklog-conf notify
acct grp
Running socklog-conf with the 1st argument notify, socklog-conf
creates the service directory /etc/sv/socklog-notify.
socklog-conf arranges
for uncat(1) to run under the uid and gid of acct and to listen on the
named pipe /var/log/socklog/.notify. The named pipe will have mode 0620,
the uid of acct and the gid of grp.
All uids running a log service that
is configured to push log events to the socklog-notify service must be member
of the group grp.
You can run the service under runsvdir(8) by creating
a symbolic link in the service directory:
ln -s /etc/sv/socklog-notify /var/service/
socklog(8), svlogd(8), nc(1), tryto(1), uncat(1), socklog-check(8),
tcpsvd(8), sv(8), runsv(8), runsvdir(8)
http://smarden.org/socklog/
http://smarden.org/runit/
Gerrit Pape <pape@smarden.org>
Table of Contents
socklog-2.1.1+repack/doc/readme.solaris.html 0000644 0000000 0000000 00000011725 14702065454 017473 0 ustar root root
socklog - on Solaris
G. Pape
socklog
socklog - on Solaris
Logging on Solaris
Solaris uses a STREAMS file, usually /dev/log to route locally
generated syslog messages. See the log(7d) driver manual page for
more information.
Starting with SunOS 5.6 (Solaris 2.5.1) the syslog(3) library
contains support for "doors", a superfast and multithreaded IPC
mechanism provided by the Solaris Operating Environment. Using a door file -
/etc/.syslog_door up to SunOS 5.7, /var/run/syslog_door on
SunOS 5.8 and later, the process listening on the syslog_door gets immediate
notification upon receipt of a log message.
Format of Solaris syslog messages
Starting with Solaris 8, Sun introduced a new log message format
containing so called message IDs (See syslogd(1) and msgid(1)).
[ID msgid facility.priority]
Jul 9 10:13:06 u5 pseudo: [ID 129642 kern.info] pseudo-device: tod0
Jul 9 16:14:51 u5 login: [ID 644210 auth.notice] ROOT LOGIN /dev/console
All Solaris versions up to Solaris 7 use the well known, good old syslog
messages:
Jul 10 16:24:21 u5 login: ROOT LOGIN /dev/console
Jul 10 16:35:19 u5 unix: se0 is /pci@1f,0/pci@1,1/ebus@1/se@14,400000
The format is configurable. The log(7d) driver configuration file is
/kernel/drv/log.conf. Set the variable "msgid" to either 1
or 0, to en- or disable message ID generation. Note: you must reboot to
activate the changes.
socklog does prepend the formated 'facility.priority: ' to
every log message, whether message IDs are used or not.
This makes it easier to write svlogd or multilog filters.
So this is how a log message processed by socklog will look like:
without message IDs:
auth.info: Jul 15 21:40:52 sshd[1576]: Accepted publickey for root from 195.71.100.159 port 36621 ssh2
with message IDs enabled (default on Solaris 8 and later):
auth.info: Jul 11 14:10:53 sshd[382]: [ID 800047 auth.info] Accepted rsa for ROOT from 195.71.100.159 port 36177
I prefer the first method, because it's much less visual clutter, and I don't
need message IDs anyway.
Kernel messages
Solaris has no such thing as /proc/kmsg, or /dev/klog.
Kernel log messages are provided by the same STREAMS device
(/dev/log) as normal log messages. All kernel messages are logged
with a facility of "kern":
kern.info: unix: avail mem = 250077184
kern.info: unix: root nexus = Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 360MHz)
kern.info: unix: pcipsy0 at root: UPA 0x1f 0x0
The kernel messages do not contain timestamps. It seems that syslog does
automatically prepend timestamps to kernel messages, so I might implement
this in socklog as well.
dmesg will not work any longer, since it is just a sh shell script
which prints out the last 200 lines from /var/adm/messages. If you
need dmesg, you can easily write your own version :-).
Note that if message IDs are enabled, kernel log messages contain the name of
the loadable module or driver instead of just "unix:".
kern.info: m64: [ID 308573 kern.info] m64#0: 1280x1024, 4M mappable, rev 4750.7c
kern.info: hme: [ID 517527 kern.info] SUNW,hme0 : PCI IO 2.0 (Rev Id = c1) Found
Be sure to enable message IDs to get these.
How to compile socklog on Solaris
You'll have to decide if you want "door" support or not.
1. With syslog_door support
echo "gcc -O2 -Wall -DWANT_SUN_DOOR" > src/conf-cc
echo "gcc -s -ldoor -lthread" > src/conf-ld
2. Without syslog_door support (default)
Just run package/install.
Then follow the standard installation instructions.
How to configure socklog for the STREAMS log driver
$ socklog-conf unix acct logacct [/rundir] [/logdir]
This will create the following run script:
#!/bin/sh
exec 2>&1
exec chpst -Uacct socklog sun_stream /dev/log /var/run/syslog_door
It is possible to run multiple socklog instances, but only one
socklog can listen on the door file. If another process is in charge
of the door file, socklog will exit immediately with exit code 100.
Simply remove the last argument (path to door file), to start socklog
without door support. This way you can run syslogd and socklog
parallel, to test your socklog setup.
Support
If you have problems, questions or suggestions regarding the Solaris support,
email me:
Lars Uffmann <lu@cachescrubber.org>,
or post to the <misc@list.smarden.org> mailing list.
Lars Uffmann, <lu@cachescrubber.org>
socklog-2.1.1+repack/doc/usedietlibc.html 0000644 0000000 0000000 00000001652 14702065454 017055 0 ustar root root
socklog - use dietlibc
G. Pape
socklog
socklog - use dietlibc
To recompile the socklog programs with the
diet libc, check that you have
the recent version of
dietlibc installed.
Change to the package directory of socklog:
# cd /package/admin/socklog/
Change the conf-cc and conf-ld to use diet:
# echo 'diet -Os gcc -O2 -Wall' >src/conf-cc
# echo 'diet -Os gcc -s -Os -pipe' >src/conf-ld
Rebuild and install the socklog programs:
# package/install
Gerrit Pape <pape@smarden.org>
socklog-2.1.1+repack/package/ 0000755 0000000 0000000 00000000000 14702065454 014515 5 ustar root root socklog-2.1.1+repack/package/versions 0000644 0000000 0000000 00000000244 14702065454 016310 0 ustar root root 0.4.0
0.4.1
0.5.1
0.6.0
0.6.1
0.7.0
0.8.1
0.8.2
0.9.0
0.9.1
0.10.0
0.10.1
1.0.0
1.1.0
1.1.1
1.2.0
1.3.0
1.3.1
1.4.1
1.4.2
1.5.0
2.0.0
2.0.1
2.0.2
2.0.3
2.1.0
2.1.1
socklog-2.1.1+repack/package/upgrade 0000755 0000000 0000000 00000001402 14702065454 016067 0 ustar root root #!/bin/sh -e
umask 022
test -d package || sh -cx '! : Wrong working directory.'
test -d src || sh -cx '! : Wrong working directory.'
here=`env - PATH=$PATH pwd`
parent=`dirname $here`
echo 'Creating symlink socklog -> socklog-2.1.1...'
rm -f socklog
ln -s socklog-2.1.1 socklog
mv -f socklog ..
echo 'Making command links in /command...'
mkdir -p /command
for i in `cat package/commands`; do
rm -f /command/$i'{new}'
ln -s $parent/socklog/command/$i /command/$i'{new}'
mv -f /command/$i'{new}' /command/$i
done
echo 'Making compatibility links in /usr/local/bin...'
mkdir -p /usr/local/bin
for i in `cat package/commands`; do
rm -f /usr/local/bin/$i'{new}'
ln -s /command/$i /usr/local/bin/$i'{new}'
mv -f /usr/local/bin/$i'{new}' /usr/local/bin/$i
done
socklog-2.1.1+repack/package/CHANGES 0000644 0000000 0000000 00000026324 14702065454 015517 0 ustar root root socklog 2.1.1
Fri, 11 Oct 2024 00:00:17 +0000
* doc/install.html: add link to sha256sum.asc.
* doc/install.html: change mail address.
* doc/index.html: remove reference to socklog 2.0.x.
* doc/*.html: remove $Id$.
* debian/: remove; obsolete.
* pathexec.h, pathexec_env.c, pathexec_run.c, seek_set.c, sgetopt.c,
sgetopt.h, socklog-check.c, socklog-conf.c, socklog.c, subgetopt.c,
subgetopt.h, trycpp.c, tryflock.c, trypoll.c, trysgact.c, trysgprm.c,
tryto.c, tryulong64.c, trywaitp.c, uncat.c, x86cpuid.c: incorporate
lib changes from runit-2.2.0 and adapt socklog programs to properly
build with modern toolchains (thx Gentoo, Debian, Void Linux).
* prot.c, prot.h, chkshsgr.c, tryshsgr.c, hasshsgr.h?, warn-shsgr:
remove; obsolete.
* Makefile, TARGETS: no longer check for "shortsetgroups" (thx Leah
Neukirchen).
* socklog.c: replace prot_gid() with setgroups() and prot_uid() with
setuid().
socklog 2.1.0
Mon, 06 Mar 2006 12:59:33 +0000
* socklog-conf, man/socklog-conf.8: create service directories
/etc/sv/socklog-* instead of /etc/socklog/*; create ./check script
for socklog-unix service.
* doc/configuration.html, doc/install.html, doc/network.html,
doc/notify.html: adapt to new path to service directories; utilize
runit's sv program instead of runsvctrl.
* man/socklog-check.8, man/socklog-conf.8, man/socklog.8, man/uncat.1:
see also sv(8).
socklog 2.0.3
Sun, 26 Feb 2006 13:29:17 +0000
* doc/index.html: minor.
* socklog-check.c: change EDESTADDRREQ to ECONNREFUSED if defined and set
by connect().
* tryto: fix a race with child terminating immediatly (thx Alex Efros);
catch SIGCHLD while waiting ktimeout seconds before sending KILL.
* man/tryto.1: remove reference to timelimit(8) (thx Alex Efros).
* socklog.check, socklog.dist: don't check usage output with -V as it
differs on solaris (thx Asif Iqbal).
socklog 2.0.2
Sun, 10 Apr 2005 07:21:30 +0000
* doc/readme.solaris.html: add -ldoor -lthread to src/conf-ld (thx Lars
Kellogg-Stedman); update log/run script, mailing list address.
* man/socklog.8: remove double entries in SEE ALSO.
socklog 2.0.1
Thu, 10 Feb 2005 10:05:55 +0000
* Makefile: add linker options detected by trysocketlib.c to targets
check-socklog-inet, check-socklog-inet (fixes test failure on solaris,
thx Uffe Jakobsen).
socklog 2.0.0
Sun, 06 Feb 2005 19:57:04 +0000
* socklog-check.check: tweak timing in program test.
* tryto.c: new option -P: run prog in new session, and signal process
group.
* man/tryto.1: adapt; cleanup.
* man/socklog-check.8: add hint about runit services using syslog
facility; cleanup.
* man/socklog-conf.8, man/socklog.8, man/uncat.1: cleanup.
* doc/index.html: new stable release.
* doc/network.html: typo.
socklog 1.5.0
Sat, 26 Jun 2004 11:28:33 +0000
* socklog-check, man/socklog-check.8: new; check for the availability of
a socklog service.
* socklog-check.check, socklog-check.dist: new; program test.
* byte_zero.c: new.
* socklog.c, man/socklog.8: new option -U: don't override umask when
creating domain socket.
* package/check, package/compile, package/install-man, package/upgrade:
minor cleanup.
* Makefile, man/socklog-conf.8: adapt.
socklog 1.4.2
Tue, 23 Mar 2004 18:16:17 +0000
* doc/index.html, doc/install.html: minor.
* socklog.c: fix sigterm handling in ucspi mode.
* uncat.check: tweak timing in program test.
* Makefile: don't run target check by default.
* package/check: new; run checks on programs.
* package/install: run package/check.
socklog 1.4.1
Sat, 28 Feb 2004 17:47:13 +0000
* socklog.c: handle sigterm on other platforms as accurately as already
done on solaris.
* tryto.c, uncat.c: minor cleanup.
* check-diff, check-dist, check-local: new; run checks on programs.
* socklog-conf.check, socklog.check, tryto.check, uncat.check,
check-socklog-inet.c, check-socklog-unix.c: new; check program.
* socklog-conf.dist, socklog.dist, tryto.dist, uncat.dist: new; dist check
program output.
* package/COPYING: 2004.
* package/compile, package/install-man, package/upgrade: minor.
socklog 1.3.1
Mon, 19 Jan 2004 18:39:01 +0000
* trysocketlib.c: new; check for libraries needed for socket() on some
systems (solaris, thx Uffe Jakobsen).
* Makefile: adapt.
* socklog.c, socklog-conf.c: add defines automatically detecting solaris
systems; now builds on solaris out-of-the-box (thx Uffe Jakobsen, Lars
Uffmann).
* doc/readme.solaris.html: adapt (thx Lars Uffmann).
* print-cc.sh, print-ld.sh: head -1 -> head -n1.
socklog 1.3.0
Mon, 12 Jan 2004 19:06:56 +0000
* socklog.c: add getopt-style command line options -r, -R for logging raw
syslog messages without priority, facility conversion.
* man/socklog.8: adapt.
* doc/network.html: document old-style syslog network logging through UDP.
* doc/index.html: change short description.
* package/compile, package/install-man, package/upgrade: exit 1 on
sub-shell failures.
socklog 1.2.0
Sat, 09 Aug 2003 18:08:20 +0200
* socklog-conf.c: fix run file for socklog-unix service on solaris; use
runit's chpst instead of setuidgid.
* doc/install.html: remove obsolete note about setuidgid replacement.
* doc/examples.html: adapt.
* doc/index.html: adapt examples.
* doc/benefits.html: minor.
socklog 1.1.1
Mon, 07 Jul 2003 09:59:08 +0200
* socklog-conf.c: fix typos (thx Hleil Liu); use mail -s instead of
mailsubj for the notify service.
socklog 1.1.0
Thu, 19 Jun 2003 15:40:52 +0200
* man/socklog-conf.8, man/socklog.8, man/tryto.1: typos.
* doc/benefits.html, doc/configuration.html, doc/examples.html,
doc/index.html, doc/network.html, doc/notify.html,
doc/readme.solaris.html, man/socklog-conf.8, man/socklog.8, man/tryto.1,
man/uncat.1: utilize runit package instead of daemontools package.
* socklog-conf.c: create service directories for the use with the runit
package.
socklog 1.0.0
Thu, 30 Jan 2003 13:32:24 +0100
* doc/configuration.html, doc/examples.html: remove description for
socklog-ucspi-unix service.
* doc/benefits.html, doc/network.html, doc/readme.solaris.html,
doc/usedietlibc.html, man/socklog-conf.8: typos.
* error.h: include .
* tryto.c: catch possible error in write() to child; minor cleanup.
* doc/index.html: add NetBSD to supported systems.
socklog 0.10.1
Thu, 08 Aug 2002 22:55:35 +0200
* package/versions: new.
* doc/network.html: typos.
* doc/usedietlibc.html: fix path to conf-cc, conf-ld.
socklog 0.10.0
Thu, 18 Jul 2002 15:45:58 +0200
* solaris support rewrite (thx Lars Uffmann):
* socklog.c: new option sun_stream; new optional option door; rewrite
solaris related code.
* socklog-conf.c: option unix: create special run script on solaris.
* doc/readme.solaris.html: new.
* (thx Lars Uffmann).
* documentation adapted.
socklog 0.9.1
Wed, 26 Jun 2002 15:54:06 +0200
* Makefile: enable target sysdeps.
socklog 0.9.0
Fri, 31 May 2002 14:07:11 +0200
* new service socklog-klog doing kernel logging.
* socklog.c: fix facility and priority decoding in ucspi mode.
* socklog-conf.c: creates socklog-klog's service directories.
* doc/configuration.html, doc/examples.html, man/socklog-conf.8: document
socklog-klog service.
socklog 0.8.2
Sat, 18 May 2002 15:08:09 +0200
* src/: include public domain sources to build byte.a, unix.a, time.a:
socklog builds without having daemontools' sources installed.
* doc/usedietlibc.html: how to use dietlibc.
socklog 0.8.1
Sun, 28 Apr 2002 10:32:28 +0200
* tryto.c: change return value on child timeout to 100, add FATAL prefix
to error message on child timeout/crash.
socklog 0.8.0
Tue, 16 Apr 2002 14:11:34 +0200
* doc/network.html: fix quoting bug, network client sample was not
working properly.
* doc/benefits.html: add more descriptions of benefits.
* no code changes at all.
socklog 0.7.0
Mon, 4 Feb 2002 11:37:13 +0100
* install-man: symlinks now point into the correct directory:
/package/admin/socklog/man/ (thx Mike Forster).
* socklog.c: complete revision: dropped fdbuffer.o, switched to unix.a,
byte.a support libraries (now in the Public domain).
* socklog-conf.c: support log dir with cross device link; optional logdir
option must start with /.
* Makefile: sysdeps.
* doc: revised.
* (thx Gary Gendel, support for solaris)
socklog 0.6.1
Thu, 17 Jan 2002 11:43:36 +0100
* bug: socklog.c: error in recvfrom() was not catched (thx Liviu Daia)
socklog 0.6.0
Sat, 12 Jan 2002 14:18:57 +0100
* uncat: redirect prog's stdout to stderr; never writes to stdout
* socklog-conf notify: redirects uncat's stdout to the pipe:
'exec <> $PIPE', fixes wrong timeout handling seen in some
configurations.
* new: package/install-man for installing manpage links
* doc: adapted
* socklog.c,socklog-conf.c,uncat.c: code cleanup
* doc: install.html: typos
socklog 0.5.4
Sun, 30 Dec 2001 19:18:29 +0100
* uncat: new option -o: once, exit on eof
* uncat: manpage adapted
* doc: minor changes
* socklog: trim 0-characters
* Makefile: use ./support/compile, ./support/load
socklog 0.5.1
Tue, 20 Nov 2001 11:36:23 +0100
* package socklog moved to smarden.org
socklog 0.5.0
Fri, 16 Nov 2001 15:53:07 +0100
* minor beautification
* deb: reorganized debian/rules
socklog 0.4.6
Sun, 11 Nov 2001 15:08:22 +0100
* socklog: changed undocumented option -v to -V
* Makefile: does not require gnu make (thx Jordan Krushen)
* socklog-conf added
* run socklog with softlimit
* socklog-group mandatory, notify pipe mode 0620
* doc: upgrade.html, socklog-conf.8.html, socklog-conf.8 added
* doc: adapted
socklog 0.4.1
Fri, 12 Oct 2001 11:04:29 +0200
* uncat: continue; on error_again, fixes wrong timeouts
* uncat: more verbose on -v
* deb: moved to unofficial, fhs failures
* socklog-notify: use mailsubj
* doc: improved configuration.html
* doc: how to disable log event notifications
socklog 0.4.0
Fri, 21 Sep 2001 17:43:09 +0200
* changed to new primary email address
* BSD license
* doc: minor changes
socklog 0.3.6
Mon, 17 Sep 2001 18:26:12 +0200
* doc: updated
socklog 0.3.5
Sun, 16 Sep 2001 20:12:01 +0200
* new: tryto, uncat
* new: network logging concept
* new: log event notification
* deb: cleaner binary package (rm -rf (socklog/{compile,etc,doc,man})
socklog 0.3.0
Tue, 14 Aug 2001 12:26:02 +0200
* installs into /package (see http://cr.yp.to/slashpackage.html)
* no code changes
socklog 0.2.2
Fri, 22 Jun 2001 11:59:10 +0200
* LDFLAGS for solaris in Makefile
* doc: benefits.html added, describing logfile rotation based on file size
socklog 0.2.1
Tue, 19 Jun 2001 11:48:28 +0200
* support for solaris (thx Gary Gendel)
* deb: provides: system-log-daemon (thx ska)
socklog 0.2.0
Mon, 11 Jun 2001 13:31:42 +0200
* ucspi mode added.
* use setgroups() before setgid() (thx ari)
* buffering output (thx ari)
* doc: Examples added (thx Eduardo Augusto Alvarenga, Paul Jarc)
* compiles on openbsd 2.9 (thx clemensF)
socklog 0.1.2
Fri, 1 Jun 2001 10:50:36 +0200
* doc: improved
socklog 0.1.1
Tue, 29 May 2001 13:26:24 +0200
* deb: provides log directories for default log/run files
* deb: add user 'log' in postinst
* doc: improved
socklog 0.1.0
Mon, 28 May 2001 11:39:36 +0200
* initial release
socklog-2.1.1+repack/package/sharing 0000644 0000000 0000000 00000000043 14702065454 016070 0 ustar root root command:syst
package:dist
src:dist
socklog-2.1.1+repack/package/compile 0000755 0000000 0000000 00000001233 14702065454 016072 0 ustar root root #!/bin/sh -e
umask 022
test -d package || sh -cx '! : Wrong working directory.'
test -d src || sh -cx '! : Wrong working directory.'
here=`env - PATH=$PATH pwd`
mkdir -p compile command
test -r compile/home || echo $here >compile/home
test -h compile/src || ln -s $here/src compile/src
echo 'Linking ./src/* into ./compile...'
for i in `ls src`; do
test -h compile/$i || ln -s src/$i compile/$i
done
echo 'Compiling everything in ./compile...'
sh -cxe 'cd compile; exec make'
echo 'Copying commands into ./command...'
for i in `cat package/commands`; do
rm -f command/$i'{new}'
cp -p compile/$i command/$i'{new}'
mv -f command/$i'{new}' command/$i
done
socklog-2.1.1+repack/package/install 0000755 0000000 0000000 00000000074 14702065454 016112 0 ustar root root #!/bin/sh -e
package/compile
package/check
package/upgrade
socklog-2.1.1+repack/package/README 0000644 0000000 0000000 00000000070 14702065454 015372 0 ustar root root Copyright 2001-2005
G. Pape
http://smarden.org/socklog/
socklog-2.1.1+repack/package/check 0000755 0000000 0000000 00000000332 14702065454 015516 0 ustar root root #!/bin/sh -e
umask 022
test -d package || sh -cx '! : Wrong working directory.'
test -d compile || sh -cx '! : Wrong working directory.'
echo 'Checking commands in ./command...'
sh -cxe 'cd compile; exec make check'
socklog-2.1.1+repack/package/COPYING 0000644 0000000 0000000 00000002612 14702065454 015551 0 ustar root root Copyright (c) 2001-2005, Gerrit Pape
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. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
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.
socklog-2.1.1+repack/package/commands 0000644 0000000 0000000 00000000057 14702065454 016243 0 ustar root root socklog
socklog-check
socklog-conf
tryto
uncat
socklog-2.1.1+repack/package/install-man 0000755 0000000 0000000 00000001127 14702065454 016663 0 ustar root root #!/bin/sh -e
umask 022
test -d package || sh -cx '! : Wrong working directory.'
test -d man || sh -cx '! : Wrong working directory.'
here=`env - PATH=$PATH pwd`
parent=`dirname $here`
echo 'Compressing manpages...'
for i in man/*.[1-8]; do
gzip -c $i >${i}.gz
done
echo 'Making manpage links in /usr/local/man...'
cd man
for i in 1 8; do
mkdir -p /usr/local/man/man$i
for j in *.$i; do
rm -f /usr/local/man/man$i/$j.gz'{new}'
ln -s $parent/socklog/man/$j.gz /usr/local/man/man$i/$j.gz'{new}'
mv -f /usr/local/man/man$i/$j.gz'{new}' /usr/local/man/man$i/$j.gz
done
done
cd ..
socklog-2.1.1+repack/src/ 0000755 0000000 0000000 00000000000 14702065454 013711 5 ustar root root socklog-2.1.1+repack/src/taia_less.c 0000644 0000000 0000000 00000000467 14702065454 016030 0 ustar root root /* Public domain. */
#include "taia.h"
/* XXX: breaks tai encapsulation */
int taia_less(const struct taia *t,const struct taia *u)
{
if (t->sec.x < u->sec.x) return 1;
if (t->sec.x > u->sec.x) return 0;
if (t->nano < u->nano) return 1;
if (t->nano > u->nano) return 0;
return t->atto < u->atto;
}
socklog-2.1.1+repack/src/uncat.dist 0000644 0000000 0000000 00000001517 14702065454 015714 0 ustar root root usage: uncat [-vo] [-t timeout] [-s size] prog
1
$Id$
usage: uncat [-vo] [-t timeout] [-s size] prog
1
uncat: warning: starting.
uncat: warning: end of input.
uncat: warning: starting child.
foo
bar
uncat: warning: child exited.
uncat: warning: exit.
0
uncat: warning: starting.
uncat: warning: timeout reached.
uncat: warning: starting child.
foo
uncat: warning: child exited.
uncat: warning: end of input.
uncat: warning: starting child.
bar
uncat: warning: child exited.
uncat: warning: exit.
0
uncat: warning: starting.
uncat: warning: max size reached.
uncat: warning: starting child.
foo
uncat: warning: child exited.
uncat: warning: max size reached.
uncat: warning: starting child.
bar
uncat: warning: child exited.
uncat: warning: end of input.
uncat: warning: starting child.
baz
uncat: warning: child exited.
uncat: warning: exit.
0
socklog-2.1.1+repack/src/socklog.dist 0000644 0000000 0000000 00000000203 14702065454 016232 0 ustar root root listening on socklog.check.socket, starting.
foo
0
listening on 127.0.0.1:12614, starting.
127.0.0.1: foo
0
U: foo
U: bar
U: baz
0
socklog-2.1.1+repack/src/Makefile 0000644 0000000 0000000 00000026122 14702065454 015354 0 ustar root root IT=socklog socklog-check socklog-conf tryto uncat
default: sysdeps $(IT)
check: default check-socklog-unix check-socklog-inet
./check-local $(IT)
socklog-conf: load socklog-conf.o unix.a byte.a
./load socklog-conf unix.a byte.a
socklog: load socklog.o unix.a byte.a socket.lib
./load socklog unix.a byte.a `cat socket.lib`
socklog-check: load socklog-check.o unix.a byte.a socket.lib
./load socklog-check unix.a byte.a `cat socket.lib`
tryto: load tryto.o unix.a byte.a time.a
./load tryto unix.a byte.a time.a
uncat: load uncat.o unix.a byte.a time.a
./load uncat unix.a byte.a time.a
check-socklog-inet: load check-socklog-inet.o unix.a byte.a socket.lib
./load check-socklog-inet unix.a byte.a `cat socket.lib`
check-socklog-unix: load check-socklog-unix.o unix.a byte.a socket.lib
./load check-socklog-unix unix.a byte.a `cat socket.lib`
socklog-conf.o: compile socklog-conf.c
./compile socklog-conf.c
socklog.o: compile socklog.c
./compile socklog.c
socklog-check.o: compile socklog-check.c
./compile socklog-check.c
tryto.o: compile tryto.c iopause.h uint64.h
./compile tryto.c
uncat.o: compile uncat.c iopause.h uint64.h
./compile uncat.c
check-socklog-inet.o: compile check-socklog-inet.c
./compile check-socklog-inet.c
check-socklog-unix.o: compile check-socklog-unix.c
./compile check-socklog-unix.c
socket.lib: compile load trysocketlib.c
./compile trysocketlib.c
( ./load trysocketlib >/dev/null 2>&1 || \
( ./load trysocketlib -lxnet >/dev/null 2>&1 && echo '-lxnet' ) || \
( ./load trysocketlib -lsocket -lnsl >/dev/null 2>&1 && \
echo '-lsocket -lnsl' ) \
) >socket.lib
rm -f trysocketlib.o trysocketlib
clean:
find . -name \*~ -exec rm -f {} \;
find . -name .??*~ -exec rm -f {} \;
find . -name \#?* -exec rm -f {} \;
rm -f `cat TARGETS`
alloc.o: alloc.c alloc.h compile error.h
./compile alloc.c
alloc_re.o: alloc.h alloc_re.c byte.h compile
./compile alloc_re.c
buffer.o: buffer.c buffer.h compile
./compile buffer.c
buffer_0.o: buffer.h buffer_0.c compile
./compile buffer_0.c
buffer_1.o: buffer.h buffer_1.c compile
./compile buffer_1.c
buffer_2.o: buffer.h buffer_2.c compile
./compile buffer_2.c
buffer_get.o: buffer.h buffer_get.c byte.h compile error.h
./compile buffer_get.c
buffer_put.o: buffer.h buffer_put.c byte.h compile error.h str.h
./compile buffer_put.c
buffer_read.o: buffer.h buffer_read.c compile
./compile buffer_read.c
buffer_write.o: buffer.h buffer_write.c compile
./compile buffer_write.c
byte.a: byte_chr.o byte_copy.o byte_cr.o byte_diff.o byte_rchr.o byte_zero.o \
fmt_uint.o fmt_uint0.o fmt_ulong.o makelib scan_ulong.o str_chr.o \
str_diff.o str_len.o str_start.o
./makelib byte.a byte_chr.o byte_copy.o byte_cr.o byte_diff.o \
byte_rchr.o byte_zero.o fmt_uint.o fmt_uint0.o fmt_ulong.o \
scan_ulong.o str_chr.o str_diff.o str_len.o str_start.o
byte_chr.o: byte.h byte_chr.c compile
./compile byte_chr.c
byte_copy.o: byte.h byte_copy.c compile
./compile byte_copy.c
byte_cr.o: byte.h byte_cr.c compile
./compile byte_cr.c
byte_diff.o: byte.h byte_diff.c compile
./compile byte_diff.c
byte_rchr.o: byte.h byte_rchr.c compile
./compile byte_rchr.c
byte_zero.o: byte.h byte_zero.c compile
./compile byte_zero.c
choose: choose.sh warn-auto.sh
rm -f choose
cat warn-auto.sh choose.sh \
> choose
chmod 555 choose
coe.o: coe.c coe.h compile
./compile coe.c
compile: conf-cc print-cc.sh systype warn-auto.sh
rm -f compile
sh print-cc.sh > compile
chmod 555 compile
direntry.h: choose compile direntry.h1 direntry.h2 trydrent.c
./choose c trydrent direntry.h1 direntry.h2 > direntry.h
env.o: compile env.c env.h str.h
./compile env.c
error.o: compile error.c error.h
./compile error.c
error_str.o: compile error.h error_str.c
./compile error_str.c
fd_copy.o: compile fd.h fd_copy.c
./compile fd_copy.c
fd_move.o: compile fd.h fd_move.c
./compile fd_move.c
fifo.o: compile fifo.c fifo.h hasmkffo.h
./compile fifo.c
fmt_uint.o: compile fmt.h fmt_uint.c
./compile fmt_uint.c
fmt_uint0.o: compile fmt.h fmt_uint0.c
./compile fmt_uint0.c
fmt_ulong.o: compile fmt.h fmt_ulong.c
./compile fmt_ulong.c
hasflock.h: choose compile hasflock.h1 hasflock.h2 load tryflock.c
./choose cl tryflock hasflock.h1 hasflock.h2 > hasflock.h
hasmkffo.h: choose compile hasmkffo.h1 hasmkffo.h2 load trymkffo.c
./choose cl trymkffo hasmkffo.h1 hasmkffo.h2 > hasmkffo.h
hassgact.h: choose compile hassgact.h1 hassgact.h2 load trysgact.c
./choose cl trysgact hassgact.h1 hassgact.h2 > hassgact.h
hassgprm.h: choose compile hassgprm.h1 hassgprm.h2 load trysgprm.c
./choose cl trysgprm hassgprm.h1 hassgprm.h2 > hassgprm.h
haswaitp.h: choose compile haswaitp.h1 haswaitp.h2 load trywaitp.c
./choose cl trywaitp haswaitp.h1 haswaitp.h2 > haswaitp.h
iopause.h: choose compile iopause.h1 iopause.h2 load trypoll.c
./choose clr trypoll iopause.h1 iopause.h2 > iopause.h
iopause.o: compile iopause.c iopause.h select.h tai.h taia.h uint64.h
./compile iopause.c
load: conf-ld print-ld.sh systype warn-auto.sh
rm -f load
sh print-ld.sh > load
chmod 555 load
lock_ex.o: compile hasflock.h lock.h lock_ex.c
./compile lock_ex.c
lock_exnb.o: compile hasflock.h lock.h lock_exnb.c
./compile lock_exnb.c
makelib: print-ar.sh systype warn-auto.sh
rm -f makelib
sh print-ar.sh > makelib
chmod 555 makelib
ndelay_off.o: compile ndelay.h ndelay_off.c
./compile ndelay_off.c
ndelay_on.o: compile ndelay.h ndelay_on.c
./compile ndelay_on.c
open_append.o: compile open.h open_append.c
./compile open_append.c
open_read.o: compile open.h open_read.c
./compile open_read.c
open_trunc.o: compile open.h open_trunc.c
./compile open_trunc.c
open_write.o: compile open.h open_write.c
./compile open_write.c
openreadclose.o: compile error.h gen_alloc.h open.h openreadclose.c \
openreadclose.h readclose.h stralloc.h
./compile openreadclose.c
pathexec_env.o: alloc.h byte.h compile env.h gen_alloc.h pathexec.h \
pathexec_env.c str.h stralloc.h
./compile pathexec_env.c
pathexec_run.o: compile env.h error.h gen_alloc.h pathexec.h \
pathexec_run.c str.h stralloc.h
./compile pathexec_run.c
readclose.o: compile error.h gen_alloc.h readclose.c readclose.h \
stralloc.h
./compile readclose.c
scan_ulong.o: compile scan.h scan_ulong.c
./compile scan_ulong.c
seek_set.o: compile seek.h seek_set.c
./compile seek_set.c
select.h: choose compile select.h1 select.h2 trysysel.c
./choose c trysysel select.h1 select.h2 > select.h
sgetopt.o: buffer.h compile sgetopt.c sgetopt.h subgetopt.h
./compile sgetopt.c
sig.o: compile sig.c sig.h
./compile sig.c
sig_block.o: compile hassgprm.h sig.h sig_block.c
./compile sig_block.c
sig_catch.o: compile hassgact.h sig.h sig_catch.c
./compile sig_catch.c
sig_pause.o: compile hassgprm.h sig.h sig_pause.c
./compile sig_pause.c
str_chr.o: compile str.h str_chr.c
./compile str_chr.c
str_diff.o: compile str.h str_diff.c
./compile str_diff.c
str_len.o: compile str.h str_len.c
./compile str_len.c
str_start.o: compile str.h str_start.c
./compile str_start.c
stralloc_cat.o: byte.h compile gen_alloc.h stralloc.h stralloc_cat.c
./compile stralloc_cat.c
stralloc_catb.o: byte.h compile gen_alloc.h stralloc.h \
stralloc_catb.c
./compile stralloc_catb.c
stralloc_cats.o: byte.h compile gen_alloc.h str.h stralloc.h \
stralloc_cats.c
./compile stralloc_cats.c
stralloc_eady.o: alloc.h compile gen_alloc.h gen_allocdefs.h \
stralloc.h stralloc_eady.c
./compile stralloc_eady.c
stralloc_opyb.o: byte.h compile gen_alloc.h stralloc.h \
stralloc_opyb.c
./compile stralloc_opyb.c
stralloc_opys.o: byte.h compile gen_alloc.h str.h stralloc.h \
stralloc_opys.c
./compile stralloc_opys.c
stralloc_pend.o: alloc.h compile gen_alloc.h gen_allocdefs.h \
stralloc.h stralloc_pend.c
./compile stralloc_pend.c
strerr_die.o: buffer.h compile strerr.h strerr_die.c
./compile strerr_die.c
strerr_sys.o: compile error.h strerr.h strerr_sys.c
./compile strerr_sys.c
subgetopt.o: compile subgetopt.c subgetopt.h
./compile subgetopt.c
sysdeps: compile direntry.h hasflock.h hasmkffo.h hassgact.h \
hassgprm.h haswaitp.h iopause.h load select.h systype \
uint64.h
rm -f sysdeps
cat systype compile load >> sysdeps
grep sysdep direntry.h >> sysdeps
grep sysdep haswaitp.h >> sysdeps
grep sysdep hassgact.h >> sysdeps
grep sysdep hassgprm.h >> sysdeps
grep sysdep select.h >> sysdeps
grep sysdep uint64.h >> sysdeps
grep sysdep iopause.h >> sysdeps
grep sysdep hasmkffo.h >> sysdeps
grep sysdep hasflock.h >> sysdeps
cat sysdeps
systype: find-systype.sh trycpp.c x86cpuid.c
sh find-systype.sh > systype
tai_now.o: compile tai.h tai_now.c uint64.h
./compile tai_now.c
tai_pack.o: compile tai.h tai_pack.c uint64.h
./compile tai_pack.c
tai_sub.o: compile tai.h tai_sub.c uint64.h
./compile tai_sub.c
tai_unpack.o: compile tai.h tai_unpack.c uint64.h
./compile tai_unpack.c
taia_add.o: compile tai.h taia.h taia_add.c uint64.h
./compile taia_add.c
taia_approx.o: compile tai.h taia.h taia_approx.c uint64.h
./compile taia_approx.c
taia_frac.o: compile tai.h taia.h taia_frac.c uint64.h
./compile taia_frac.c
taia_less.o: compile tai.h taia.h taia_less.c uint64.h
./compile taia_less.c
taia_now.o: compile tai.h taia.h taia_now.c uint64.h
./compile taia_now.c
taia_pack.o: compile tai.h taia.h taia_pack.c uint64.h
./compile taia_pack.c
taia_sub.o: compile tai.h taia.h taia_sub.c uint64.h
./compile taia_sub.c
taia_uint.o: compile tai.h taia.h taia_uint.c uint64.h
./compile taia_uint.c
time.a: iopause.o makelib tai_now.o tai_pack.o tai_sub.o tai_unpack.o \
taia_add.o taia_approx.o taia_frac.o taia_less.o taia_now.o \
taia_pack.o taia_sub.o taia_uint.o
./makelib time.a iopause.o tai_now.o tai_pack.o tai_sub.o \
tai_unpack.o taia_add.o taia_approx.o taia_frac.o taia_less.o \
taia_now.o taia_pack.o taia_sub.o taia_uint.o
uint64.h: choose compile load tryulong64.c uint64.h1 uint64.h2
./choose clr tryulong64 uint64.h1 uint64.h2 > uint64.h
unix.a: alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o buffer_2.o \
buffer_get.o buffer_put.o buffer_read.o buffer_write.o coe.o env.o \
error.o error_str.o fd_copy.o fd_move.o fifo.o lock_ex.o lock_exnb.o \
makelib ndelay_off.o ndelay_on.o open_append.o open_read.o \
open_trunc.o open_write.o openreadclose.o pathexec_env.o \
pathexec_run.o readclose.o seek_set.o sgetopt.o sig.o \
sig_block.o sig_catch.o sig_pause.o stralloc_cat.o stralloc_catb.o \
stralloc_cats.o stralloc_eady.o stralloc_opyb.o stralloc_opys.o \
stralloc_pend.o strerr_die.o strerr_sys.o subgetopt.o wait_nohang.o \
wait_pid.o
./makelib unix.a alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o \
buffer_2.o buffer_get.o buffer_put.o buffer_read.o buffer_write.o \
coe.o env.o error.o error_str.o fd_copy.o fd_move.o fifo.o lock_ex.o \
lock_exnb.o ndelay_off.o ndelay_on.o open_append.o open_read.o \
open_trunc.o open_write.o openreadclose.o pathexec_env.o \
pathexec_run.o readclose.o seek_set.o sgetopt.o sig.o \
sig_block.o sig_catch.o sig_pause.o stralloc_cat.o stralloc_catb.o \
stralloc_cats.o stralloc_eady.o stralloc_opyb.o stralloc_opys.o \
stralloc_pend.o strerr_die.o strerr_sys.o subgetopt.o wait_nohang.o \
wait_pid.o
wait_nohang.o: compile haswaitp.h wait_nohang.c
./compile wait_nohang.c
wait_pid.o: compile error.h haswaitp.h wait_pid.c
./compile wait_pid.c
socklog-2.1.1+repack/src/byte_rchr.c 0000644 0000000 0000000 00000000707 14702065454 016042 0 ustar root root /* Public domain. */
#include "byte.h"
unsigned int byte_rchr(s,n,c)
char *s;
register unsigned int n;
int c;
{
register char ch;
register char *t;
register char *u;
ch = c;
t = s;
u = 0;
for (;;) {
if (!n) break; if (*t == ch) u = t; ++t; --n;
if (!n) break; if (*t == ch) u = t; ++t; --n;
if (!n) break; if (*t == ch) u = t; ++t; --n;
if (!n) break; if (*t == ch) u = t; ++t; --n;
}
if (!u) u = t;
return u - s;
}
socklog-2.1.1+repack/src/taia_approx.c 0000644 0000000 0000000 00000000203 14702065454 016357 0 ustar root root /* Public domain. */
#include "taia.h"
double taia_approx(const struct taia *t)
{
return tai_approx(&t->sec) + taia_frac(t);
}
socklog-2.1.1+repack/src/str_len.c 0000644 0000000 0000000 00000000405 14702065454 015522 0 ustar root root /* Public domain. */
#include "str.h"
unsigned int str_len(const char *s)
{
register const char *t;
t = s;
for (;;) {
if (!*t) return t - s; ++t;
if (!*t) return t - s; ++t;
if (!*t) return t - s; ++t;
if (!*t) return t - s; ++t;
}
}
socklog-2.1.1+repack/src/stralloc_opys.c 0000644 0000000 0000000 00000000255 14702065454 016754 0 ustar root root /* Public domain. */
#include "byte.h"
#include "str.h"
#include "stralloc.h"
int stralloc_copys(stralloc *sa,const char *s)
{
return stralloc_copyb(sa,s,str_len(s));
}
socklog-2.1.1+repack/src/sig_block.c 0000644 0000000 0000000 00000001223 14702065454 016007 0 ustar root root /* Public domain. */
#include
#include "sig.h"
#include "hassgprm.h"
void sig_block(int sig)
{
#ifdef HASSIGPROCMASK
sigset_t ss;
sigemptyset(&ss);
sigaddset(&ss,sig);
sigprocmask(SIG_BLOCK,&ss,(sigset_t *) 0);
#else
sigblock(1 << (sig - 1));
#endif
}
void sig_unblock(int sig)
{
#ifdef HASSIGPROCMASK
sigset_t ss;
sigemptyset(&ss);
sigaddset(&ss,sig);
sigprocmask(SIG_UNBLOCK,&ss,(sigset_t *) 0);
#else
sigsetmask(sigsetmask(~0) & ~(1 << (sig - 1)));
#endif
}
void sig_blocknone(void)
{
#ifdef HASSIGPROCMASK
sigset_t ss;
sigemptyset(&ss);
sigprocmask(SIG_SETMASK,&ss,(sigset_t *) 0);
#else
sigsetmask(0);
#endif
}
socklog-2.1.1+repack/src/open.h 0000644 0000000 0000000 00000000365 14702065454 015027 0 ustar root root /* Public domain. */
#ifndef OPEN_H
#define OPEN_H
extern int open_read(const char *);
extern int open_excl(const char *);
extern int open_append(const char *);
extern int open_trunc(const char *);
extern int open_write(const char *);
#endif
socklog-2.1.1+repack/src/hasmkffo.h2 0000644 0000000 0000000 00000000100 14702065454 015731 0 ustar root root /* Public domain. */
/* sysdep: +mkfifo */
#define HASMKFIFO 1
socklog-2.1.1+repack/src/conf-ld 0000644 0000000 0000000 00000000077 14702065454 015162 0 ustar root root gcc -s
This will be used to link .o files into an executable.
socklog-2.1.1+repack/src/trymkffo.c 0000644 0000000 0000000 00000000161 14702065454 015714 0 ustar root root /* Public domain. */
#include
#include
void main()
{
mkfifo("temp-trymkffo",0);
}
socklog-2.1.1+repack/src/select.h2 0000644 0000000 0000000 00000000265 14702065454 015426 0 ustar root root /* Public domain. */
#ifndef SELECT_H
#define SELECT_H
/* sysdep: +sysselect */
#include
#include
#include
extern int select();
#endif
socklog-2.1.1+repack/src/TODO 0000644 0000000 0000000 00000000000 14702065454 014367 0 ustar root root socklog-2.1.1+repack/src/ndelay_off.c 0000644 0000000 0000000 00000000345 14702065454 016165 0 ustar root root /* Public domain. */
#include
#include
#include "ndelay.h"
#ifndef O_NONBLOCK
#define O_NONBLOCK O_NDELAY
#endif
int ndelay_off(int fd)
{
return fcntl(fd,F_SETFL,fcntl(fd,F_GETFL,0) & ~O_NONBLOCK);
}
socklog-2.1.1+repack/src/hassgact.h2 0000644 0000000 0000000 00000000106 14702065454 015736 0 ustar root root /* Public domain. */
/* sysdep: +sigaction */
#define HASSIGACTION 1
socklog-2.1.1+repack/src/trysgprm.c 0000644 0000000 0000000 00000000250 14702065454 015741 0 ustar root root /* Public domain. */
#include
int main()
{
sigset_t ss;
sigemptyset(&ss);
sigaddset(&ss,SIGCHLD);
sigprocmask(SIG_SETMASK,&ss,(sigset_t *) 0);
}
socklog-2.1.1+repack/src/taia_now.c 0000644 0000000 0000000 00000000441 14702065454 015655 0 ustar root root /* Public domain. */
#include
#include
#include
#include "taia.h"
void taia_now(struct taia *t)
{
struct timeval now;
gettimeofday(&now,(struct timezone *) 0);
tai_unix(&t->sec,now.tv_sec);
t->nano = 1000 * now.tv_usec + 500;
t->atto = 0;
}
socklog-2.1.1+repack/src/socklog-check.check 0000755 0000000 0000000 00000000435 14702065454 017431 0 ustar root root #!/bin/sh
socklog-check -V
echo $?
socklog unix socklog.check.socket &
pid=$!
sleep 1
socklog-check unix socklog.check.socket
echo $?
socklog-check -v unix socklog.check.socket
echo $?
kill -TERM "$pid"
wait
socklog-check unix socklog.check.socket
echo $?
rm -f socklog.check.socket
socklog-2.1.1+repack/src/haswaitp.h2 0000644 0000000 0000000 00000000102 14702065454 015755 0 ustar root root /* Public domain. */
/* sysdep: +waitpid */
#define HASWAITPID 1
socklog-2.1.1+repack/src/lock_ex.c 0000644 0000000 0000000 00000000374 14702065454 015505 0 ustar root root /* Public domain. */
#include
#include
#include
#include "hasflock.h"
#include "lock.h"
#ifdef HASFLOCK
int lock_ex(int fd) { return flock(fd,LOCK_EX); }
#else
int lock_ex(int fd) { return lockf(fd,1,0); }
#endif
socklog-2.1.1+repack/src/scan.h 0000644 0000000 0000000 00000002605 14702065454 015011 0 ustar root root /* Public domain. */
#ifndef SCAN_H
#define SCAN_H
extern unsigned int scan_uint(const char *,unsigned int *);
extern unsigned int scan_xint(const char *,unsigned int *);
extern unsigned int scan_nbbint(const char *,unsigned int,unsigned int,unsigned int,unsigned int *);
extern unsigned int scan_ushort(const char *,unsigned short *);
extern unsigned int scan_xshort(const char *,unsigned short *);
extern unsigned int scan_nbbshort(const char *,unsigned int,unsigned int,unsigned int,unsigned short *);
extern unsigned int scan_ulong(const char *,unsigned long *);
extern unsigned int scan_xlong(const char *,unsigned long *);
extern unsigned int scan_nbblong(const char *,unsigned int,unsigned int,unsigned int,unsigned long *);
extern unsigned int scan_plusminus(const char *,int *);
extern unsigned int scan_0x(const char *,unsigned int *);
extern unsigned int scan_whitenskip(const char *,unsigned int);
extern unsigned int scan_nonwhitenskip(const char *,unsigned int);
extern unsigned int scan_charsetnskip(const char *,const char *,unsigned int);
extern unsigned int scan_noncharsetnskip(const char *,const char *,unsigned int);
extern unsigned int scan_strncmp(const char *,const char *,unsigned int);
extern unsigned int scan_memcmp(const char *,const char *,unsigned int);
extern unsigned int scan_long(const char *,long *);
extern unsigned int scan_8long(const char *,unsigned long *);
#endif
socklog-2.1.1+repack/src/fmt_ulong.c 0000644 0000000 0000000 00000000520 14702065454 016044 0 ustar root root /* Public domain. */
#include "fmt.h"
unsigned int fmt_ulong(register char *s,register unsigned long u)
{
register unsigned int len; register unsigned long q;
len = 1; q = u;
while (q > 9) { ++len; q /= 10; }
if (s) {
s += len;
do { *--s = '0' + (u % 10); u /= 10; } while(u); /* handles u == 0 */
}
return len;
}
socklog-2.1.1+repack/src/seek_set.c 0000644 0000000 0000000 00000000316 14702065454 015657 0 ustar root root /* Public domain. */
#include
#include
#include "seek.h"
#define SET 0 /* sigh */
int seek_set(int fd,seek_pos pos)
{ if (lseek(fd,(off_t) pos,SET) == -1) return -1; return 0; }
socklog-2.1.1+repack/src/open_trunc.c 0000644 0000000 0000000 00000000264 14702065454 016233 0 ustar root root /* Public domain. */
#include
#include
#include "open.h"
int open_trunc(const char *fn)
{ return open(fn,O_WRONLY | O_NDELAY | O_TRUNC | O_CREAT,0644); }
socklog-2.1.1+repack/src/wait_pid.c 0000644 0000000 0000000 00000001333 14702065454 015655 0 ustar root root /* Public domain. */
#include
#include
#include "error.h"
#include "haswaitp.h"
#ifdef HASWAITPID
int wait_pid(wstat,pid) int *wstat; int pid;
{
int r;
do
r = waitpid(pid,wstat,0);
while ((r == -1) && (errno == error_intr));
return r;
}
#else
/* XXX untested */
/* XXX breaks down with more than two children */
static int oldpid = 0;
static int oldwstat; /* defined if(oldpid) */
int wait_pid(wstat,pid) int *wstat; int pid;
{
int r;
if (pid == oldpid) { *wstat = oldwstat; oldpid = 0; return pid; }
do {
r = wait(wstat);
if ((r != pid) && (r != -1)) { oldwstat = *wstat; oldpid = r; continue; }
}
while ((r == -1) && (errno == error_intr));
return r;
}
#endif
socklog-2.1.1+repack/src/trysocketlib.c 0000644 0000000 0000000 00000000312 14702065454 016567 0 ustar root root #include
#include
#include
#include
#include
int main(void) {
int s;
s =socket(AF_INET, SOCK_STREAM, 0);
return(close(s));
}
socklog-2.1.1+repack/src/TARGETS 0000644 0000000 0000000 00000002500 14702065454 014742 0 ustar root root socklog
socklog.o
socklog-check
socklog-check.o
socklog-conf
socklog-conf.o
tryto
tryto.o
uncat
uncat.o
check-socklog-inet
check-socklog-inet.o
check-socklog-unix
check-socklog-unix.o
socket.lib
trysocketlib
trysocketlib.o
alloc.o
alloc_re.o
buffer.o
buffer_0.o
buffer_1.o
buffer_2.o
buffer_get.o
buffer_put.o
buffer_read.o
buffer_write.o
byte.a
byte_chr.o
byte_copy.o
byte_cr.o
byte_diff.o
byte_rchr.o
byte_zero.o
choose
coe.o
compile
direntry.h
env.o
error.o
error_str.o
fd_copy.o
fd_move.o
fifo.o
fmt_uint.o
fmt_uint0.o
fmt_ulong.o
hasflock.h
hasmkffo.h
hassgact.h
hassgprm.h
haswaitp.h
iopause.h
iopause.o
load
lock_ex.o
lock_exnb.o
makelib
ndelay_off.o
ndelay_on.o
open_append.o
open_read.o
open_trunc.o
open_write.o
openreadclose.o
pathexec_env.o
pathexec_run.o
prot.o
readclose.o
scan_ulong.o
seek_set.o
select.h
sgetopt.o
sig.o
sig_block.o
sig_catch.o
sig_pause.o
str_chr.o
str_diff.o
str_len.o
str_start.o
stralloc_cat.o
stralloc_catb.o
stralloc_cats.o
stralloc_eady.o
stralloc_opyb.o
stralloc_opys.o
stralloc_pend.o
strerr_die.o
strerr_sys.o
subgetopt.o
sysdeps
systype
tai_now.o
tai_pack.o
tai_sub.o
tai_unpack.o
taia_add.o
taia_approx.o
taia_frac.o
taia_less.o
taia_now.o
taia_pack.o
taia_sub.o
taia_uint.o
time.a
uint64.h
unix.a
wait_nohang.o
wait_pid.o
socklog.local
socklog-check.local
socklog-conf.local
tryto.local
uncat.local
socklog-2.1.1+repack/src/fd_move.c 0000644 0000000 0000000 00000000274 14702065454 015477 0 ustar root root /* Public domain. */
#include
#include "fd.h"
int fd_move(int to,int from)
{
if (to == from) return 0;
if (fd_copy(to,from) == -1) return -1;
close(from);
return 0;
}
socklog-2.1.1+repack/src/buffer_read.c 0000644 0000000 0000000 00000000225 14702065454 016320 0 ustar root root /* Public domain. */
#include
#include "buffer.h"
int buffer_unixread(int fd,char *buf,unsigned int len)
{
return read(fd,buf,len);
}
socklog-2.1.1+repack/src/ndelay.h 0000644 0000000 0000000 00000000170 14702065454 015334 0 ustar root root /* Public domain. */
#ifndef NDELAY_H
#define NDELAY_H
extern int ndelay_on(int);
extern int ndelay_off(int);
#endif
socklog-2.1.1+repack/src/ndelay_on.c 0000644 0000000 0000000 00000000343 14702065454 016025 0 ustar root root /* Public domain. */
#include
#include
#include "ndelay.h"
#ifndef O_NONBLOCK
#define O_NONBLOCK O_NDELAY
#endif
int ndelay_on(int fd)
{
return fcntl(fd,F_SETFL,fcntl(fd,F_GETFL,0) | O_NONBLOCK);
}
socklog-2.1.1+repack/src/sig_pause.c 0000644 0000000 0000000 00000000323 14702065454 016032 0 ustar root root /* Public domain. */
#include
#include "sig.h"
#include "hassgprm.h"
void sig_pause(void)
{
#ifdef HASSIGPROCMASK
sigset_t ss;
sigemptyset(&ss);
sigsuspend(&ss);
#else
sigpause(0);
#endif
}
socklog-2.1.1+repack/src/socklog-conf.check 0000755 0000000 0000000 00000000672 14702065454 017304 0 ustar root root #!/bin/sh
rm -rf "${ctmp}"
socklog-conf
echo $?
socklog-conf -V
echo $?
mkdir -p "${ctmp}"
user=`whoami`
socklog-conf unix "${user}" "${user}" "${ctmp}"/socklog "${ctmp}"/unix
echo $?
socklog-conf inet "${user}" "${user}" "${ctmp}"/socklog "${ctmp}"/inet
echo $?
socklog-conf klog "${user}" "${user}" "${ctmp}"/socklog "${ctmp}"/klog
echo $?
socklog-conf ucspi "${user}" "${user}" "${ctmp}"/socklog "${ctmp}"/ucspi
echo $?
rm -rf "${ctmp}"
socklog-2.1.1+repack/src/haswaitp.h1 0000644 0000000 0000000 00000000055 14702065454 015763 0 ustar root root /* Public domain. */
/* sysdep: -waitpid */
socklog-2.1.1+repack/src/error_str.c 0000644 0000000 0000000 00000012576 14702065454 016111 0 ustar root root /* Public domain. */
#include
#include "error.h"
#define X(e,s) if (i == e) return s;
const char *error_str(int i)
{
X(0,"no error")
X(error_intr,"interrupted system call")
X(error_nomem,"out of memory")
X(error_noent,"file does not exist")
X(error_txtbsy,"text busy")
X(error_io,"input/output error")
X(error_exist,"file already exists")
X(error_timeout,"timed out")
X(error_inprogress,"operation in progress")
X(error_again,"temporary failure")
X(error_wouldblock,"input/output would block")
X(error_pipe,"broken pipe")
X(error_perm,"permission denied")
X(error_acces,"access denied")
X(error_nodevice,"device not configured")
X(error_proto,"protocol error")
X(error_isdir,"is a directory")
X(error_connrefused,"connection refused")
X(error_notdir,"not a directory")
#ifdef ESRCH
X(ESRCH,"no such process")
#endif
#ifdef E2BIG
X(E2BIG,"argument list too long")
#endif
#ifdef ENOEXEC
X(ENOEXEC,"exec format error")
#endif
#ifdef EBADF
X(EBADF,"file descriptor not open")
#endif
#ifdef ECHILD
X(ECHILD,"no child processes")
#endif
#ifdef EDEADLK
X(EDEADLK,"operation would cause deadlock")
#endif
#ifdef EFAULT
X(EFAULT,"bad address")
#endif
#ifdef ENOTBLK
X(ENOTBLK,"not a block device")
#endif
#ifdef EBUSY
X(EBUSY,"device busy")
#endif
#ifdef EXDEV
X(EXDEV,"cross-device link")
#endif
#ifdef ENODEV
X(ENODEV,"device does not support operation")
#endif
#ifdef EINVAL
X(EINVAL,"invalid argument")
#endif
#ifdef ENFILE
X(ENFILE,"system cannot open more files")
#endif
#ifdef EMFILE
X(EMFILE,"process cannot open more files")
#endif
#ifdef ENOTTY
X(ENOTTY,"not a tty")
#endif
#ifdef EFBIG
X(EFBIG,"file too big")
#endif
#ifdef ENOSPC
X(ENOSPC,"out of disk space")
#endif
#ifdef ESPIPE
X(ESPIPE,"unseekable descriptor")
#endif
#ifdef EROFS
X(EROFS,"read-only file system")
#endif
#ifdef EMLINK
X(EMLINK,"too many links")
#endif
#ifdef EDOM
X(EDOM,"input out of range")
#endif
#ifdef ERANGE
X(ERANGE,"output out of range")
#endif
#ifdef EALREADY
X(EALREADY,"operation already in progress")
#endif
#ifdef ENOTSOCK
X(ENOTSOCK,"not a socket")
#endif
#ifdef EDESTADDRREQ
X(EDESTADDRREQ,"destination address required")
#endif
#ifdef EMSGSIZE
X(EMSGSIZE,"message too long")
#endif
#ifdef EPROTOTYPE
X(EPROTOTYPE,"incorrect protocol type")
#endif
#ifdef ENOPROTOOPT
X(ENOPROTOOPT,"protocol not available")
#endif
#ifdef EPROTONOSUPPORT
X(EPROTONOSUPPORT,"protocol not supported")
#endif
#ifdef ESOCKTNOSUPPORT
X(ESOCKTNOSUPPORT,"socket type not supported")
#endif
#ifdef EOPNOTSUPP
X(EOPNOTSUPP,"operation not supported")
#endif
#ifdef EPFNOSUPPORT
X(EPFNOSUPPORT,"protocol family not supported")
#endif
#ifdef EAFNOSUPPORT
X(EAFNOSUPPORT,"address family not supported")
#endif
#ifdef EADDRINUSE
X(EADDRINUSE,"address already used")
#endif
#ifdef EADDRNOTAVAIL
X(EADDRNOTAVAIL,"address not available")
#endif
#ifdef ENETDOWN
X(ENETDOWN,"network down")
#endif
#ifdef ENETUNREACH
X(ENETUNREACH,"network unreachable")
#endif
#ifdef ENETRESET
X(ENETRESET,"network reset")
#endif
#ifdef ECONNABORTED
X(ECONNABORTED,"connection aborted")
#endif
#ifdef ECONNRESET
X(ECONNRESET,"connection reset")
#endif
#ifdef ENOBUFS
X(ENOBUFS,"out of buffer space")
#endif
#ifdef EISCONN
X(EISCONN,"already connected")
#endif
#ifdef ENOTCONN
X(ENOTCONN,"not connected")
#endif
#ifdef ESHUTDOWN
X(ESHUTDOWN,"socket shut down")
#endif
#ifdef ETOOMANYREFS
X(ETOOMANYREFS,"too many references")
#endif
#ifdef ELOOP
X(ELOOP,"symbolic link loop")
#endif
#ifdef ENAMETOOLONG
X(ENAMETOOLONG,"file name too long")
#endif
#ifdef EHOSTDOWN
X(EHOSTDOWN,"host down")
#endif
#ifdef EHOSTUNREACH
X(EHOSTUNREACH,"host unreachable")
#endif
#ifdef ENOTEMPTY
X(ENOTEMPTY,"directory not empty")
#endif
#ifdef EPROCLIM
X(EPROCLIM,"too many processes")
#endif
#ifdef EUSERS
X(EUSERS,"too many users")
#endif
#ifdef EDQUOT
X(EDQUOT,"disk quota exceeded")
#endif
#ifdef ESTALE
X(ESTALE,"stale NFS file handle")
#endif
#ifdef EREMOTE
X(EREMOTE,"too many levels of remote in path")
#endif
#ifdef EBADRPC
X(EBADRPC,"RPC structure is bad")
#endif
#ifdef ERPCMISMATCH
X(ERPCMISMATCH,"RPC version mismatch")
#endif
#ifdef EPROGUNAVAIL
X(EPROGUNAVAIL,"RPC program unavailable")
#endif
#ifdef EPROGMISMATCH
X(EPROGMISMATCH,"program version mismatch")
#endif
#ifdef EPROCUNAVAIL
X(EPROCUNAVAIL,"bad procedure for program")
#endif
#ifdef ENOLCK
X(ENOLCK,"no locks available")
#endif
#ifdef ENOSYS
X(ENOSYS,"system call not available")
#endif
#ifdef EFTYPE
X(EFTYPE,"bad file type")
#endif
#ifdef EAUTH
X(EAUTH,"authentication error")
#endif
#ifdef ENEEDAUTH
X(ENEEDAUTH,"not authenticated")
#endif
#ifdef ENOSTR
X(ENOSTR,"not a stream device")
#endif
#ifdef ETIME
X(ETIME,"timer expired")
#endif
#ifdef ENOSR
X(ENOSR,"out of stream resources")
#endif
#ifdef ENOMSG
X(ENOMSG,"no message of desired type")
#endif
#ifdef EBADMSG
X(EBADMSG,"bad message type")
#endif
#ifdef EIDRM
X(EIDRM,"identifier removed")
#endif
#ifdef ENONET
X(ENONET,"machine not on network")
#endif
#ifdef ERREMOTE
X(ERREMOTE,"object not local")
#endif
#ifdef ENOLINK
X(ENOLINK,"link severed")
#endif
#ifdef EADV
X(EADV,"advertise error")
#endif
#ifdef ESRMNT
X(ESRMNT,"srmount error")
#endif
#ifdef ECOMM
X(ECOMM,"communication error")
#endif
#ifdef EMULTIHOP
X(EMULTIHOP,"multihop attempted")
#endif
#ifdef EREMCHG
X(EREMCHG,"remote address changed")
#endif
return "unknown error";
}
socklog-2.1.1+repack/src/stralloc_cat.c 0000644 0000000 0000000 00000000257 14702065454 016533 0 ustar root root /* Public domain. */
#include "byte.h"
#include "stralloc.h"
int stralloc_cat(stralloc *sato,const stralloc *safrom)
{
return stralloc_catb(sato,safrom->s,safrom->len);
}
socklog-2.1.1+repack/src/tai_sub.c 0000644 0000000 0000000 00000000206 14702065454 015501 0 ustar root root /* Public domain. */
#include "tai.h"
void tai_sub(struct tai *t,const struct tai *u,const struct tai *v)
{
t->x = u->x - v->x;
}
socklog-2.1.1+repack/src/iopause.h1 0000644 0000000 0000000 00000000462 14702065454 015612 0 ustar root root /* Public domain. */
#ifndef IOPAUSE_H
#define IOPAUSE_H
/* sysdep: -poll */
typedef struct {
int fd;
short events;
short revents;
} iopause_fd;
#define IOPAUSE_READ 1
#define IOPAUSE_WRITE 4
#include "taia.h"
extern void iopause(iopause_fd *,unsigned int,struct taia *,struct taia *);
#endif
socklog-2.1.1+repack/src/strerr_die.c 0000644 0000000 0000000 00000001554 14702065454 016224 0 ustar root root /* Public domain. */
#include
#include "buffer.h"
#include "strerr.h"
void strerr_warn(const char *x1,const char *x2,const char *x3,const char *x4,const char *x5,const char *x6,const struct strerr *se)
{
strerr_sysinit();
if (x1) buffer_puts(buffer_2,x1);
if (x2) buffer_puts(buffer_2,x2);
if (x3) buffer_puts(buffer_2,x3);
if (x4) buffer_puts(buffer_2,x4);
if (x5) buffer_puts(buffer_2,x5);
if (x6) buffer_puts(buffer_2,x6);
while(se) {
if (se->x) buffer_puts(buffer_2,se->x);
if (se->y) buffer_puts(buffer_2,se->y);
if (se->z) buffer_puts(buffer_2,se->z);
se = se->who;
}
buffer_puts(buffer_2,"\n");
buffer_flush(buffer_2);
}
void strerr_die(int e,const char *x1,const char *x2,const char *x3,const char *x4,const char *x5,const char *x6,const struct strerr *se)
{
strerr_warn(x1,x2,x3,x4,x5,x6,se);
_exit(e);
}
socklog-2.1.1+repack/src/trypoll.c 0000644 0000000 0000000 00000000572 14702065454 015566 0 ustar root root /* Public domain. */
#include
#include
#include
#include
int main()
{
struct pollfd x;
x.fd = open("trypoll.c",O_RDONLY);
if (x.fd == -1) _exit(111);
x.events = POLLIN;
if (poll(&x,1,10) == -1) _exit(1);
if (x.revents != POLLIN) _exit(1);
/* XXX: try to detect and avoid poll() imitation libraries */
_exit(0);
}
socklog-2.1.1+repack/src/iopause.c 0000644 0000000 0000000 00000003214 14702065454 015522 0 ustar root root /* Public domain. */
#include "taia.h"
#include "select.h"
#include "iopause.h"
void iopause(iopause_fd *x,unsigned int len,struct taia *deadline,struct taia *stamp)
{
struct taia t;
int millisecs;
double d;
int i;
if (taia_less(deadline,stamp))
millisecs = 0;
else {
t = *stamp;
taia_sub(&t,deadline,&t);
d = taia_approx(&t);
if (d > 1000.0) d = 1000.0;
millisecs = d * 1000.0 + 20.0;
}
for (i = 0;i < len;++i)
x[i].revents = 0;
#ifdef IOPAUSE_POLL
poll(x,len,millisecs);
/* XXX: some kernels apparently need x[0] even if len is 0 */
/* XXX: how to handle EAGAIN? are kernels really this dumb? */
/* XXX: how to handle EINVAL? when exactly can this happen? */
#else
{
struct timeval tv;
fd_set rfds;
fd_set wfds;
int nfds;
int fd;
FD_ZERO(&rfds);
FD_ZERO(&wfds);
nfds = 1;
for (i = 0;i < len;++i) {
fd = x[i].fd;
if (fd < 0) continue;
if (fd >= 8 * sizeof(fd_set)) continue; /*XXX*/
if (fd >= nfds) nfds = fd + 1;
if (x[i].events & IOPAUSE_READ) FD_SET(fd,&rfds);
if (x[i].events & IOPAUSE_WRITE) FD_SET(fd,&wfds);
}
tv.tv_sec = millisecs / 1000;
tv.tv_usec = 1000 * (millisecs % 1000);
if (select(nfds,&rfds,&wfds,(fd_set *) 0,&tv) <= 0)
return;
/* XXX: for EBADF, could seek out and destroy the bad descriptor */
for (i = 0;i < len;++i) {
fd = x[i].fd;
if (fd < 0) continue;
if (fd >= 8 * sizeof(fd_set)) continue; /*XXX*/
if (x[i].events & IOPAUSE_READ)
if (FD_ISSET(fd,&rfds)) x[i].revents |= IOPAUSE_READ;
if (x[i].events & IOPAUSE_WRITE)
if (FD_ISSET(fd,&wfds)) x[i].revents |= IOPAUSE_WRITE;
}
}
#endif
}
socklog-2.1.1+repack/src/choose.sh 0000644 0000000 0000000 00000000402 14702065454 015521 0 ustar root root
result="$4"
case "$1" in
*c*) ./compile $2.c >/dev/null 2>&1 || result="$3" ;;
esac
case "$1" in
*l*) ./load $2 >/dev/null 2>&1 || result="$3" ;;
esac
case "$1" in
*r*) ./$2 >/dev/null 2>&1 || result="$3" ;;
esac
rm -f $2.o $2
exec cat "$result"
socklog-2.1.1+repack/src/subgetopt.h 0000644 0000000 0000000 00000001110 14702065454 016067 0 ustar root root /* Public domain. */
#ifndef SUBGETOPT_H
#define SUBGETOPT_H
#ifndef SUBGETOPTNOSHORT
#define sgopt subgetopt
#define sgoptarg subgetoptarg
#define sgoptind subgetoptind
#define sgoptpos subgetoptpos
#define sgoptproblem subgetoptproblem
#define sgoptprogname subgetoptprogname
#define sgoptdone subgetoptdone
#endif
#define SUBGETOPTDONE -1
extern int subgetopt(int,char *const *,const char *);
extern const char *subgetoptarg;
extern int subgetoptind;
extern int subgetoptpos;
extern int subgetoptproblem;
extern const char *subgetoptprogname;
extern int subgetoptdone;
#endif
socklog-2.1.1+repack/src/check-local 0000755 0000000 0000000 00000000350 14702065454 016002 0 ustar root root #!/bin/sh
PATH=`pwd`:$PATH
for i in ${1+"$@"}; do
echo "Checking $i..."
env - PATH="$PATH" ctmp="`pwd`/check-tmp" $i.check 2>&1 |cat -v >$i.local
./check-diff $i || ( cat $i.local; echo "$i failed."; exit 1 ) || exit 1
done
socklog-2.1.1+repack/src/fd.h 0000644 0000000 0000000 00000000163 14702065454 014453 0 ustar root root /* Public domain. */
#ifndef FD_H
#define FD_H
extern int fd_copy(int,int);
extern int fd_move(int,int);
#endif
socklog-2.1.1+repack/src/print-ar.sh 0000644 0000000 0000000 00000000371 14702065454 016002 0 ustar root root cat warn-auto.sh
echo 'main="$1"; shift'
echo 'rm -f "$main"'
echo 'ar cr "$main" ${1+"$@"}'
case "`cat systype`" in
sunos-5.*) ;;
unix_sv*) ;;
irix64-*) ;;
irix-*) ;;
dgux-*) ;;
hp-ux-*) ;;
sco*) ;;
*) echo 'ranlib "$main"' ;;
esac
socklog-2.1.1+repack/src/fmt.h 0000644 0000000 0000000 00000002124 14702065454 014647 0 ustar root root /* Public domain. */
#ifndef FMT_H
#define FMT_H
#define FMT_ULONG 40 /* enough space to hold 2^128 - 1 in decimal, plus \0 */
#define FMT_LEN ((char *) 0) /* convenient abbreviation */
extern unsigned int fmt_uint(char *,unsigned int);
extern unsigned int fmt_uint0(char *,unsigned int,unsigned int);
extern unsigned int fmt_xint(char *,unsigned int);
extern unsigned int fmt_nbbint(char *,unsigned int,unsigned int,unsigned int,unsigned int);
extern unsigned int fmt_ushort(char *,unsigned short);
extern unsigned int fmt_xshort(char *,unsigned short);
extern unsigned int fmt_nbbshort(char *,unsigned int,unsigned int,unsigned int,unsigned short);
extern unsigned int fmt_ulong(char *,unsigned long);
extern unsigned int fmt_xlong(char *,unsigned long);
extern unsigned int fmt_nbblong(char *,unsigned int,unsigned int,unsigned int,unsigned long);
extern unsigned int fmt_plusminus(char *,int);
extern unsigned int fmt_minus(char *,int);
extern unsigned int fmt_0x(char *,int);
extern unsigned int fmt_str(char *,const char *);
extern unsigned int fmt_strn(char *,const char *,unsigned int);
#endif
socklog-2.1.1+repack/src/strerr_sys.c 0000644 0000000 0000000 00000000332 14702065454 016272 0 ustar root root /* Public domain. */
#include "error.h"
#include "strerr.h"
struct strerr strerr_sys;
void strerr_sysinit(void)
{
strerr_sys.who = 0;
strerr_sys.x = error_str(errno);
strerr_sys.y = "";
strerr_sys.z = "";
}
socklog-2.1.1+repack/src/socklog.check 0000755 0000000 0000000 00000000473 14702065454 016360 0 ustar root root #!/bin/sh
socklog unix socklog.check.socket &
pid=$!
sleep 1
check-socklog-unix
sleep 2
kill -TERM $pid
wait
echo $?
rm -f socklog.check.socket
socklog inet 127.0.0.1 12614 &
pid=$!
sleep 1
check-socklog-inet
sleep 2
kill -TERM $pid
wait
echo $?
( echo foo; echo bar; echo baz ) |env u=U socklog ucspi u
echo $?
socklog-2.1.1+repack/src/tryto.c 0000644 0000000 0000000 00000014263 14702065454 015244 0 ustar root root #include
#include
#include "strerr.h"
#include "pathexec.h"
#include "iopause.h"
#include "taia.h"
#include "wait.h"
#include "sig.h"
#include "coe.h"
#include "ndelay.h"
#include "fd.h"
#include "buffer.h"
#include "error.h"
#include "sgetopt.h"
#include "scan.h"
/* defaults */
#define TIMEOUT 180
#define KTIMEOUT 5
#define TRYMAX 5
#define USAGE " [-vp] [-t seconds] [-k kseconds] [-n tries] prog"
#define WARNING "tryto: warning: "
#define FATAL "tryto: fatal: "
const char *progname;
int selfpipe[2];
int try =0;
void sig_child_handler(void) {
try++;
write(selfpipe[1], "", 1);
}
void usage () {
strerr_die4x(1, "usage: ", progname, USAGE, "\n");
}
int main (int argc, char * const *argv, char * const *envp) {
int opt;
struct taia now, deadline;
iopause_fd x[2];
int pid;
int rc =111;
unsigned long timeout =TIMEOUT;
unsigned long ktimeout =KTIMEOUT;
unsigned long trymax =TRYMAX;
int verbose =0;
char ch;
int processor =0;
unsigned int pgroup =0;
int cpipe[2];
progname =*argv;
while ((opt =getopt(argc,argv,"t:k:n:pPvV")) != opteof) {
switch(opt) {
case 'V':
strerr_warn1("$Id$\n", 0);
case '?':
usage();
case 't':
scan_ulong(optarg, &timeout);
if (timeout <= 0) timeout =TIMEOUT;
break;
case 'k':
scan_ulong(optarg, &ktimeout);
if (ktimeout <= 0) ktimeout =KTIMEOUT;
break;
case 'n':
scan_ulong(optarg, &trymax);
break;
case 'p':
processor =1;
break;
case 'P':
pgroup =1;
break;
case 'v':
verbose =1;
break;
}
}
argv +=optind;
if (!*argv) usage();
/* create selfpipe */
if (pipe(selfpipe) == -1) {
strerr_die2sys(111, FATAL, "unable to create selfpipe: ");
}
coe(selfpipe[0]);
coe(selfpipe[1]);
ndelay_on(selfpipe[0]);
ndelay_on(selfpipe[1]);
ndelay_on(0);
if (processor) ndelay_on(4);
sig_block(sig_pipe);
sig_block(sig_child);
sig_catch(sig_child, sig_child_handler);
/* set timeout */
taia_now(&now);
taia_uint(&deadline, timeout);
taia_add(&deadline, &now, &deadline);
timeout =0;
for (;;) {
int iopausefds;
char buffer_x_space[BUFFER_INSIZE];
buffer buffer_x;
if (processor) {
buffer_init(&buffer_x, buffer_unixread, 4, buffer_x_space,
sizeof buffer_x_space);
} else {
buffer_init(&buffer_x, buffer_unixread, 0, buffer_x_space,
sizeof buffer_x_space);
}
/* start real processor */
if (pipe(cpipe) == -1) {
strerr_die2sys(111, FATAL, "unable to create pipe for child: ");
}
while ((pid =fork()) == -1) {
strerr_warn4(WARNING, "unable to fork for \"", *argv, "\" pausing: ",
&strerr_sys);
sleep(5);
}
if (!pid) {
/* child */
sig_unblock(sig_pipe);
sig_unblock(sig_child);
sig_uncatch(sig_child);
close(cpipe[1]);
fd_move(0, cpipe[0]);
if (processor) {
fd_move(2, 5);
close(4);
}
if (pgroup) setsid();
pathexec_run(*argv, argv, envp);
strerr_die2sys(111, FATAL, "unable to start child: ");
}
close(cpipe[0]);
x[0].fd =selfpipe[0];
x[0].events =IOPAUSE_READ;
if (processor) {
fd_move(2, 5);
x[1].fd =4;
} else {
x[1].fd =0;
}
x[1].events =IOPAUSE_READ;
iopausefds =2;
/* feed + watch child */
for (;;) {
int r;
int i;
char *s;
sig_unblock(sig_child);
iopause(x, iopausefds, &deadline, &now);
sig_block(sig_child);
while (read(selfpipe[0], &ch, 1) == 1) {}
taia_now(&now);
if ((timeout =taia_less(&deadline, &now))) break;
if (wait_nohang(&rc) == pid) break;
rc =111;
r = buffer_feed(&buffer_x);
if (r < 0) {
if ((errno == error_intr) || (errno == error_again)) continue;
}
if (r == 0) {
if (processor && (buffer_x.fd == 4)) {
x[1].fd =0;
buffer_init(&buffer_x, buffer_unixread, 0, buffer_x_space,
sizeof buffer_x_space);
continue;
}
if (iopausefds == 2) {
close(cpipe[1]);
iopausefds =1;
}
continue;
}
s =buffer_peek(&buffer_x);
i =write(cpipe[1], s, r);
if (i == -1) strerr_die2sys(111, FATAL, "unable to write to child: ");
if (i < r)
strerr_die2x(111, FATAL, "unable to write to child: partial write");
buffer_seek(&buffer_x, r);
}
close(cpipe[1]);
if (timeout) {
if (wait_nohang(&rc) == pid) break;
/* child not finished */
strerr_warn4(WARNING,
"child \"", *argv, "\" timed out. sending TERM...", 0);
kill(pgroup ? -pid : pid, SIGTERM);
/* ktimeout sec timeout */
taia_now(&now);
taia_uint(&deadline, ktimeout);
taia_add(&deadline, &now, &deadline);
ktimeout =0;
for (;;) {
sig_unblock(sig_child);
iopause(x, 1, &deadline, &now);
sig_block(sig_child);
while (read(selfpipe[0], &ch, 1) == 1) {}
if (wait_nohang(&rc) == pid) {
strerr_warn2(WARNING, "child terminated.", 0);
break;
}
rc =111;
taia_now(&now);
if ((ktimeout =taia_less(&deadline, &now))) break;
}
if (ktimeout) {
strerr_warn4(WARNING, "child \"", *argv,
"\" not terminated. sending KILL...", 0);
kill(pgroup ? -pid : pid, SIGKILL);
}
break;
}
if (rc == 0) break;
if (verbose) strerr_warn2(WARNING, "child crashed.", 0);
if (lseek(0, 0, SEEK_SET) != 0)
if (verbose) strerr_warn2(WARNING,
"unable to lseek fd 0: ", &strerr_sys);
if (try >= trymax) break;
sleep(1);
}
if (processor && (rc != 0)) {
for (;;) {
int r;
char *s;
r = buffer_feed(buffer_0);
if (r < 0) {
if ((errno == error_intr) || (errno == error_again)) continue;
}
if (r == 0) {
break;
}
s =buffer_peek(buffer_0);
buffer_putflush(buffer_1, s, r);
buffer_seek(buffer_0, r);
}
}
if (timeout) {
if (processor) strerr_die2x(0, FATAL, "child timed out, giving up.");
strerr_die2x(100, FATAL, "child timed out, giving up.");
}
if (try >= trymax) {
if (processor) strerr_die2x(0, FATAL, "child crashed, giving up.");
strerr_die2x(rc >> 8, FATAL, "child crashed, giving up.");
}
_exit(0);
}
socklog-2.1.1+repack/src/env.c 0000644 0000000 0000000 00000000472 14702065454 014650 0 ustar root root /* Public domain. */
#include "str.h"
#include "env.h"
extern /*@null@*/char *env_get(const char *s)
{
int i;
unsigned int len;
if (!s) return 0;
len = str_len(s);
for (i = 0;environ[i];++i)
if (str_start(environ[i],s) && (environ[i][len] == '='))
return environ[i] + len + 1;
return 0;
}
socklog-2.1.1+repack/src/subgetopt.c 0000644 0000000 0000000 00000002605 14702065454 016074 0 ustar root root /* Public domain. */
#define SUBGETOPTNOSHORT
#include "subgetopt.h"
#define sgopt subgetopt
#define optind subgetoptind
#define optpos subgetoptpos
#define optarg subgetoptarg
#define optproblem subgetoptproblem
#define optdone subgetoptdone
int optind = 1;
int optpos = 0;
const char *optarg = 0;
int optproblem = 0;
int optdone = SUBGETOPTDONE;
int sgopt(int argc,char *const *argv,const char *opts)
{
int c;
const char *s;
optarg = 0;
if (!argv || (optind >= argc) || !argv[optind]) return optdone;
if (optpos && !argv[optind][optpos]) {
++optind;
optpos = 0;
if ((optind >= argc) || !argv[optind]) return optdone;
}
if (!optpos) {
if (argv[optind][0] != '-') return optdone;
++optpos;
c = argv[optind][1];
if ((c == '-') || (c == 0)) {
if (c) ++optind;
optpos = 0;
return optdone;
}
/* otherwise c is reassigned below */
}
c = argv[optind][optpos];
++optpos;
s = opts;
while (*s) {
if (c == *s) {
if (s[1] == ':') {
optarg = argv[optind] + optpos;
++optind;
optpos = 0;
if (!*optarg) {
optarg = argv[optind];
if ((optind >= argc) || !optarg) { /* argument past end */
optproblem = c;
return '?';
}
++optind;
}
}
return c;
}
++s;
if (*s == ':') ++s;
}
optproblem = c;
return '?';
}
socklog-2.1.1+repack/src/uncat.c 0000644 0000000 0000000 00000007645 14702065454 015203 0 ustar root root #include
#include "strerr.h"
#include "error.h"
#include "sgetopt.h"
#include "scan.h"
#include "stralloc.h"
#include "buffer.h"
#include "pathexec.h"
#include "fd.h"
#include "wait.h"
#include "taia.h"
#include "iopause.h"
#include "ndelay.h"
#include "sig.h"
/* defaults */
#define TIMEOUT 300
#define SIZEMAX 1024
#define USAGE " [-vo] [-t timeout] [-s size] prog"
#define WARNING "uncat: warning: "
#define FATAL "uncat: fatal: "
const char *progname;
int exitasap =0;
void exit_asap() {
exitasap =1;
}
void usage () {
strerr_die4x(1, "usage: ", progname, USAGE, "\n");
}
int main (int argc, char * const *argv, char * const *envp) {
int opt;
unsigned long timeout =TIMEOUT;
unsigned long sizemax =SIZEMAX;
int verbose =0;
int once =0;
static stralloc sa;
int eof =0;
progname =*argv;
sig_block(sig_term);
sig_catch(sig_term, exit_asap);
while ((opt =getopt(argc, argv, "t:s:voV")) != opteof) {
switch(opt) {
case 'V':
strerr_warn1("$Id$\n", 0);
case '?':
usage();
case 't':
scan_ulong(optarg, &timeout);
if (timeout <= 0) timeout =TIMEOUT;
break;
case 's':
scan_ulong(optarg, &sizemax);
if (sizemax <= 0) sizemax =SIZEMAX;
break;
case 'v':
verbose =1;
break;
case 'o':
once =1;
break;
}
}
argv +=optind;
if (!*argv) usage();
if (verbose) strerr_warn2(WARNING, "starting.", 0);
ndelay_on(0);
for (;;) {
struct taia now, deadline;
int cpipe[2];
int pid;
int wstat;
stralloc_copys(&sa, "");
/* set timeout */
taia_now(&now);
taia_uint(&deadline, timeout);
taia_add(&deadline, &now, &deadline);
/* read fd 0, stop at maxsize bytes or timeout */
for (;;) {
int r;
char *s;
iopause_fd iofd;
taia_now(&now);
if (taia_less(&deadline, &now)) {
if (verbose && sa.len) strerr_warn2(WARNING, "timeout reached.", 0);
break;
}
iofd.fd =0;
iofd.events =IOPAUSE_READ;
sig_unblock(sig_term);
iopause(&iofd, 1, &deadline, &now);
sig_block(sig_term);
if (exitasap) {
if (verbose) strerr_warn2(WARNING, "got sigterm.", 0);
break;
}
r =buffer_feed(buffer_0);
if (r < 0) {
if (errno == error_again) continue;
strerr_die2sys(111, FATAL, "unable to read fd 0: ");
}
if (r == 0) {
if (verbose) strerr_warn2(WARNING, "end of input.", 0);
if (! once) continue;
eof++;
break;
}
if (r >= sizemax) r =sizemax;
if ((sa.len +r) > sizemax) {
if (verbose) strerr_warn2(WARNING, "max size reached.", 0);
break;
}
s =buffer_peek(buffer_0);
if (! stralloc_catb(&sa, s, r)) {
strerr_die2sys(111, FATAL, "out of memory: ");
}
buffer_seek(buffer_0, r);
}
if (sa.len) {
/* run prog to process sa.s */
if (pipe(cpipe) == -1) {
strerr_die2sys(111, FATAL, "unable to create pipe for child: ");
}
while ((pid =fork()) == -1) {
strerr_warn4(WARNING, "unable to fork for \"", *argv, "\" pausing: ",
&strerr_sys);
sleep(5);
}
if (!pid) {
/* child */
sig_uncatch(sig_term);
sig_unblock(sig_term);
close(cpipe[1]);
fd_move(0, cpipe[0]);
fd_copy(1, 2);
if (verbose) strerr_warn2(WARNING, "starting child.", 0);
pathexec_run(*argv, argv, envp);
strerr_die2sys(111, FATAL, "unable to start child: ");
}
close(cpipe[0]);
if (write(cpipe[1], sa.s, sa.len) < sa.len) {
strerr_warn2(WARNING, "unable to write to child: ", &strerr_sys);
}
close(cpipe[1]);
if (wait_pid(&wstat, pid) != pid) {
strerr_die2sys(111, FATAL, "wait_pid: ");
}
if (wait_crashed(wstat)) {
strerr_warn2(WARNING, "child crashed.", 0);
} else {
if (verbose) strerr_warn2(WARNING, "child exited.", 0);
}
}
if (exitasap || eof) break;
}
if (verbose) strerr_warn2(WARNING, "exit.", 0);
_exit(0);
}
socklog-2.1.1+repack/src/socklog-check.dist 0000644 0000000 0000000 00000000407 14702065454 017313 0 ustar root root $Id$
usage: socklog-check [-v] [unix [address]]
1
listening on socklog.check.socket, starting.
0
socklog-check: info: successfully connected to socklog.check.socket
0
socklog-check: warning: unable to connect socket: socklog.check.socket: connection refused
111
socklog-2.1.1+repack/src/tai_now.c 0000644 0000000 0000000 00000000174 14702065454 015517 0 ustar root root /* Public domain. */
#include
#include "tai.h"
void tai_now(struct tai *t)
{
tai_unix(t,time((time_t *) 0));
}
socklog-2.1.1+repack/src/tai_unpack.c 0000644 0000000 0000000 00000000630 14702065454 016172 0 ustar root root /* Public domain. */
#include "tai.h"
void tai_unpack(const char *s,struct tai *t)
{
uint64 x;
x = (unsigned char) s[0];
x <<= 8; x += (unsigned char) s[1];
x <<= 8; x += (unsigned char) s[2];
x <<= 8; x += (unsigned char) s[3];
x <<= 8; x += (unsigned char) s[4];
x <<= 8; x += (unsigned char) s[5];
x <<= 8; x += (unsigned char) s[6];
x <<= 8; x += (unsigned char) s[7];
t->x = x;
}
socklog-2.1.1+repack/src/uint64.h1 0000644 0000000 0000000 00000000174 14702065454 015276 0 ustar root root /* Public domain. */
#ifndef UINT64_H
#define UINT64_H
/* sysdep: -ulong64 */
typedef unsigned long long uint64;
#endif
socklog-2.1.1+repack/src/conf-cc 0000644 0000000 0000000 00000000261 14702065454 015143 0 ustar root root gcc -O2 -Wall
gcc -O2 -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings
This will be used to compile .c files.
socklog-2.1.1+repack/src/taia_sub.c 0000644 0000000 0000000 00000000716 14702065454 015650 0 ustar root root /* Public domain. */
#include "taia.h"
/* XXX: breaks tai encapsulation */
void taia_sub(struct taia *t,const struct taia *u,const struct taia *v)
{
unsigned long unano = u->nano;
unsigned long uatto = u->atto;
t->sec.x = u->sec.x - v->sec.x;
t->nano = unano - v->nano;
t->atto = uatto - v->atto;
if (t->atto > uatto) {
t->atto += 1000000000UL;
--t->nano;
}
if (t->nano > unano) {
t->nano += 1000000000UL;
--t->sec.x;
}
}
socklog-2.1.1+repack/src/strerr.h 0000644 0000000 0000000 00000005322 14702065454 015405 0 ustar root root /* Public domain. */
#ifndef STRERR_H
#define STRERR_H
struct strerr {
struct strerr *who;
const char *x;
const char *y;
const char *z;
} ;
extern struct strerr strerr_sys;
extern void strerr_sysinit(void);
extern const char *strerr(const struct strerr *);
extern void strerr_warn(const char *,const char *,const char *,const char *,const char *,const char *,const struct strerr *);
extern void strerr_die(int,const char *,const char *,const char *,const char *,const char *,const char *,const struct strerr *);
#define STRERR(r,se,a) \
{ se.who = 0; se.x = a; se.y = 0; se.z = 0; return r; }
#define STRERR_SYS(r,se,a) \
{ se.who = &strerr_sys; se.x = a; se.y = 0; se.z = 0; return r; }
#define STRERR_SYS3(r,se,a,b,c) \
{ se.who = &strerr_sys; se.x = a; se.y = b; se.z = c; return r; }
#define strerr_warn6(x1,x2,x3,x4,x5,x6,se) \
strerr_warn((x1),(x2),(x3),(x4),(x5),(x6),(se))
#define strerr_warn5(x1,x2,x3,x4,x5,se) \
strerr_warn((x1),(x2),(x3),(x4),(x5),0,(se))
#define strerr_warn4(x1,x2,x3,x4,se) \
strerr_warn((x1),(x2),(x3),(x4),0,0,(se))
#define strerr_warn3(x1,x2,x3,se) \
strerr_warn((x1),(x2),(x3),0,0,0,(se))
#define strerr_warn2(x1,x2,se) \
strerr_warn((x1),(x2),0,0,0,0,(se))
#define strerr_warn1(x1,se) \
strerr_warn((x1),0,0,0,0,0,(se))
#define strerr_die6(e,x1,x2,x3,x4,x5,x6,se) \
strerr_die((e),(x1),(x2),(x3),(x4),(x5),(x6),(se))
#define strerr_die5(e,x1,x2,x3,x4,x5,se) \
strerr_die((e),(x1),(x2),(x3),(x4),(x5),0,(se))
#define strerr_die4(e,x1,x2,x3,x4,se) \
strerr_die((e),(x1),(x2),(x3),(x4),0,0,(se))
#define strerr_die3(e,x1,x2,x3,se) \
strerr_die((e),(x1),(x2),(x3),0,0,0,(se))
#define strerr_die2(e,x1,x2,se) \
strerr_die((e),(x1),(x2),0,0,0,0,(se))
#define strerr_die1(e,x1,se) \
strerr_die((e),(x1),0,0,0,0,0,(se))
#define strerr_die6sys(e,x1,x2,x3,x4,x5,x6) \
strerr_die((e),(x1),(x2),(x3),(x4),(x5),(x6),&strerr_sys)
#define strerr_die5sys(e,x1,x2,x3,x4,x5) \
strerr_die((e),(x1),(x2),(x3),(x4),(x5),0,&strerr_sys)
#define strerr_die4sys(e,x1,x2,x3,x4) \
strerr_die((e),(x1),(x2),(x3),(x4),0,0,&strerr_sys)
#define strerr_die3sys(e,x1,x2,x3) \
strerr_die((e),(x1),(x2),(x3),0,0,0,&strerr_sys)
#define strerr_die2sys(e,x1,x2) \
strerr_die((e),(x1),(x2),0,0,0,0,&strerr_sys)
#define strerr_die1sys(e,x1) \
strerr_die((e),(x1),0,0,0,0,0,&strerr_sys)
#define strerr_die6x(e,x1,x2,x3,x4,x5,x6) \
strerr_die((e),(x1),(x2),(x3),(x4),(x5),(x6),0)
#define strerr_die5x(e,x1,x2,x3,x4,x5) \
strerr_die((e),(x1),(x2),(x3),(x4),(x5),0,0)
#define strerr_die4x(e,x1,x2,x3,x4) \
strerr_die((e),(x1),(x2),(x3),(x4),0,0,0)
#define strerr_die3x(e,x1,x2,x3) \
strerr_die((e),(x1),(x2),(x3),0,0,0,0)
#define strerr_die2x(e,x1,x2) \
strerr_die((e),(x1),(x2),0,0,0,0,0)
#define strerr_die1x(e,x1) \
strerr_die((e),(x1),0,0,0,0,0,0)
#endif
socklog-2.1.1+repack/src/lock_exnb.c 0000644 0000000 0000000 00000000412 14702065454 016016 0 ustar root root /* Public domain. */
#include
#include
#include
#include "hasflock.h"
#include "lock.h"
#ifdef HASFLOCK
int lock_exnb(int fd) { return flock(fd,LOCK_EX | LOCK_NB); }
#else
int lock_exnb(int fd) { return lockf(fd,2,0); }
#endif
socklog-2.1.1+repack/src/str.h 0000644 0000000 0000000 00000000704 14702065454 014673 0 ustar root root /* Public domain. */
#ifndef STR_H
#define STR_H
extern unsigned int str_copy(char *,const char *);
extern int str_diff(const char *,const char *);
extern int str_diffn(const char *,const char *,unsigned int);
extern unsigned int str_len(const char *);
extern unsigned int str_chr(const char *,int);
extern unsigned int str_rchr(const char *,int);
extern int str_start(const char *,const char *);
#define str_equal(s,t) (!str_diff((s),(t)))
#endif
socklog-2.1.1+repack/src/error.c 0000644 0000000 0000000 00000002321 14702065454 015204 0 ustar root root /* Public domain. */
#include
#include "error.h"
/* warning: as coverage improves here, should update error_{str,temp} */
int error_intr =
#ifdef EINTR
EINTR;
#else
-1;
#endif
int error_nomem =
#ifdef ENOMEM
ENOMEM;
#else
-2;
#endif
int error_noent =
#ifdef ENOENT
ENOENT;
#else
-3;
#endif
int error_txtbsy =
#ifdef ETXTBSY
ETXTBSY;
#else
-4;
#endif
int error_io =
#ifdef EIO
EIO;
#else
-5;
#endif
int error_exist =
#ifdef EEXIST
EEXIST;
#else
-6;
#endif
int error_timeout =
#ifdef ETIMEDOUT
ETIMEDOUT;
#else
-7;
#endif
int error_inprogress =
#ifdef EINPROGRESS
EINPROGRESS;
#else
-8;
#endif
int error_wouldblock =
#ifdef EWOULDBLOCK
EWOULDBLOCK;
#else
-9;
#endif
int error_again =
#ifdef EAGAIN
EAGAIN;
#else
-10;
#endif
int error_pipe =
#ifdef EPIPE
EPIPE;
#else
-11;
#endif
int error_perm =
#ifdef EPERM
EPERM;
#else
-12;
#endif
int error_acces =
#ifdef EACCES
EACCES;
#else
-13;
#endif
int error_nodevice =
#ifdef ENXIO
ENXIO;
#else
-14;
#endif
int error_proto =
#ifdef EPROTO
EPROTO;
#else
-15;
#endif
int error_isdir =
#ifdef EISDIR
EISDIR;
#else
-16;
#endif
int error_connrefused =
#ifdef ECONNREFUSED
ECONNREFUSED;
#else
-17;
#endif
int error_notdir =
#ifdef ENOTDIR
ENOTDIR;
#else
-18;
#endif
socklog-2.1.1+repack/src/str_start.c 0000644 0000000 0000000 00000000562 14702065454 016105 0 ustar root root /* Public domain. */
#include "str.h"
int str_start(register const char *s,register const char *t)
{
register char x;
for (;;) {
x = *t++; if (!x) return 1; if (x != *s++) return 0;
x = *t++; if (!x) return 1; if (x != *s++) return 0;
x = *t++; if (!x) return 1; if (x != *s++) return 0;
x = *t++; if (!x) return 1; if (x != *s++) return 0;
}
}
socklog-2.1.1+repack/src/trysgact.c 0000644 0000000 0000000 00000000300 14702065454 015706 0 ustar root root /* Public domain. */
#include
int main()
{
struct sigaction sa;
sa.sa_handler = 0;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
sigaction(0,&sa,(struct sigaction *) 0);
}
socklog-2.1.1+repack/src/fmt_uint.c 0000644 0000000 0000000 00000000205 14702065454 015677 0 ustar root root /* Public domain. */
#include "fmt.h"
unsigned int fmt_uint(register char *s,register unsigned int u)
{
return fmt_ulong(s,u);
}
socklog-2.1.1+repack/src/hasflock.h2 0000644 0000000 0000000 00000000076 14702065454 015741 0 ustar root root /* Public domain. */
/* sysdep: +flock */
#define HASFLOCK 1
socklog-2.1.1+repack/src/readclose.h 0000644 0000000 0000000 00000000313 14702065454 016020 0 ustar root root /* Public domain. */
#ifndef READCLOSE_H
#define READCLOSE_H
#include "stralloc.h"
extern int readclose_append(int,stralloc *,unsigned int);
extern int readclose(int,stralloc *,unsigned int);
#endif
socklog-2.1.1+repack/src/tryulong64.c 0000644 0000000 0000000 00000000576 14702065454 016122 0 ustar root root /* Public domain. */
#include
int main()
{
unsigned long u;
u = 1;
u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
if (!u) _exit(1);
_exit(0);
}
socklog-2.1.1+repack/src/buffer_2.c 0000644 0000000 0000000 00000000266 14702065454 015553 0 ustar root root /* Public domain. */
#include "buffer.h"
char buffer_2_space[256];
static buffer it = BUFFER_INIT(buffer_unixwrite,2,buffer_2_space,sizeof buffer_2_space);
buffer *buffer_2 = ⁢
socklog-2.1.1+repack/src/check-dist 0000755 0000000 0000000 00000000265 14702065454 015660 0 ustar root root #!/bin/sh
PATH=`pwd`:$PATH
for i in `cat ../package/commands`; do
echo "Creating new $i.dist..."
env - PATH="$PATH" ctmp="`pwd`/check-tmp" $i.check 2>&1 |cat -v >$i.dist
done
socklog-2.1.1+repack/src/tryto.dist 0000644 0000000 0000000 00000001032 14702065454 015753 0 ustar root root usage: tryto [-vp] [-t seconds] [-k kseconds] [-n tries] prog
1
$Id$
usage: tryto [-vp] [-t seconds] [-k kseconds] [-n tries] prog
1
0
tryto: warning: child crashed.
tryto: warning: child crashed.
tryto: fatal: child crashed, giving up.
1
tryto: warning: child "sleep" timed out. sending TERM...
tryto: warning: child terminated.
tryto: fatal: child timed out, giving up.
100
tryto: warning: child "sh" timed out. sending TERM...
tryto: warning: child "sh" not terminated. sending KILL...
tryto: fatal: child timed out, giving up.
100
socklog-2.1.1+repack/src/coe.h 0000644 0000000 0000000 00000000120 14702065454 014621 0 ustar root root /* Public domain. */
#ifndef COE_H
#define COE_H
extern int coe(int);
#endif
socklog-2.1.1+repack/src/tai.h 0000644 0000000 0000000 00000001162 14702065454 014637 0 ustar root root /* Public domain. */
#ifndef TAI_H
#define TAI_H
#include "uint64.h"
struct tai {
uint64 x;
} ;
#define tai_unix(t,u) ((void) ((t)->x = 4611686018427387914ULL + (uint64) (u)))
extern void tai_now(struct tai *);
#define tai_approx(t) ((double) ((t)->x))
extern void tai_add(struct tai *,const struct tai *,const struct tai *);
extern void tai_sub(struct tai *,const struct tai *,const struct tai *);
#define tai_less(t,u) ((t)->x < (u)->x)
#define TAI_PACK 8
extern void tai_pack(char *,const struct tai *);
extern void tai_unpack(const char *,struct tai *);
extern void tai_uint(struct tai *,unsigned int);
#endif
socklog-2.1.1+repack/src/stralloc.h 0000644 0000000 0000000 00000002227 14702065454 015710 0 ustar root root /* Public domain. */
#ifndef STRALLOC_H
#define STRALLOC_H
#include "gen_alloc.h"
GEN_ALLOC_typedef(stralloc,char,s,len,a)
extern int stralloc_ready(stralloc *,unsigned int);
extern int stralloc_readyplus(stralloc *,unsigned int);
extern int stralloc_copy(stralloc *,const stralloc *);
extern int stralloc_cat(stralloc *,const stralloc *);
extern int stralloc_copys(stralloc *,const char *);
extern int stralloc_cats(stralloc *,const char *);
extern int stralloc_copyb(stralloc *,const char *,unsigned int);
extern int stralloc_catb(stralloc *,const char *,unsigned int);
extern int stralloc_append(stralloc *,const char *); /* beware: this takes a pointer to 1 char */
extern int stralloc_starts(stralloc *,const char *);
#define stralloc_0(sa) stralloc_append(sa,"")
extern int stralloc_catulong0(stralloc *,unsigned long,unsigned int);
extern int stralloc_catlong0(stralloc *,long,unsigned int);
#define stralloc_catlong(sa,l) (stralloc_catlong0((sa),(l),0))
#define stralloc_catuint0(sa,i,n) (stralloc_catulong0((sa),(i),(n)))
#define stralloc_catint0(sa,i,n) (stralloc_catlong0((sa),(i),(n)))
#define stralloc_catint(sa,i) (stralloc_catlong0((sa),(i),0))
#endif
socklog-2.1.1+repack/src/env.h 0000644 0000000 0000000 00000000201 14702065454 014643 0 ustar root root /* Public domain. */
#ifndef ENV_H
#define ENV_H
extern char **environ;
extern /*@null@*/char *env_get(const char *);
#endif
socklog-2.1.1+repack/src/trydrent.c 0000644 0000000 0000000 00000000161 14702065454 015726 0 ustar root root /* Public domain. */
#include
#include
void foo()
{
DIR *dir;
struct dirent *d;
}
socklog-2.1.1+repack/src/open_append.c 0000644 0000000 0000000 00000000266 14702065454 016351 0 ustar root root /* Public domain. */
#include
#include
#include "open.h"
int open_append(const char *fn)
{ return open(fn,O_WRONLY | O_NDELAY | O_APPEND | O_CREAT,0600); }
socklog-2.1.1+repack/src/sgetopt.c 0000644 0000000 0000000 00000002417 14702065454 015546 0 ustar root root /* Public domain. */
/* sgetopt.c, sgetopt.h: (yet another) improved getopt clone, outer layer
D. J. Bernstein, djb@pobox.com.
Depends on subgetopt.h, buffer.h.
No system requirements.
19991219: Switched to buffer.h.
19970208: Cleanups.
931201: Baseline.
No known patent problems.
Documentation in sgetopt.3.
*/
#include "buffer.h"
#define SGETOPTNOSHORT
#include "sgetopt.h"
#define SUBGETOPTNOSHORT
#include "subgetopt.h"
#define getopt sgetoptmine
#define optind subgetoptind
#define opterr sgetopterr
#define optproblem subgetoptproblem
#define optprogname sgetoptprogname
int opterr = 1;
const char *optprogname = 0;
int getopt(int argc,char *const *argv,const char *opts)
{
int c;
const char *s;
if (!optprogname) {
optprogname = *argv;
if (!optprogname) optprogname = "";
for (s = optprogname;*s;++s) if (*s == '/') optprogname = s + 1;
}
c = subgetopt(argc,argv,opts);
if (opterr)
if (c == '?') {
char chp[2]; chp[0] = optproblem; chp[1] = '\n';
buffer_puts(buffer_2,optprogname);
if (argv[optind] && (optind < argc))
buffer_puts(buffer_2,": illegal option -- ");
else
buffer_puts(buffer_2,": option requires an argument -- ");
buffer_put(buffer_2,chp,2);
buffer_flush(buffer_2);
}
return c;
}
socklog-2.1.1+repack/src/error.h 0000644 0000000 0000000 00000001251 14702065454 015212 0 ustar root root /* Public domain. */
#ifndef ERROR_H
#define ERROR_H
/* 20030126: include -upcoming glibc changes */
#include
/* extern int errno; */
extern int error_intr;
extern int error_nomem;
extern int error_noent;
extern int error_txtbsy;
extern int error_io;
extern int error_exist;
extern int error_timeout;
extern int error_inprogress;
extern int error_wouldblock;
extern int error_again;
extern int error_pipe;
extern int error_perm;
extern int error_acces;
extern int error_nodevice;
extern int error_proto;
extern int error_isdir;
extern int error_connrefused;
extern int error_notdir;
extern const char *error_str(int);
extern int error_temp(int);
#endif
socklog-2.1.1+repack/src/hassgprm.h2 0000644 0000000 0000000 00000000112 14702065454 015762 0 ustar root root /* Public domain. */
/* sysdep: +sigprocmask */
#define HASSIGPROCMASK 1
socklog-2.1.1+repack/src/str_diff.c 0000644 0000000 0000000 00000000723 14702065454 015657 0 ustar root root /* Public domain. */
#include "str.h"
int str_diff(register const char *s,register const char *t)
{
register char x;
for (;;) {
x = *s; if (x != *t) break; if (!x) break; ++s; ++t;
x = *s; if (x != *t) break; if (!x) break; ++s; ++t;
x = *s; if (x != *t) break; if (!x) break; ++s; ++t;
x = *s; if (x != *t) break; if (!x) break; ++s; ++t;
}
return ((int)(unsigned int)(unsigned char) x)
- ((int)(unsigned int)(unsigned char) *t);
}
socklog-2.1.1+repack/src/sig_catch.c 0000644 0000000 0000000 00000000553 14702065454 016004 0 ustar root root /* Public domain. */
#include
#include "sig.h"
#include "hassgact.h"
void sig_catch(int sig,void (*f)())
{
#ifdef HASSIGACTION
struct sigaction sa;
sa.sa_handler = f;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
sigaction(sig,&sa,(struct sigaction *) 0);
#else
signal(sig,f); /* won't work under System V, even nowadays---dorks */
#endif
}
socklog-2.1.1+repack/src/stralloc_opyb.c 0000644 0000000 0000000 00000000421 14702065454 016726 0 ustar root root /* Public domain. */
#include "stralloc.h"
#include "byte.h"
int stralloc_copyb(stralloc *sa,const char *s,unsigned int n)
{
if (!stralloc_ready(sa,n + 1)) return 0;
byte_copy(sa->s,n,s);
sa->len = n;
sa->s[n] = 'Z'; /* ``offensive programming'' */
return 1;
}
socklog-2.1.1+repack/src/uint64.h2 0000644 0000000 0000000 00000000167 14702065454 015301 0 ustar root root /* Public domain. */
#ifndef UINT64_H
#define UINT64_H
/* sysdep: +ulong64 */
typedef unsigned long uint64;
#endif
socklog-2.1.1+repack/src/open_write.c 0000644 0000000 0000000 00000000233 14702065454 016226 0 ustar root root /* Public domain. */
#include
#include
#include "open.h"
int open_write(const char *fn)
{ return open(fn,O_WRONLY | O_NDELAY); }
socklog-2.1.1+repack/src/direntry.h1 0000644 0000000 0000000 00000000247 14702065454 016006 0 ustar root root /* Public domain. */
#ifndef DIRENTRY_H
#define DIRENTRY_H
/* sysdep: -dirent */
#include
#include
#define direntry struct direct
#endif
socklog-2.1.1+repack/src/pathexec.h 0000644 0000000 0000000 00000000345 14702065454 015665 0 ustar root root /* Public domain. */
#ifndef PATHEXEC_H
#define PATHEXEC_H
extern void pathexec_run(const char *,char * const *,char * const *);
extern int pathexec_env(const char *,const char *);
extern void pathexec(char * const *);
#endif
socklog-2.1.1+repack/src/sig.c 0000644 0000000 0000000 00000000465 14702065454 014644 0 ustar root root /* Public domain. */
#include
#include "sig.h"
int sig_alarm = SIGALRM;
int sig_child = SIGCHLD;
int sig_cont = SIGCONT;
int sig_hangup = SIGHUP;
int sig_int = SIGINT;
int sig_pipe = SIGPIPE;
int sig_term = SIGTERM;
void (*sig_defaulthandler)() = SIG_DFL;
void (*sig_ignorehandler)() = SIG_IGN;
socklog-2.1.1+repack/src/iopause.h2 0000644 0000000 0000000 00000000523 14702065454 015611 0 ustar root root /* Public domain. */
#ifndef IOPAUSE_H
#define IOPAUSE_H
/* sysdep: +poll */
#define IOPAUSE_POLL
#include
#include
typedef struct pollfd iopause_fd;
#define IOPAUSE_READ POLLIN
#define IOPAUSE_WRITE POLLOUT
#include "taia.h"
extern void iopause(iopause_fd *,unsigned int,struct taia *,struct taia *);
#endif
socklog-2.1.1+repack/src/buffer_1.c 0000644 0000000 0000000 00000000301 14702065454 015540 0 ustar root root /* Public domain. */
#include "buffer.h"
char buffer_1_space[BUFFER_OUTSIZE];
static buffer it = BUFFER_INIT(buffer_unixwrite,1,buffer_1_space,sizeof buffer_1_space);
buffer *buffer_1 = ⁢
socklog-2.1.1+repack/src/coe.c 0000644 0000000 0000000 00000000155 14702065454 014624 0 ustar root root /* Public domain. */
#include
#include "coe.h"
int coe(int fd)
{
return fcntl(fd,F_SETFD,1);
}
socklog-2.1.1+repack/src/x86cpuid.c 0000644 0000000 0000000 00000001320 14702065454 015523 0 ustar root root /* Public domain. */
#include
#include
#include
void nope()
{
exit(1);
}
int main()
{
unsigned long x[4];
unsigned long y[4];
int i;
int j;
char c;
signal(SIGILL,nope);
x[0] = y[0] = 0;
x[1] = y[1] = 0;
x[2] = y[2] = 0;
x[3] = y[3] = 0;
asm volatile(".byte 15;.byte 162" : "=a"(x[0]),"=b"(x[1]),"=c"(x[3]),"=d"(x[2]) : "0"(0) );
if (!x[0]) return 0;
asm volatile(".byte 15;.byte 162" : "=a"(y[0]),"=b"(y[1]),"=c"(y[2]),"=d"(y[3]) : "0"(1) );
for (i = 1;i < 4;++i)
for (j = 0;j < 4;++j) {
c = x[i] >> (8 * j);
if (c < 32) c = 32;
if (c > 126) c = 126;
putchar(c);
}
printf("-%08lx-%08lx\n",y[0],y[3]);
return 0;
}
socklog-2.1.1+repack/src/byte_copy.c 0000644 0000000 0000000 00000000501 14702065454 016046 0 ustar root root /* Public domain. */
#include "byte.h"
void byte_copy(to,n,from)
register char *to;
register unsigned int n;
register char *from;
{
for (;;) {
if (!n) return; *to++ = *from++; --n;
if (!n) return; *to++ = *from++; --n;
if (!n) return; *to++ = *from++; --n;
if (!n) return; *to++ = *from++; --n;
}
}
socklog-2.1.1+repack/src/stralloc_cats.c 0000644 0000000 0000000 00000000253 14702065454 016712 0 ustar root root /* Public domain. */
#include "byte.h"
#include "str.h"
#include "stralloc.h"
int stralloc_cats(stralloc *sa,const char *s)
{
return stralloc_catb(sa,s,str_len(s));
}
socklog-2.1.1+repack/src/sig.h 0000644 0000000 0000000 00000001113 14702065454 014640 0 ustar root root /* Public domain. */
#ifndef SIG_H
#define SIG_H
extern int sig_alarm;
extern int sig_child;
extern int sig_cont;
extern int sig_hangup;
extern int sig_int;
extern int sig_pipe;
extern int sig_term;
extern void (*sig_defaulthandler)();
extern void (*sig_ignorehandler)();
extern void sig_catch(int,void (*)());
#define sig_ignore(s) (sig_catch((s),sig_ignorehandler))
#define sig_uncatch(s) (sig_catch((s),sig_defaulthandler))
extern void sig_block(int);
extern void sig_unblock(int);
extern void sig_blocknone(void);
extern void sig_pause(void);
extern void sig_dfl(int);
#endif
socklog-2.1.1+repack/src/stralloc_eady.c 0000644 0000000 0000000 00000000341 14702065454 016700 0 ustar root root /* Public domain. */
#include "alloc.h"
#include "stralloc.h"
#include "gen_allocdefs.h"
GEN_ALLOC_ready(stralloc,char,s,len,a,i,n,x,30,stralloc_ready)
GEN_ALLOC_readyplus(stralloc,char,s,len,a,i,n,x,30,stralloc_readyplus)
socklog-2.1.1+repack/src/tryto.check 0000755 0000000 0000000 00000000337 14702065454 016077 0 ustar root root #!/bin/sh
exec