summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>2003-06-10 17:18:07 +0000
committerRichard Sharpe <sharpe@samba.org>2003-06-10 17:18:07 +0000
commit09530bfa604ee60b62e10e638ab32e9c0059d65d (patch)
tree483000f8db415bd58ec53247286a90a57c5ced60
parent50585d4c04802749c2a5e275076d43e64a6c7260 (diff)
downloadsamba-09530bfa604ee60b62e10e638ab32e9c0059d65d.tar.gz
samba-09530bfa604ee60b62e10e638ab32e9c0059d65d.tar.bz2
samba-09530bfa604ee60b62e10e638ab32e9c0059d65d.zip
More updates on editreg.c to bring it better in line with the Samba source.
(This used to be commit dc69a638b9e12726f050d79b63f92f816c35fe8f)
-rw-r--r--source3/utils/editreg.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/source3/utils/editreg.c b/source3/utils/editreg.c
index 92a39c39e2..54148fdcf8 100644
--- a/source3/utils/editreg.c
+++ b/source3/utils/editreg.c
@@ -412,16 +412,16 @@ typedef struct val_list_s {
#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 {
@@ -432,7 +432,7 @@ 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;
@@ -537,7 +537,7 @@ typedef struct ace_struct {
unsigned char flags;
unsigned short length;
unsigned int perms;
- DOM_SID trustee;
+ sid_t trustee;
} REG_ACE;
typedef struct acl_struct {
@@ -904,7 +904,7 @@ int nt_delete_key_by_name(REGF *regf, char *name)
}
static
-int nt_delete_sid(DOM_SID *sid)
+int nt_delete_sid(sid_t *sid)
{
if (sid) free(sid);
@@ -1173,15 +1173,15 @@ VAL_KEY *nt_delete_reg_value(REG_KEY *key, char *name)
* Convert a string of the form S-1-5-x[-y-z-r] to a SID
*/
static
-int 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);
@@ -1226,7 +1226,7 @@ ACE *nt_create_ace(int type, int flags, unsigned int perms, const char *sid)
ace->type = type;
ace->flags = flags;
ace->perms = perms;
- if (!string_to_sid(&ace->trustee, sid))
+ if (!sid_string_to_sid(&ace->trustee, sid))
goto error;
return ace;
@@ -1287,8 +1287,8 @@ SEC_DESC *nt_create_def_sec_desc(REGF *regf)
tmp->rev = 1;
tmp->type = 0x8004;
- if (!string_to_sid(&tmp->owner, "S-1-5-32-544")) goto error;
- if (!string_to_sid(&tmp->group, "S-1-5-18")) goto error;
+ if (!sid_string_to_sid(&tmp->owner, "S-1-5-32-544")) goto error;
+ if (!sid_string_to_sid(&tmp->group, "S-1-5-18")) goto error;
tmp->sacl = NULL;
tmp->dacl = nt_create_default_acl(regf);
@@ -1829,9 +1829,9 @@ KEY_SEC_DESC *lookup_create_sec_key(REGF *regf, SK_MAP *sk_map, int sk_off)
* 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;
@@ -1916,12 +1916,12 @@ SEC_DESC *process_sec_desc(REGF *regf, REG_SEC_DESC *sec_desc)
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;
@@ -2618,7 +2618,7 @@ void *nt_alloc_regf_space(REGF *regf, int size, unsigned int *off)
* 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;
@@ -2686,7 +2686,7 @@ unsigned int sec_desc_size(SEC_DESC *sd)
* 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;
@@ -3864,7 +3864,7 @@ void print_perms(int perms)
}
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]);
@@ -3955,7 +3955,7 @@ int main(int argc, char *argv[])
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();
@@ -3987,7 +3987,7 @@ int main(int argc, char *argv[])
case 'O':
def_owner_sid_str = strdup(optarg);
regf_opt += 2;
- if (!string_to_sid(&lsid, def_owner_sid_str)) {
+ if (!sid_string_to_sid(&lsid, def_owner_sid_str)) {
fprintf(stderr, "Default Owner SID: %s is incorrectly formatted\n",
def_owner_sid_str);
free(&def_owner_sid_str[0]);