svn commit: samba r9745 - in branches/SOC/SAMBA_3_0/source: include
libmsrpc
skel at samba.org
skel at samba.org
Mon Aug 29 15:55:16 GMT 2005
Author: skel
Date: 2005-08-29 15:55:15 +0000 (Mon, 29 Aug 2005)
New Revision: 9745
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9745
Log:
CacLookupRidsRecord now stores a type, user or group
Modified:
branches/SOC/SAMBA_3_0/source/include/libmsrpc.h
branches/SOC/SAMBA_3_0/source/libmsrpc/cac_samr.c
Changeset:
Modified: branches/SOC/SAMBA_3_0/source/include/libmsrpc.h
===================================================================
--- branches/SOC/SAMBA_3_0/source/include/libmsrpc.h 2005-08-29 15:54:10 UTC (rev 9744)
+++ branches/SOC/SAMBA_3_0/source/include/libmsrpc.h 2005-08-29 15:55:15 UTC (rev 9745)
@@ -164,13 +164,20 @@
* @defgroup sam_defs SAM Definitions
* @{
*/
-struct cac_LookupRidsRecord {
+typedef struct _CACLOOKUPRIDSRECORD {
char *name;
uint32 rid;
+
+ /**If found, this will be one of:
+ * - USER_RID_TYPE
+ * - GROUP_RID_TYPE
+ * (found in include/rpc_misc.h)
+ */
+ uint32 type;
/*if the name or RID was looked up, then found = True*/
BOOL found;
-};
+} CacLookupRidsRecord;
typedef struct _CACUSERINFO {
/**Last logon time*/
@@ -1779,7 +1786,7 @@
uint32 num_names;
/**array contiaing the Names and RIDs*/
- struct cac_LookupRidsRecord *map;
+ CacLookupRidsRecord *map;
} out;
};
@@ -1810,7 +1817,7 @@
uint32 num_rids;
/**array contiaing the Names and RIDs*/
- struct cac_LookupRidsRecord *map;
+ CacLookupRidsRecord *map;
} out;
};
Modified: branches/SOC/SAMBA_3_0/source/libmsrpc/cac_samr.c
===================================================================
--- branches/SOC/SAMBA_3_0/source/libmsrpc/cac_samr.c 2005-08-29 15:54:10 UTC (rev 9744)
+++ branches/SOC/SAMBA_3_0/source/libmsrpc/cac_samr.c 2005-08-29 15:55:15 UTC (rev 9745)
@@ -22,7 +22,6 @@
#include "libmsrpc_internal.h"
/*used by cac_SamGetNamesFromRids*/
-#define SAMR_RID_FOUND 1
#define SAMR_RID_UNKNOWN 8
#define SAMR_ENUM_MAX_SIZE 0xffff
@@ -470,7 +469,7 @@
uint32 i = 0;
- struct cac_LookupRidsRecord *map_out;
+ CacLookupRidsRecord *map_out;
if(!hnd)
return CAC_FAILURE;
@@ -498,7 +497,7 @@
if(!NT_STATUS_IS_OK(hnd->status) && !NT_STATUS_EQUAL(hnd->status, STATUS_SOME_UNMAPPED))
return CAC_FAILURE;
- map_out = TALLOC_ARRAY(mem_ctx, struct cac_LookupRidsRecord, num_names_out);
+ map_out = TALLOC_ARRAY(mem_ctx, CacLookupRidsRecord, num_names_out);
if(!map_out) {
hnd->status = NT_STATUS_NO_MEMORY;
return CAC_FAILURE;
@@ -508,10 +507,12 @@
if(name_types_out[i] == SAMR_RID_UNKNOWN) {
map_out[i].found = False;
map_out[i].name = NULL;
+ map_out[i].type = 0;
}
else {
map_out[i].found = True;
map_out[i].name = talloc_strdup(mem_ctx, names_out[i]);
+ map_out[i].type = name_types_out[i];
}
map_out[i].rid = op->in.rids[i];
}
@@ -537,7 +538,7 @@
uint32 i = 0;
- struct cac_LookupRidsRecord *map_out;
+ CacLookupRidsRecord *map_out;
if(!hnd)
return CAC_FAILURE;
@@ -566,20 +567,23 @@
if(!NT_STATUS_IS_OK(hnd->status) && !NT_STATUS_EQUAL(hnd->status, STATUS_SOME_UNMAPPED))
return CAC_FAILURE;
- map_out = TALLOC_ARRAY(mem_ctx, struct cac_LookupRidsRecord, num_rids_out);
+ map_out = TALLOC_ARRAY(mem_ctx, CacLookupRidsRecord, num_rids_out);
if(!map_out) {
hnd->status = NT_STATUS_NO_MEMORY;
return CAC_FAILURE;
}
for(i = 0; i < num_rids_out; i++) {
+
if(rid_types_out[i] == SAMR_RID_UNKNOWN) {
map_out[i].found = False;
map_out[i].rid = 0;
+ map_out[i].type = 0;
}
else {
map_out[i].found = True;
map_out[i].rid = rids_out[i];
+ map_out[i].type = rid_types_out[i];
}
map_out[i].name = talloc_strdup(mem_ctx, op->in.names[i]);
More information about the samba-cvs
mailing list