summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-10-20 08:16:23 -0700
committerJeremy Allison <jra@samba.org>2010-10-20 16:02:12 +0000
commite1cfca1e2e0f005ac9d73c6b0eb64bc99413aec6 (patch)
tree63aa4baa9b9260e466558bbde9a59c6c82c8c939 /source3/passdb
parentab01d6139fc7b2c4b651a0959a5816352d6bb49b (diff)
downloadsamba-e1cfca1e2e0f005ac9d73c6b0eb64bc99413aec6.tar.gz
samba-e1cfca1e2e0f005ac9d73c6b0eb64bc99413aec6.tar.bz2
samba-e1cfca1e2e0f005ac9d73c6b0eb64bc99413aec6.zip
Make getpwnam_alloc() static to lib/username.c, and ensure all username lookups go
through Get_Pwnam_alloc(), which is the correct wrapper function. We were using it *some* of the time anyway, so this just makes us properly consistent. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Oct 20 16:02:12 UTC 2010 on sn-devel-104
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_interface.c4
-rw-r--r--source3/passdb/pdb_smbpasswd.c4
-rw-r--r--source3/passdb/util_unixsids.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c
index a0913a3ea9..a6fe2e0408 100644
--- a/source3/passdb/pdb_interface.c
+++ b/source3/passdb/pdb_interface.c
@@ -352,7 +352,7 @@ static bool guest_user_info( struct samu *user )
NTSTATUS result;
const char *guestname = lp_guestaccount();
- pwd = getpwnam_alloc(talloc_tos(), guestname);
+ pwd = Get_Pwnam_alloc(talloc_tos(), guestname);
if (pwd == NULL) {
DEBUG(0,("guest_user_info: Unable to locate guest account [%s]!\n",
guestname));
@@ -1546,7 +1546,7 @@ static NTSTATUS pdb_default_enum_group_memberships(struct pdb_methods *methods,
/* Ignore the primary group SID. Honor the real Unix primary group.
The primary group SID is only of real use to Windows clients */
- if ( !(pw = getpwnam_alloc(mem_ctx, username)) ) {
+ if ( !(pw = Get_Pwnam_alloc(mem_ctx, username)) ) {
return NT_STATUS_NO_SUCH_USER;
}
diff --git a/source3/passdb/pdb_smbpasswd.c b/source3/passdb/pdb_smbpasswd.c
index f188399f78..8d6ac318cb 100644
--- a/source3/passdb/pdb_smbpasswd.c
+++ b/source3/passdb/pdb_smbpasswd.c
@@ -1198,9 +1198,9 @@ static bool build_smb_pass (struct smb_passwd *smb_pw, const struct samu *sampas
/* If the user specified a RID, make sure its able to be both stored and retreived */
if (rid == DOMAIN_RID_GUEST) {
- struct passwd *passwd = getpwnam_alloc(NULL, lp_guestaccount());
+ struct passwd *passwd = Get_Pwnam_alloc(NULL, lp_guestaccount());
if (!passwd) {
- DEBUG(0, ("Could not find guest account via getpwnam()! (%s)\n", lp_guestaccount()));
+ DEBUG(0, ("Could not find guest account via Get_Pwnam_alloc()! (%s)\n", lp_guestaccount()));
return False;
}
smb_pw->smb_userid=passwd->pw_uid;
diff --git a/source3/passdb/util_unixsids.c b/source3/passdb/util_unixsids.c
index ce64dc2d88..1f830b35c5 100644
--- a/source3/passdb/util_unixsids.c
+++ b/source3/passdb/util_unixsids.c
@@ -64,7 +64,7 @@ bool lookup_unix_user_name(const char *name, struct dom_sid *sid)
struct passwd *pwd;
bool ret;
- pwd = getpwnam_alloc(talloc_tos(), name);
+ pwd = Get_Pwnam_alloc(talloc_tos(), name);
if (pwd == NULL) {
return False;
}