#define MAXSUBAUTHS 15
#endif
-typedef struct dom_sid_s {
+typedef struct sid_s {
unsigned char ver, auths;
unsigned char auth[6];
unsigned int sub_auths[MAXSUBAUTHS];
-} DOM_SID;
+} sid_t;
typedef struct ace_struct_s {
unsigned char type, flags;
unsigned int perms; /* Perhaps a better def is in order */
- DOM_SID *trustee;
+ sid_t *trustee;
} ACE;
typedef struct acl_struct_s {
typedef struct sec_desc_s {
unsigned int rev, type;
- DOM_SID *owner, *group;
+ sid_t *owner, *group;
ACL *sacl, *dacl;
} SEC_DESC;
unsigned char flags;
unsigned short length;
unsigned int perms;
- DOM_SID trustee;
+ sid_t trustee;
} REG_ACE;
typedef struct acl_struct {
}
static
-int nt_delete_sid(DOM_SID *sid)
+int nt_delete_sid(sid_t *sid)
{
if (sid) free(sid);
* Convert a string of the form S-1-5-x[-y-z-r] to a SID
*/
static
-int sid_string_to_sid(DOM_SID **sid, const char *sid_str)
+int sid_string_to_sid(sid_t **sid, const char *sid_str)
{
int i = 0, auth;
const char *lstr;
- *sid = (DOM_SID *)malloc(sizeof(DOM_SID));
+ *sid = (sid_t *)malloc(sizeof(sid_t));
if (!*sid) return 0;
- bzero(*sid, sizeof(DOM_SID));
+ bzero(*sid, sizeof(sid_t));
if (strncmp(sid_str, "S-1-5", 5)) {
fprintf(stderr, "Does not conform to S-1-5...: %s\n", sid_str);
* We could allocate the SID to be only the size needed, but I am too lazy.
*/
static
-DOM_SID *dup_sid(DOM_SID *sid)
+sid_t *dup_sid(sid_t *sid)
{
- DOM_SID *tmp = (DOM_SID *)malloc(sizeof(DOM_SID));
+ sid_t *tmp = (sid_t *)malloc(sizeof(sid_t));
int i;
if (!tmp) return NULL;
IVAL(&sec_desc->group_off));
if (verbose) fprintf(stdout, "SEC_DESC DACL Off: %0X\n",
IVAL(&sec_desc->dacl_off));
- tmp->owner = dup_sid((DOM_SID *)((char *)sec_desc + IVAL(&sec_desc->owner_off)));
+ tmp->owner = dup_sid((sid_t *)((char *)sec_desc + IVAL(&sec_desc->owner_off)));
if (!tmp->owner) {
free(tmp);
return NULL;
}
- tmp->group = dup_sid((DOM_SID *)((char *)sec_desc + IVAL(&sec_desc->group_off)));
+ tmp->group = dup_sid((sid_t *)((char *)sec_desc + IVAL(&sec_desc->group_off)));
if (!tmp->group) {
free(tmp);
return NULL;
* Compute the size of a SID stored ...
*/
static
-unsigned int sid_size(DOM_SID *sid)
+unsigned int sid_size(sid_t *sid)
{
unsigned int size;
* Store a SID at the location provided
*/
static
-int nt_store_SID(REGF *regf, DOM_SID *sid, unsigned char *locn)
+int nt_store_SID(REGF *regf, sid_t *sid, unsigned char *locn)
{
int i;
unsigned char *p = locn;
}
static
-void print_sid(DOM_SID *sid)
+void print_sid(sid_t *sid)
{
int i, comps = sid->auths;
fprintf(stdout, "S-%u-%u", sid->ver, sid->auth[5]);
char *cmd_file_name = NULL;
char *out_file_name = NULL;
CMD_FILE *cmd_file = NULL;
- DOM_SID *lsid;
+ sid_t *lsid;
if (argc < 2) {
usage();