X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=kernel%2Feti.c;h=c69e67d650b0023442348ceccf7846b2721e0fa5;hb=d1fc0ff84894bba24f827a81597717e9f69b6c06;hp=48178a08f508093151e54647a8e029ebcb309f57;hpb=aa975e8f85af258357639e3407ce40090f4a4998;p=egate.git diff --git a/kernel/eti.c b/kernel/eti.c index 48178a0..c69e67d 100644 --- a/kernel/eti.c +++ b/kernel/eti.c @@ -45,7 +45,17 @@ * Europagate, 1995 * * $Log: eti.c,v $ - * Revision 1.14 1995/05/19 13:25:59 adam + * Revision 1.17 1995/12/20 16:27:24 adam + * Extra parameter block to gw_db_open. + * + * Revision 1.16 1995/07/11 11:49:11 adam + * LINE_MAX renamed to STR_LINE_MAX. + * + * Revision 1.15 1995/07/03 12:59:28 adam + * New option for eti: -c dir to chdir before start. + * Setting change: gw.max.show defaults to 100. + * + * Revision 1.14 1995/05/19 13:25:59 adam * Bug fixes. Better command line options. * * Revision 1.13 1995/05/16 09:40:41 adam @@ -111,7 +121,7 @@ #include #include -#define LINE_MAX 1024 +#define STR_LINE_MAX 1024 static char *module = "eti"; static jmp_buf retry_jmp; @@ -189,9 +199,9 @@ static void deliver (struct str_queue *sq, GIP gip, const char *msg) int main (int argc, char **argv) { - char from_str[LINE_MAX+1]; - char subject_str[LINE_MAX+1]; - char line_str[LINE_MAX+1]; + char from_str[STR_LINE_MAX+1]; + char subject_str[STR_LINE_MAX+1]; + char line_str[STR_LINE_MAX+1]; char msg[20]; GW_DB user_db; GIP gip; @@ -225,6 +235,7 @@ int main (int argc, char **argv) fprintf (stderr, " -l log Set Log file\n"); fprintf (stderr, " -d Enable debugging log\n"); fprintf (stderr, " -D Enable more debugging log\n"); + fprintf (stderr, " -c dir Change to directory\n"); fprintf (stderr, " -- Precedes kernel options " "(kernel is invoked instead of monitor)\n"); exit (1); @@ -245,6 +256,23 @@ int main (int argc, char **argv) case 'D': gw_log_level (GW_LOG_ALL); break; + case 'c': + if (argv[argno][2]) + { + if (chdir (argv[argno]+2)) + gw_log (GW_LOG_WARN|GW_LOG_ERRNO, module, "chdir"); + } + else if (++argno < argc) + { + if (chdir (argv[argno])) + gw_log (GW_LOG_WARN|GW_LOG_ERRNO, module, "chdir"); + } + else + { + fprintf (stderr, "%s: missing chdir name\n", *argv); + exit (1); + } + break; default: fprintf (stderr, "%s: unknown option `%s'; use -H for help\n", *argv, argv[argno]); @@ -257,7 +285,7 @@ int main (int argc, char **argv) gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, module, "str_queue_mk"); exit (1); } - while (fgets (line_str, LINE_MAX, stdin)) + while (fgets (line_str, STR_LINE_MAX, stdin)) str_queue_enq (queue, line_str); r = email_header (queue, from_str, subject_str); @@ -267,7 +295,7 @@ int main (int argc, char **argv) exit (1); } gw_log (GW_LOG_STAT, module, "Mail from %s", from_str); - user_db = gw_db_open ("user.db", 1); + user_db = gw_db_open ("user.db", 1, 1); r = gw_db_lookup (user_db, from_str, strlen(from_str), &user_info, &info_length);