On Mon, Sep 08, 2003 at 02:36:22PM -0400, Matt wrote:
> Ok,
> Now nothing is working...
>
> I compiled the patched qmail and installed it....
> now when I try to log into my webmail it just times out... a telnet shows this:
>
> [EMAIL PROTECTED] qmail-1.03]# telnet localhost 143
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> * OK [CAPABILITY IMAP4rev1] Courier-IMAP ready. Copyright 1998-2003 Double
> Precision, Inc. See COPYING for distribution information.
> 1 LOGIN mhoppes passwdremoved
> Connection closed by foreign host.
>
> and my courier run looks like this:
>
> #!/bin/sh
>
> exec_pref=/usr/lib/courier-imap
> . /usr/lib/courier-imap/etc/imapd
>
> tcpserver -c 100 -l webmail.chilitech.net -v -R 0 143 \
> /usr/lib/courier-imap/sbin/imaplogin \
> /var/qmail/bin/auth_imap \
> /usr/lib/courier-imap/bin/imapd Maildir 2>&1
>
> any ideas now?
>
Yup. This was a bug introduced, I fixed it already but forgot to send a
patch to the list.
I will do that now.
--
:wq Claudio
Index: auth_imap.c
===================================================================
RCS file: /home/cvs-qmail-ldap/CVS/qmail-ldap/auth_imap.c,v
retrieving revision 1.14
retrieving revision 1.18
diff -u -r1.14 -r1.18
--- auth_imap.c 19 Aug 2003 15:13:55 -0000 1.14
+++ auth_imap.c 3 Sep 2003 22:32:20 -0000 1.18
@@ -84,12 +84,12 @@
i = 0;
s = auth_up; /* ignore service field */
while (auth_up[i] && auth_up[i] != '\n' ) i++;
- if (i == auth_uplen)
+ if (i >= auth_uplen)
auth_error(NEEDED);
auth_up[i++] = '\0';
t = auth_up + i; /* type has to be "login" else fail ... */
while (auth_up[i] && auth_up[i] != '\n' ) i++;
- if (i == auth_uplen)
+ if (i >= auth_uplen)
auth_error(NEEDED);
auth_up[i++] = '\0';
if (str_diff("login", t)) {
@@ -102,15 +102,15 @@
}
l = auth_up + i; /* next login */
while (auth_up[i] && auth_up[i] != '\n' ) i++;
- if (i == auth_uplen)
+ if (i >= auth_uplen)
auth_error(NEEDED);
auth_up[i++] = '\0';
p = auth_up + i; /* and the password */
while (auth_up[i] && auth_up[i] != '\n' ) i++;
- if (i == auth_uplen)
+ if (i >= auth_uplen)
auth_error(NEEDED);
auth_up[i++] = '\0';
- if (i != auth_uplen) /* paranoia */
+ if (i > auth_uplen) /* paranoia */
auth_error(NEEDED);
/* copy the login and password into the coresponding structures */
@@ -134,8 +134,8 @@
t = auth_up;
log(2, "warning: auth_fail: user %s failed\n", login);
- if (reason == NOSUCH ) {
- log(4, "warning: auth_fail: user %s not found\n", login);
+ if (reason == NOSUCH || reason == AUTH_TYPE) {
+ log(4, "warning: auth_fail: %s\n", qldap_err_str(reason));
if (!env_unset("AUTHENTICATED"))
auth_error(ERRNO);
for (i=0; i<auth_uplen; i++) if (!auth_up[i]) auth_up[i] = '\n';
@@ -168,7 +168,7 @@
close(pi[1]);
_exit(0);
}
- auth_error(PANIC); /* complete failure */
+ auth_error(reason); /* complete failure */
}
void
@@ -199,7 +199,7 @@
byte_zero(auth_up, sizeof(auth_up));
log(2, "warning: auth_error: authorization failed (%s)\n",
- qldap_err_str(errnum) );
+ qldap_err_str(errnum));
if (!(env = env_get("AUTHARGC")))
_exit(111);
scan_ulong(env, &numarg);
@@ -219,7 +219,7 @@
if (!(env = env_get("AUTHUSER")))
_exit(100);
#endif
- execv(env, argvs);
+ execv(*argvs, argvs);
_exit(111);
}