Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
74045957
...
740459577e4c3b4786ba4236558cb5de5bc53a1f
authored
2001-08-31 07:08:24 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Removed imap4d_virtual. Its functionality passed to getpwnam_virtual.
1 parent
c01f5432
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
43 deletions
imap4d/login.c
imap4d/login.c
View file @
7404595
...
...
@@ -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
),
"/"
);
...
...
Please
register
or
sign in
to post a comment