|
System | : | Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686 |
Software | : | Apache. PHP/5.3.6-13ubuntu3.10 |
ID | : | uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
|
|
Safe Mode | : | OFF |
Open_Basedir | : | OFF |
Freespace | : | 26.09 GB of 70.42 GB (37.06%) |
|
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON |
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
|
[ System Info ]
[ Processes ]
[ SQL Manager ]
[ Eval ]
[ Encoder ]
[ Mailer ]
[ Back Connection ]
[ Backdoor Server ]
[ Kernel Exploit Search ]
[ MD5 Decrypter ]
[ Reverse IP ]
[ Kill Shell ]
[ FTP Brute-Force ]
|
|
/
usr/
src/
courier-0.66.1/
imap/
- drwxrwxrwx
|
Viewing file: authenticate_auth.c (2.43 KB) -rw-rw-rw-Select action/file-type:  ( +) |  ( +) |  ( +) | Code ( +) | Session ( +) |  ( +) | SDB ( +) |  ( +) |  ( +) |  ( +) |  ( +) |  ( +) |
/* ** Copyright 1998 - 2008 Double Precision, Inc. ** See COPYING for distribution information. */
#if HAVE_CONFIG_H #include "config.h" #endif #include <string.h> #include <stdlib.h> #if HAVE_UNISTD_H #include <unistd.h> #endif #include "imaptoken.h" #include "imapwrite.h" #include "courierauth.h" #include "courierauthsasl.h" #include "courierauthdebug.h"
extern int main_argc; extern char **main_argv;
extern int login_callback(struct authinfo *ainfo, void *dummy);
extern const char *imap_externalauth();
static char *send_auth_reply(const char *q, void *dummy) { struct imaptoken *tok; char *p;
#if SMAP const char *cp=getenv("PROTOCOL");
if (cp && strcmp(cp, "SMAP1") == 0) writes("> "); else #endif
{ writes("+ "); } writes(q); writes("\r\n"); writeflush(); read_timeout(SOCKET_TIMEOUT); tok=nexttoken_nouc();
switch (tok->tokentype) { case IT_ATOM: case IT_NUMBER: p=my_strdup(tok->tokenbuf); break; case IT_EOL: p=my_strdup(""); break; default: return (0); } if (!p) { perror("malloc"); return (0); }
if (nexttoken()->tokentype != IT_EOL) { free(p); fprintf(stderr, "Invalid SASL response\n"); return (0); } read_eol(); return (p); }
int authenticate(const char *tag, char *methodbuf, int methodbuflen) { struct imaptoken *tok=nexttoken(); char *authmethod; char *initreply=0; char *authtype, *authdata; char authservice[40]; char *p ; int rc;
switch (tok->tokentype) { case IT_ATOM: case IT_QUOTED_STRING: break; default: return (0); }
authmethod=my_strdup(tok->tokenbuf); if (methodbuf) snprintf(methodbuf, methodbuflen, "%s", authmethod);
tok=nexttoken_nouc(); if (tok->tokentype != IT_EOL) { switch (tok->tokentype) { case IT_ATOM: case IT_NUMBER: break; default: return (0); } initreply=my_strdup(tok->tokenbuf); if (strcmp(initreply, "=") == 0) *initreply=0; tok=nexttoken_nouc(); }
if (tok->tokentype != IT_EOL) return (0);
read_eol(); if ((rc = auth_sasl_ex(authmethod, initreply, imap_externalauth(), &send_auth_reply, NULL, &authtype, &authdata)) != 0) { free(authmethod); if (initreply) free(initreply); return (rc); }
free(authmethod); if (initreply) free(initreply);
strcat(strcpy(authservice, "AUTHSERVICE"), getenv("TCPLOCALPORT")); p=getenv(authservice);
if (!p || !*p) p="imap";
rc=auth_generic(p, authtype, authdata, login_callback, (void *)tag); free(authtype); free(authdata); return (rc); }
|