Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Jan 2004 23:30:24 -0800 (PST)
From:      "David P. Reese Jr." <daver@solidcore.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/61872: [PATCH] mail/akpop3d fails to authenticate when using an authfile
Message-ID:  <200401250730.i0P7UOti075007@keen.paloalto.solidcore.com>
Resent-Message-ID: <200401250740.i0P7e8NR025352@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         61872
>Category:       ports
>Synopsis:       [PATCH] mail/akpop3d fails to authenticate when using an authfile
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 24 23:40:07 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     David P. Reese Jr.
>Release:        FreeBSD 4.9-RELEASE i386
>Organization:
Solidcore Systems
>Environment:
System: FreeBSD keen.paloalto.solidcore.com 4.9-RELEASE FreeBSD 4.9-RELEASE #0: Sat Jan 24 08:44:54 PST 2004 daver@keen.paloalto.solidcore.com:/usr/src/sys/compile/KEEN i386


	
>Description:
	akpop3d fails to authenticate when using an external authfile.
>How-To-Repeat:
	Install mail/akpop3d.

	Create the authfile /tmp/authfile with the following contents:
	--- begin authfile ---
	daver:foobar:daver:/var/mail/daver
	--- end authfile ---

	Start akpop3d:
	# akpop3d -a /tmp/authfile

	Telnet to the pop3 server and try to authenticate:
	$ telnet localhost pop3
	Trying ::1...
	Trying 127.0.0.1...
	Connected to localhost.
	Escape character is '^]'.
	+OK
	USER daver
	+OK
	PASS foobar
	-ERR authentication failed
	Connection closed by foreign host.

>Fix:

	There is a bug in the loop that reads in the authfile line by line.

--- authenticate.c.orig 2004-01-24 22:19:02.000000000 -0800
+++ authenticate.c      2004-01-24 22:19:11.000000000 -0800
@@ -195,7 +195,7 @@
       syslog(LOG_ERR,"%s: %s: %s","failed to read auth file",authfile,strerror(errno));
       return 0;
     }
-    while ((0!=ferror(fptr)) && (0!=feof(fptr))) {
+    while ((!ferror(fptr)) && (!feof(fptr))) {
       linebuf[0] = '\0';
       if (fgets(linebuf, sizeof(linebuf), fptr) == NULL) {
         fclose(fptr);
>Release-Note:
>Audit-Trail:
>Unformatted:


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200401250730.i0P7UOti075007>