Commit 301bef05 301bef0518b62ffb3482095000735084c49b632e by Sergey Poznyakoff

Removed argp_program_bug_address. Use PACKAGE_STRING, provided by

the new autoconf.
Imply debug mode if the input stream is connected to a tty. Don't
try to switch to "mail" group id in debug mode.
1 parent d43f6f1f
......@@ -36,6 +36,8 @@ struct daemon_param daemon_param = {
0, /* No transcript by default */
};
int debug_mode;
/* Number of child processes. */
volatile size_t children;
......@@ -44,8 +46,8 @@ static void pop3d_daemon_init __P ((void));
static void pop3d_daemon __P ((unsigned int, unsigned int));
static error_t pop3d_parse_opt __P((int key, char *arg,
struct argp_state *astate));
const char *argp_program_version = "pop3d (" PACKAGE ") " VERSION;
const char *argp_program_bug_address = "<bug-mailutils@gnu.org>";
const char *argp_program_version = "pop3d (" PACKAGE_STRING ")";
static char doc[] = "GNU pop3d -- the POP3 daemon";
static struct argp argp = {
......@@ -96,7 +98,13 @@ main (int argc, char **argv)
pam_service = (char *)"gnu-pop3d";
#endif
/* First we want our group to be mail so we can access the spool. */
if (isatty (0))
{
/* If input is a tty, switch to debug mode */
debug_mode = 1;
}
else
{
gr = getgrnam ("mail");
if (gr == NULL)
{
......@@ -109,8 +117,9 @@ main (int argc, char **argv)
perror ("Error setting mail group");
exit (EXIT_FAILURE);
}
}
/* Register the desire formats. We only need Mbox mail format. */
/* Register the desired formats. */
{
list_t bookie;
registrar_get_list (&bookie);
......@@ -218,6 +227,11 @@ pop3d_mainloop (int infile, int outfile)
syslog (LOG_INFO, "Incoming connection opened");
/* log information on the connecting client */
if (debug_mode)
{
syslog (LOG_INFO, "Started in debugging mode");
}
else
{
struct sockaddr_in cs;
int len = sizeof cs;
......