Removed imap4d_virtual. Its functionality passed to getpwnam_virtual.
Showing
1 changed file
with
1 additions
and
43 deletions
... | @@ -21,43 +21,6 @@ | ... | @@ -21,43 +21,6 @@ |
21 | #include "../MySql/MySql.h" | 21 | #include "../MySql/MySql.h" |
22 | #endif | 22 | #endif |
23 | 23 | ||
24 | int is_virtual = 0; | ||
25 | |||
26 | #ifdef USE_VIRTUAL_DOMAINS | ||
27 | |||
28 | static struct passwd * | ||
29 | imap4d_virtual (const char *u) | ||
30 | { | ||
31 | struct passwd *pw; | ||
32 | FILE *pfile; | ||
33 | int i = 0, len = strlen (u), delim = 0; | ||
34 | |||
35 | for (i = 0; i < len && delim == 0; i++) | ||
36 | if (u[i] == '!' || u[i] == ':' || u[i] == '@') | ||
37 | delim = i; | ||
38 | |||
39 | if (delim == 0) | ||
40 | return NULL; | ||
41 | |||
42 | chdir ("/etc/domains"); | ||
43 | pfile = fopen (&u[delim+1], "r"); | ||
44 | while (pfile != NULL && (pw = fgetpwent (pfile)) != NULL) | ||
45 | { | ||
46 | if (strlen (pw->pw_name) == delim && !strncmp (u, pw->pw_name, delim)) | ||
47 | { | ||
48 | is_virtual = 1; | ||
49 | return pw; | ||
50 | } | ||
51 | } | ||
52 | |||
53 | return NULL; | ||
54 | } | ||
55 | |||
56 | #endif | ||
57 | |||
58 | /* | ||
59 | * FIXME: this should support PAM, shadow, and normal password | ||
60 | */ | ||
61 | #ifdef USE_LIBPAM | 24 | #ifdef USE_LIBPAM |
62 | #define COPY_STRING(s) (s) ? strdup(s) : NULL | 25 | #define COPY_STRING(s) (s) ? strdup(s) : NULL |
63 | 26 | ||
... | @@ -140,11 +103,6 @@ imap4d_login (struct imap4d_command *command, char *arg) | ... | @@ -140,11 +103,6 @@ imap4d_login (struct imap4d_command *command, char *arg) |
140 | 103 | ||
141 | pw = mu_getpwnam (username); | 104 | pw = mu_getpwnam (username); |
142 | if (pw == NULL) | 105 | if (pw == NULL) |
143 | #ifdef USE_VIRTUAL_DOMAINS | ||
144 | pw = imap4d_virtual (username); | ||
145 | |||
146 | if (pw == NULL) | ||
147 | #endif /* USE_VIRTUAL_DOMAINS */ | ||
148 | return util_finish (command, RESP_NO, "User name or passwd rejected"); | 106 | return util_finish (command, RESP_NO, "User name or passwd rejected"); |
149 | 107 | ||
150 | #ifndef USE_LIBPAM | 108 | #ifndef USE_LIBPAM |
... | @@ -185,7 +143,7 @@ imap4d_login (struct imap4d_command *command, char *arg) | ... | @@ -185,7 +143,7 @@ imap4d_login (struct imap4d_command *command, char *arg) |
185 | openlog ("gnu-imap4d", LOG_PID, LOG_MAIL); | 143 | openlog ("gnu-imap4d", LOG_PID, LOG_MAIL); |
186 | #endif /* USE_LIBPAM */ | 144 | #endif /* USE_LIBPAM */ |
187 | 145 | ||
188 | if (pw->pw_uid > 0 && !is_virtual) | 146 | if (pw->pw_uid > 0 && !mu_virtual_domain) |
189 | setuid (pw->pw_uid); | 147 | setuid (pw->pw_uid); |
190 | 148 | ||
191 | homedir = util_normalize_path (strdup (pw->pw_dir), "/"); | 149 | homedir = util_normalize_path (strdup (pw->pw_dir), "/"); | ... | ... |
-
Please register or sign in to post a comment