summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_samr.c38
-rw-r--r--source3/rpc_server/srv_util.c12
2 files changed, 13 insertions, 37 deletions
diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c
index adc16fa5c8..d1503a762e 100644
--- a/source3/rpc_server/srv_samr.c
+++ b/source3/rpc_server/srv_samr.c
@@ -860,41 +860,21 @@ static void api_samr_open_user( int uid, prs_struct *data, prs_struct *rdata)
/*************************************************************************
get_user_info_21
*************************************************************************/
-static BOOL get_user_info_21(SAM_USER_INFO_21 *id21, uint32 rid)
+static BOOL get_user_info_21(SAM_USER_INFO_21 *id21, uint32 user_rid)
{
NTTIME dummy_time;
struct sam_passwd *sam_pass;
LOGON_HRS hrs;
int i;
- /*
- * Convert from rid to either a uid or gid as soon as
- * possible. JRA.
- */
-
- if(pdb_rid_is_user(rid))
- {
- uint32 uid = pdb_user_rid_to_uid(rid);
- become_root(True);
- sam_pass = getsam21pwuid(uid);
- unbecome_root(True);
- }
- else
- {
- struct group *grent;
- uint32 gid;
- gid = pdb_group_rid_to_gid(rid);
- if((grent = getgrgid(gid)) == NULL)
- {
- DEBUG(0,("get_user_info_21: Unable to get group info.\n"));
- return False;
- }
- /* TODO - at this point we need to convert from
- a UNIX struct group into a user info 21 structure.
- Punt for now. JRA.
- */
- return False;
- }
+ if (!pdb_rid_is_user(user_rid))
+ {
+ return False;
+ }
+
+ become_root(True);
+ sam_pass = getsam21pwrid(user_rid);
+ unbecome_root(True);
if (sam_pass == NULL)
{
diff --git a/source3/rpc_server/srv_util.c b/source3/rpc_server/srv_util.c
index 15c06d18bd..fca37db717 100644
--- a/source3/rpc_server/srv_util.c
+++ b/source3/rpc_server/srv_util.c
@@ -394,8 +394,7 @@ uint32 lookup_alias_name(uint32 rid, char *alias_name, uint32 *type)
********************************************************************/
uint32 lookup_user_name(uint32 rid, char *user_name, uint32 *type)
{
- struct smb_passwd *smb_pass;
- uint32 unix_uid;
+ struct sam_disp_info *disp_info;
int i = 0;
(*type) = SID_NAME_USER;
@@ -414,17 +413,14 @@ uint32 lookup_user_name(uint32 rid, char *user_name, uint32 *type)
return 0x0;
}
- unix_uid = pdb_uid_to_user_rid(rid);
- DEBUG(5,(" uid: %d", unix_uid));
-
/* ok, it's a user. find the user account */
become_root(True);
- smb_pass = getsmbpwuid(rid); /* lkclXXXX SHOULD use rid mapping here! */
+ disp_info = getsamdisprid(rid);
unbecome_root(True);
- if (smb_pass != NULL)
+ if (disp_info != NULL)
{
- fstrcpy(user_name, smb_pass->smb_name);
+ fstrcpy(user_name, disp_info->smb_name);
DEBUG(5,(" = %s\n", user_name));
return 0x0;
}