Commit 74045957 740459577e4c3b4786ba4236558cb5de5bc53a1f by Sergey Poznyakoff

Removed imap4d_virtual. Its functionality passed to getpwnam_virtual.

1 parent c01f5432
......@@ -21,43 +21,6 @@
#include "../MySql/MySql.h"
#endif
int is_virtual = 0;
#ifdef USE_VIRTUAL_DOMAINS
static struct passwd *
imap4d_virtual (const char *u)
{
struct passwd *pw;
FILE *pfile;
int i = 0, len = strlen (u), delim = 0;
for (i = 0; i < len && delim == 0; i++)
if (u[i] == '!' || u[i] == ':' || u[i] == '@')
delim = i;
if (delim == 0)
return NULL;
chdir ("/etc/domains");
pfile = fopen (&u[delim+1], "r");
while (pfile != NULL && (pw = fgetpwent (pfile)) != NULL)
{
if (strlen (pw->pw_name) == delim && !strncmp (u, pw->pw_name, delim))
{
is_virtual = 1;
return pw;
}
}
return NULL;
}
#endif
/*
* FIXME: this should support PAM, shadow, and normal password
*/
#ifdef USE_LIBPAM
#define COPY_STRING(s) (s) ? strdup(s) : NULL
......@@ -140,11 +103,6 @@ imap4d_login (struct imap4d_command *command, char *arg)
pw = mu_getpwnam (username);
if (pw == NULL)
#ifdef USE_VIRTUAL_DOMAINS
pw = imap4d_virtual (username);
if (pw == NULL)
#endif /* USE_VIRTUAL_DOMAINS */
return util_finish (command, RESP_NO, "User name or passwd rejected");
#ifndef USE_LIBPAM
......@@ -185,7 +143,7 @@ imap4d_login (struct imap4d_command *command, char *arg)
openlog ("gnu-imap4d", LOG_PID, LOG_MAIL);
#endif /* USE_LIBPAM */
if (pw->pw_uid > 0 && !is_virtual)
if (pw->pw_uid > 0 && !mu_virtual_domain)
setuid (pw->pw_uid);
homedir = util_normalize_path (strdup (pw->pw_dir), "/");
......