Non-DNS based alias keywords such as "aka" remain.
* Kerberos IV support was removed.
+# CHANGES
+* A foreground fetchmail can now accept a few more options while another copy is
+ running in the background.
+
--------------------------------------------------------------------------------
fetchmail-6.3.20 (not yet released):
{
int bkgd = FALSE;
int implicitmode = FALSE;
+ flag safewithbg = FALSE; /** if parsed options are compatible with a
+ fetchmail copy running in the background */
struct query *ctl;
netrc_entry *netrc_list;
char *netrc_file, *tmpbuf;
#define IDFILE_NAME ".fetchids"
run.idfile = prependdir (IDFILE_NAME, fmhome);
-
+
outlevel = O_NORMAL;
/*
{
int i;
- i = parsecmdline(argc, argv, &cmd_run, &cmd_opts);
+ i = parsecmdline(argc, argv, &cmd_run, &cmd_opts, &safewithbg);
if (i < 0)
exit(PS_SYNTAX);
else if (getpid() == pid)
/* this test enables re-execing on a changed rcfile */
fm_lock_assert();
- else if (argc > 1)
+ else if (argc > 1 && !safewithbg)
{
fprintf(stderr,
GT_("fetchmail: can't accept options while a background fetchmail is running.\n"));
+ {
+ int i;
+ fprintf(stderr, "argc = %d, arg list:\n", argc);
+ for (i = 1; i < argc; i++) fprintf(stderr, "arg %d = \"%s\"\n", i, argv[i]);
+ }
return(PS_EXCLUDE);
}
else if (kill(pid, SIGUSR1) == 0)
{
- fprintf(stderr,
- GT_("fetchmail: background fetchmail at %ld awakened.\n"),
- (long)pid);
+ if (outlevel > O_SILENT)
+ fprintf(stderr,
+ GT_("fetchmail: background fetchmail at %ld awakened.\n"),
+ (long)pid);
return(0);
}
else
extern char currentwd[1024], rcfiledir[1024];
struct query *hostalloc(struct query *);
-int parsecmdline (int, char **, struct runctl *, struct query *);
+int parsecmdline (int, char **, struct runctl *, struct query *, flag *);
char *prependdir (const char *, const char *);
char *MD5Digest (unsigned const char *);
void hmac_md5 (const unsigned char *, size_t, const unsigned char *, size_t, unsigned char *, size_t);
int parsecmdline (int argc /** argument count */,
char **argv /** argument strings */,
struct runctl *rctl /** global run controls to modify */,
- struct query *ctl /** option record to initialize */)
+ struct query *ctl /** option record to initialize */,
+ flag *safewithbg /** set to whether options are
+ compatible with another copy
+ running in the background */)
{
/*
* return value: if positive, argv index of last parsed option + 1
int errflag = 0; /* TRUE when a syntax error is detected */
int helpflag = 0; /* TRUE when option help was explicitly requested */
int option_index;
+ int option_safe; /* to track if option currently parsed is safe
+ with a background copy */
char *buf, *cp;
rctl->poll_interval = -1;
+ *safewithbg = TRUE;
memset(ctl, '\0', sizeof(struct query)); /* start clean */
ctl->smtp_socket = -1;
(c = getopt_long(argc,argv,shortoptions,
longoptions, &option_index)) != -1)
{
+ option_safe = FALSE;
+
switch (c) {
#ifdef HAVE_LIBPWMD
case 'C':
#endif
case 'V':
versioninfo = TRUE;
+ option_safe = TRUE;
break;
case 'c':
check_only = TRUE;
break;
case 's':
outlevel = O_SILENT;
+ option_safe = 1;
break;
case 'v':
if (outlevel >= O_VERBOSE)
outlevel = O_DEBUG;
else
outlevel = O_VERBOSE;
+ option_safe = TRUE;
break;
case 'd':
rctl->poll_interval = xatoi(optarg, &errflag);
case LA_CONFIGDUMP:
configdump = TRUE;
+ option_safe = TRUE;
break;
case LA_SYSLOG:
break;
case '?':
+ helpflag = 1;
default:
- helpflag++;
+ break;
}
+ *safewithbg &= option_safe;
}
if (errflag || ocount > 1 || helpflag) {