summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/system.c24
-rw-r--r--source3/lib/util.c2
-rw-r--r--source3/lib/util_pw.c4
-rw-r--r--source3/lib/util_sock.c4
4 files changed, 29 insertions, 5 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 3bf0994621..8b2ba800f5 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -763,6 +763,30 @@ void sys_endpwent(void)
endpwent();
}
+/**************************************************************************
+ Wrappers for getpwnam(), getpwuid(), getgrnam(), getgrgid()
+****************************************************************************/
+
+struct passwd *sys_getpwnam(const char *name)
+{
+ return getpwnam(name);
+}
+
+struct passwd *sys_getpwuid(uid_t uid)
+{
+ return getpwuid(uid);
+}
+
+struct group *sys_getgrnam(const char *name)
+{
+ return getgrnam(name);
+}
+
+struct group *sys_getgrgid(gid_t gid)
+{
+ return getgrgid(gid);
+}
+
#if 0 /* NOT CURRENTLY USED - JRA */
/**************************************************************************
The following are the UNICODE versions of *all* system interface functions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index fe1011668d..92c8850cef 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1122,7 +1122,7 @@ gid_t nametogid(const char *name)
if ((p != name) && (*p == '\0'))
return g;
- grp = getgrnam(name);
+ grp = sys_getgrnam(name);
if (grp)
return(grp->gr_gid);
return (gid_t)-1;
diff --git a/source3/lib/util_pw.c b/source3/lib/util_pw.c
index 47711788c7..9d075a05e8 100644
--- a/source3/lib/util_pw.c
+++ b/source3/lib/util_pw.c
@@ -56,7 +56,7 @@ struct passwd *getpwnam_alloc(const char *name)
{
struct passwd *temp;
- temp = getpwnam(name);
+ temp = sys_getpwnam(name);
if (!temp) {
#if 0
@@ -74,7 +74,7 @@ struct passwd *getpwuid_alloc(uid_t uid)
{
struct passwd *temp;
- temp = getpwuid(uid);
+ temp = sys_getpwuid(uid);
if (!temp) {
#if 0
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index f5d56eb0d4..e9e2ab8291 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -1042,8 +1042,8 @@ int open_pipe_sock(char *path)
permissions, instead.
******************************************************************/
int create_pipe_sock(const char *socket_dir,
- const char *socket_name,
- mode_t dir_perms)
+ const char *socket_name,
+ mode_t dir_perms)
{
struct sockaddr_un sunaddr;
struct stat st;