Skip to content

Commit

Permalink
updated usage string for logsrv, crcdiff
Browse files Browse the repository at this point in the history
  • Loading branch information
mbhangui committed Sep 5, 2024
1 parent 78a883c commit eabc000
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 75 deletions.
1 change: 1 addition & 0 deletions .github/workflows/indimail-spamfilter-obs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- '**/prepare_obs'
- '**/catChangeLog'
- .github/workflows/indimail-spamfilter-obs.yml
- '!**/obs/*'
- '!**/doc/*'
- '!**.md'
workflow_dispatch:
Expand Down
7 changes: 5 additions & 2 deletions indimail-x/crcdiff.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: crcdiff.c,v $
* Revision 1.5 2024-09-05 19:01:08+05:30 Cprogrammer
* updated usage string
*
* Revision 1.4 2024-07-18 09:17:52+05:30 Cprogrammer
* added -C option to display checksum
*
Expand Down Expand Up @@ -62,13 +65,13 @@
#endif

#ifndef lint
static char sccsid[] = "$Id: crcdiff.c,v 1.4 2024-07-18 09:17:52+05:30 Cprogrammer Exp mbhangui $";
static char sccsid[] = "$Id: crcdiff.c,v 1.5 2024-09-05 19:01:08+05:30 Cprogrammer Exp mbhangui $";
#endif

static void
usage(int exitval)
{
fprintf(stderr, "crcdiff [-s] file1 file2)n");
fprintf(stderr, "crcdiff [-Cs] [-c critical_list] file1 file2)\n");
exit(exitval);
}

Expand Down
64 changes: 29 additions & 35 deletions indimail-x/vsetpass.8
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.\" vim: tw=75
.TH vsetpass 8 "03 Aug 2009" IndiMail "Authentication"
.SH "NAME"
vsetpass \- change passwords from across the network using
Expand All @@ -23,8 +24,8 @@ uses the
.B setpassword
interface for setting the password.
.B setpassword
interface provides a simple, uniform password-setting interface to all root applications. It is suitable for use by
applications such as pop3d, imapd.
interface provides a simple, uniform password-setting interface to all root
applications. It is suitable for use by applications such as pop3d, imapd.

.PP
.I subprogram
Expand All @@ -38,8 +39,9 @@ another 0 byte, the new password, and a final one 0 bytes.
.B vsetpass
invokes
.I subprogram
upon unsuccessful authentication, passing the same data (read earlier on descriptor 3) on a pipe with file descriptor 4
as the write end and file descriptor 3 as the read end.
upon unsuccessful authentication, passing the same data (read earlier on
descriptor 3) on a pipe with file descriptor 4 as the write end and file
descriptor 3 as the read end.
.I subprogram
should read file descriptor 3 and should in turn return 0 to
.BR vsetpass
Expand All @@ -52,47 +54,39 @@ There can be multiple
.I subprograms
for a particular type of authentication / password update. The last
.I subprogram
should typically be /bin/false or /usr/bin/false depending on your Operating System.
should typically be /bin/false or /usr/bin/false depending on your
Operating System.

.PP
.B vsetpass
sleeps 5 seconds after an unsuccessful password
change attempt. This feature is designed to make brute force attacks
against passwords harder to perform.
sleeps 5 seconds after an unsuccessful password change attempt. This
feature is designed to make brute force attacks against passwords harder to
perform.

.SH "LOGGING"
Logging is done to descriptor 2.
.B vsetpass
logs all authentication and password change attempts whether they are successful or not.
logs all authentication and password change attempts whether they are
successful or not.

.SH "EXAMPLE CLIENT-SERVER CONVERSATION"
All messages passed between server and client are text based allowing
a client session to be easily mimicked with telnet. Using telnet,
changing a user's password would look like this:
All messages passed between server and client are text based allowing a
client session to be easily mimicked with tcpclient(1) or telnet(1). Using
tcpclient, changing a user's password would look like this:

Connected to localhost.localdomain (127.0.0.1).
.br
Escape character is '^]'.
.br
200 indimail.org hello, who are you?\\r\\n
.br
user <username>\\r\\n
.br
200 Your password please.\\r\\n
.br
pass <current password>
.br
200 Your new password please.\\r\\n
.br
newpass <new password>\\r\\n
.br
200 Password changed, thank-you.\\r\\n
.br
quit\\r\\n
.br
200 Bye.\\r\\n
.br
Connection closed by foreign host.
.EX
$ tcpclient -n /etc/indimail/certs/clientcert.pem 0 poppassd
200 indimail.org hello, who are you?\\r\\n
user <username>\\r\\n
200 Your password please.\\r\\n
pass <current password>
200 Your new password please.\\r\\n
newpass <new password>\\r\\n
200 Password changed, thank-you.\\r\\n
quit\\r\\n
200 Bye.\\r\\n
Connection closed by foreign host.
.EE

.SH "BUGS"
.PP
Expand Down
18 changes: 8 additions & 10 deletions logalert-x/logsrv.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/*
* $Id: logsrv.c,v 1.25 2024-09-05 19:02:34+05:30 Cprogrammer Exp mbhangui $
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
Expand Down Expand Up @@ -53,21 +56,13 @@
#ifdef HAVE_QMAIL
#include <substdio.h>
#include <subfd.h>
#include <getEnvConfig.h>
#include <tcpbind.h>
#include <sgetopt.h>
#include <stralloc.h>
#include <fmt.h>
#include <strerr.h>
#include <getln.h>
#include <qprintf.h>
#include <timeoutwrite.h>
#include <scan.h>
#include <open.h>
#endif

#ifndef lint
static char sccsid[] = "$Id: logsrv.c,v 1.24 2023-04-14 22:30:46+05:30 Cprogrammer Exp mbhangui $";
static char sccsid[] = "$Id: logsrv.c,v 1.25 2024-09-05 19:02:34+05:30 Cprogrammer Exp mbhangui $";
#endif

/*-
Expand Down Expand Up @@ -98,7 +93,7 @@ main(int argc, char **argv)
char strnum[FMT_ULONG];
char *loghost;
CLIENT *cl;
static char *usage = "usage: logsrv [-v] [-c connect_timeout] [-d data_timeout] [-r host] dir";
static char *usage = "usage: logsrv [-v] [-c connect_timeout] [-d data_timeout] [-r host] statusdir";
static stralloc line = {0}, rhost = {0}, statusfn = {0}, tmp = {0};
unsigned long dtimeout = 300;

Expand Down Expand Up @@ -277,6 +272,9 @@ getversion_logsrv_c()

/*
* $Log: logsrv.c,v $
* Revision 1.25 2024-09-05 19:02:34+05:30 Cprogrammer
* updated usage string
*
* Revision 1.24 2023-04-14 22:30:46+05:30 Cprogrammer
* removed -c option
*
Expand Down
59 changes: 31 additions & 28 deletions logalert-x/logsrv.man
Original file line number Diff line number Diff line change
@@ -1,46 +1,49 @@
.\" vim: tw=75
.LL 8i
.TH logsrv 8
.SH NAME
logsrv \- monitor log messages
logsrv \- receive log messages

.SH SYNOPSYS
\fBlogsrv\fR [-s] [-f] [-r \fIloghost\fR]
\fBlogsrv\fR [-v] [-c ctimeout] [-d dtimeout [-r \fIloghost\fR] \fIstatusdir\fR

.SH DESCRIPTION
\fBlogsrv\fR(8) binds on \fIlogsrv\fR port (6340) in /etc/services. This can be overriden by
defining \fBPORT\fR environment variable. \fBlogsrv\fR(8) can receive messages
from multiple log message clients like \fBlogclient\fR(1). The log message protocol is simple.
The first line is always the hostname on which the log message client runs and subsequent lines
are log messages. \fBlogsrv\fR(8) receives these messages with the hostname prefixed to each
log message. If \fBlogsrv\fR is run as a server, it writes its pid to /tmp/logsrv.pid.

For each client from which log messages are received, \fBlogsrv\fR creates a status file
named @prefix@/tmp/\fIhostname\fR.status. The directory can be changes by setting \fBSTATUSDIR\fR
environment variable. The status file contains the pid and the bytes accumulated from the client
represented by \fIhostname\fR. The byte position in this status file can be displayed by \fBshowbytes\fR(1).
\fBlogsrv\fR(8) is a log server which can be run under \fBtcpserver\fR(1)
on logsrv port 6340. \fBlogsrv\fR(8) can receive messages from multiple log
message clients like \fBlogclient\fR(1). The log message protocol is
simple. The first line is always the hostname on which the log message
client runs and subsequent lines are log messages. \fBlogsrv\fR(8) receives
these messages with the filename and unique serial number prefixed to each
log message. You can use the -v option to have these messages written to
descriptor 2.

For each client from which log messages are received, \fBlogsrv\fR creates
a status file named \fIhostname\fR.status in \fIstatusdir\fR. The status
file contains the pid and the bytes accumulated from the client represented
by \fIhostname\fR. The byte position in this status file can be displayed
by \fBshowbytes\fR(1).

\fBlogsrv\fR(8) can relay messages to an RPC based log server \fBrpclog\fR(8)
using the -r option.

.SH OPTIONS
.TP
\fB\-s\fR
Run silently. This option does not print the log messages on the screen
.TP 3
\fB\-v\fR
Run verbose. This option prints the log messages on descriptor 2.

.TP
\fB\-f\fR
Run in foreground. This option prevents \fBlogsrv\fR to detach from the terminal and run
in the background. This option is required if you want to run under supervise(8).
\fB\-d\fR \fIdtimeout\fR
Use \fIdtimeout\fR as the timeout for sending acknowledgement to
\fBlogclient\fR(1).

.TP
\fB\-r\fR \fIloghost\fR
Apart from writing received log messages to standard out, send the message to a remote RPC
message log server \fBrpclog\fR(8) for secure storage.

.TP
\fB\-n\fR \fIcertfile\fR
A PEM certificate causes logsrv to negotiate TLS encryption with clients.
Apart from writing received log messages to standard out, send the message
to a remote RPC message log server \fBrpclog\fR(8) for secure storage.

.SH RETURN VALUE
0 if all steps were successful, non-zero otherwise. If any of the steps fail, a diagnostic
message is printed.
0 if all steps were successful, non-zero otherwise. If any of the steps
fail, a diagnostic message is printed.

.SH "SEE ALSO"
rpclog(8), incrmesg(1), logclient(1), supervise(8)
rpclog(8), incrmesg(1), logclient(1), supervise(8), rpcbind(8), rpclog(8)

0 comments on commit eabc000

Please sign in to comment.