aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-07-01 17:32:57 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-07-01 17:32:57 +0000
commit8dc48b649e2e0b8781a05d47a39c59713e5a1d33 (patch)
treee1ea3a0505a87f6771bc824fb658dbbe3e6c89e4
parentfe8e1a1e27f3ee69bb9158e786cdc537893130b1 (diff)
downloadfetchmail-8dc48b649e2e0b8781a05d47a39c59713e5a1d33.tar.gz
fetchmail-8dc48b649e2e0b8781a05d47a39c59713e5a1d33.tar.bz2
fetchmail-8dc48b649e2e0b8781a05d47a39c59713e5a1d33.zip
Bug fixes.
svn path=/trunk/; revision=22
-rw-r--r--Makefile.in19
-rw-r--r--NEWS12
-rw-r--r--fetchmail.c56
3 files changed, 42 insertions, 45 deletions
diff --git a/Makefile.in b/Makefile.in
index ba3374aa..8e94625a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -21,7 +21,7 @@ RANLIB = @RANLIB@
defines = @DEFS@
# If your system needs extra libraries loaded in, define them here.
-LOADLIBES = @LIBS@ @LEXLIB@
+LOADLIBS = @LIBS@ @LEXLIB@
# Any extra object files your system needs.
extras = @LIBOBJS@
@@ -81,22 +81,11 @@ depend:
test -f poprc_y.h || touch poprc_y.h
makedepend -fMakefile.in *.c
-info: popclient.info
-dvi: popclient.dvi
# Some makes apparently use .PHONY as the default goal is it is before `all'.
-.PHONY: all check info dvi
-
-popclient.info: popclient.texi
- $(MAKEINFO) -I$(srcdir) $(srcdir)/popclient.texi -o popclient.info
-
-popclient.dvi: popclient.texi
- $(TEXI2DVI) $(srcdir)/popclient.texi
-
-popclient.ps: popclient.dvi
- dvi2ps popclient.dvi > popclient.ps
+.PHONY: all check
popclient: $(srcdir)/poprc_l.c $(srcdir)/poprc_y.c $(objs)
- $(CC) $(LDFLAGS) $(objs) $(LOADLIBES) -o popclient
+ $(CC) $(LDFLAGS) $(objs) $(LOADLIBS) -o popclient
# -I. is needed to find config.h in the build directory.
@@ -202,7 +191,7 @@ extra = $(srcdir)/alloca.c $(srcdir)/bzero.[ch] $(srcdir)/errorcodes \
$(srcdir)/getopt.[ch] $(srcdir)/getopt1.c $(srcdir)/md5*.[ch] \
$(srcdir)/strcasecmp.c $(srcdir)/strdup.c
docs = $(srcdir)/COPYING $(srcdir)/README $(srcdir)/INSTALL $(srcdir)/NEWS \
- $(srcdir)/RFC/*.txt \
+ $(srcdir)/popclient.lsm $(srcdir)/RFC/*.txt \
$(srcdir)/*.man $(srcdir)/sample.poprc
config = $(srcdir)/Makefile.in $(srcdir)/configure.in $(srcdir)/configure \
$(srcdir)/config.guess $(srcdir)/config.h.in $(srcdir)/config.sub
diff --git a/NEWS b/NEWS
index adf23f96..82378a77 100644
--- a/NEWS
+++ b/NEWS
@@ -1,11 +1,19 @@
NEWS
+3.01:
+
+* Fixed a bug in dump_options that cauded username to be displayed incorrectly.
+
+* The lock assertion code was in the wrong place relative to the daemonize()
+ call.
3.0:
Eric S. Raymond <esr@thyrsus.com> hacked extensively on 3.0b6 and took over
-the package with the consent of Clark Harris, the original implementor.
-Here are my (Eric's) change notes:
+the package with the consent of Carl Harris, the original implementor.
+Some of the 3.0 feature additions were inspired by Sean Oh's fetchpop 1.8
+code, and a few use code directly lifted from fetchpop. Here are my (Eric's)
+change notes:
CONFIGURATION AND BUILDING
diff --git a/fetchmail.c b/fetchmail.c
index a92991ba..de95b785 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -82,6 +82,7 @@ char *mda_argv [32];
static void termhook();
static char *lockfile;
+static int popstatus;
main (argc,argv)
int argc;
@@ -89,7 +90,6 @@ char **argv;
{
int mboxfd;
struct optrec cmd_opts, def_opts, merged_opts;
- int popstatus;
int parsestatus;
char *servername;
struct hostrec *hostp, *hostlist = (struct hostrec *)NULL;
@@ -145,7 +145,7 @@ char **argv;
exit(PS_SYNTAX);
}
- /* beyond here we don't want more than one popclient running per user */
+ /* set up to do lock protocol */
umask(0077);
if ((lockfile = (char *) malloc( strlen(getenv("HOME")) + strlen("/.lockfetch-") + HOSTLEN)) == NULL) {
fprintf(stderr,"popclient: cannot allocate memory for .lockfetch, exiting.\n");
@@ -155,31 +155,8 @@ char **argv;
strcat(lockfile,"/.lockfetch-");
gethostname(lockfile+strlen(lockfile),HOSTLEN);
- /* check the lock, maybe remove it */
- if (!quitmode)
- {
- /* check the lock */
- if ( (tmpfp = fopen(lockfile, "r")) != NULL ) {
- fscanf(tmpfp,"%d",&pid);
- fprintf(stderr,"Another session appears to be running at pid %d.\nIf you are sure that this is incorrect, remove %s file.\n",pid,lockfile);
- fclose(tmpfp);
- return(PS_EXCLUDE);
- }
-
- /* if not locked, assert a lock */
- else if ( (tmpfp = fopen(lockfile,"w")) != NULL ) {
- signal(SIGABRT, termhook);
- signal(SIGINT, termhook);
- signal(SIGTERM, termhook);
- signal(SIGALRM, termhook);
- signal(SIGHUP, termhook);
- signal(SIGPIPE, termhook);
- signal(SIGQUIT, termhook);
- fprintf(tmpfp,"%d",getpid());
- fclose(tmpfp);
- }
- }
- else
+ /* perhaps user asked us to remove a lock */
+ if (quitmode)
{
FILE* fp;
@@ -200,12 +177,34 @@ char **argv;
exit(0);
}
+
+ /* beyond here we don't want more than one popclient running per user */
+ if ( (tmpfp = fopen(lockfile, "r")) != NULL ) {
+ fscanf(tmpfp,"%d",&pid);
+ fprintf(stderr,"Another session appears to be running at pid %d.\nIf you are sure that this is incorrect, remove %s file.\n",pid,lockfile);
+ fclose(tmpfp);
+ return(PS_EXCLUDE);
+ }
+
/*
* Maybe time to go to demon mode...
*/
if (poll_interval)
daemonize(logfile, termhook);
+ /* if not locked, assert a lock */
+ signal(SIGABRT, termhook);
+ signal(SIGINT, termhook);
+ signal(SIGTERM, termhook);
+ signal(SIGALRM, termhook);
+ signal(SIGHUP, termhook);
+ signal(SIGPIPE, termhook);
+ signal(SIGQUIT, termhook);
+ if ( (tmpfp = fopen(lockfile,"w")) != NULL ) {
+ fprintf(tmpfp,"%d",getpid());
+ fclose(tmpfp);
+ }
+
/*
* Query all hosts. If there's only one, the error return will
* reflect the status of that transaction.
@@ -226,6 +225,7 @@ char **argv;
void termhook()
{
unlink(lockfile);
+ exit(popstatus);
}
int query_host(servername, options)
@@ -280,7 +280,7 @@ struct optrec *options;
if (!options->loginid[0])
printf(" No password set\n");
else
- printf(" Username = '%s'\n", options->loginid);
+ printf(" Username = '%s'\n", options->username);
printf(" Password = '%s'\n", options->password);
printf(" Protocol is ");