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
51a78b3d
...
51a78b3d5d4d5c9407c0c2ad7d3d1a93f46cac03
authored
2001-08-30 15:30:59 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
new functions: mu_getpwnam() and mu_register_getpwnam(). Removed inclusion of MySql.h
1 parent
5a3b38eb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
mailbox/mutil.c
mailbox/mutil.c
View file @
51a78b3
...
...
@@ -31,10 +31,6 @@
#include <mailutils/mutil.h>
#ifdef HAVE_MYSQL
#include "../MySql/MySql.h"
#endif
/* convert a sequence of hex characters into an integer */
unsigned
long
mu_hex2ul
(
char
hex
)
...
...
@@ -297,11 +293,7 @@ mu_tilde_expansion (const char *ref, const char *delim, const char *homedir)
name
=
calloc
(
s
-
p
+
1
,
1
);
memcpy
(
name
,
p
,
s
-
p
);
name
[
s
-
p
]
=
'\0'
;
pw
=
getpwnam
(
name
);
#ifdef HAVE_MYSQL
if
(
!
pw
)
pw
=
getMpwnam
(
name
);
#endif
/* HAVE_MYSQL */
pw
=
mu_getpwnam
(
name
);
free
(
name
);
if
(
pw
)
{
...
...
@@ -332,3 +324,23 @@ util_cpystr (char *dst, const char *src, size_t size)
dst
[
len
]
=
'\0'
;
return
len
;
}
static
struct
passwd
*
(
*
_app_getpwnam
)
__P
((
char
*
))
=
NULL
;
void
mu_register_getpwnam
(
struct
passwd
*
(
*
fun
)
__P
((
char
*
)))
{
_app_getpwnam
=
fun
;
}
struct
password
*
mu_getpwnam
(
const
char
*
name
)
{
struct
password
*
p
;
p
=
getpwnam
(
name
);
if
(
!
p
&&
_app_getpwnam
)
p
=
(
*
_app_getpwnam
)(
name
);
return
p
;
}
...
...
Please
register
or
sign in
to post a comment