Add back sys_getpwnam() and freinds to the system.c interface, but don't
authorAndrew Bartlett <abartlet@samba.org>
Sat, 15 Jun 2002 00:47:52 +0000 (00:47 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 15 Jun 2002 00:47:52 +0000 (00:47 +0000)
use the silly cache any more.  Also add group functions and fix a few callers.

Andrew Bartlett
(This used to be commit 41d4b94077c118ecde2bf8792b9bb7ab71c6403e)

source3/lib/system.c
source3/lib/util.c
source3/lib/util_pw.c
source3/lib/util_sock.c

index 3bf0994621c99270da143ffa652c497938b4689a..8b2ba800f53efcea927dd518f3b6f0aaa0c785b7 100644 (file)
@@ -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
index fe1011668de8ca88357d710309abd0a74674d30c..92c8850cef4d2d4e33b645993bf526b45b32c06d 100644 (file)
@@ -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;
index 47711788c79aec84061b5af78a99b7f75391d242..9d075a05e885bfc080f7257c3298a2cbcdbd8d5c 100644 (file)
@@ -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
index f5d56eb0d4f2f646556ed2cf582cc70f89be27e3..e9e2ab82911012fb5286c2fd9b5946fb2c3a4632 100644 (file)
@@ -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;