*/
static bool sddl_map_flags(const struct flag_map *map, const char *str,
uint32_t *pflags, size_t *plen,
- bool unknown_flag_is_part_of_next_thing)
+ bool unknown_flag_is_part_of_next_thing)
{
const char *str0 = str;
if (plen != NULL) {
* For ACL flags, unknown_flag_is_part_of_next_thing is set,
* and we expect some more stuff that isn't flags.
*
- * For ACE flags, unknown_flag_is_part_of_next_thing is unset,
- * and the flags have been tokenised into their own little
- * string. We don't expect anything here, even whitespace.
- */
- if (*str == '\0' || unknown_flag_is_part_of_next_thing) {
- return true;
- }
+ * For ACE flags, unknown_flag_is_part_of_next_thing is unset,
+ * and the flags have been tokenised into their own little
+ * string. We don't expect anything here, even whitespace.
+ */
+ if (*str == '\0' || unknown_flag_is_part_of_next_thing) {
+ return true;
+ }
DBG_WARNING("Unknown flag - '%s' in '%s'\n", str, str0);
- return false;
+ return false;
}
if (strncmp(sddl, "S-", 2) == 0) {
struct dom_sid *sid = NULL;
char *sid_str = NULL;
- const char *end = NULL;
- bool ok;
+ const char *end = NULL;
+ bool ok;
size_t len = strspn(sddl + 2, "-0123456789ABCDEFabcdefxX") + 2;
if (len < 5) { /* S-1-x */
return NULL;
if (sid_str == NULL) {
return NULL;
}
- sid = talloc(mem_ctx, struct dom_sid);
- if (sid == NULL) {
+ sid = talloc(mem_ctx, struct dom_sid);
+ if (sid == NULL) {
TALLOC_FREE(sid_str);
- return NULL;
- };
- ok = dom_sid_parse_endp(sid_str, sid, &end);
- if (!ok) {
+ return NULL;
+ };
+ ok = dom_sid_parse_endp(sid_str, sid, &end);
+ if (!ok) {
DBG_WARNING("could not parse SID '%s'\n", sid_str);
TALLOC_FREE(sid_str);
- TALLOC_FREE(sid);
- return NULL;
- }
+ TALLOC_FREE(sid);
+ return NULL;
+ }
if (end - sid_str != len) {
DBG_WARNING("trailing junk after SID '%s'\n", sid_str);
TALLOC_FREE(sid_str);
- TALLOC_FREE(sid);
- return NULL;
+ TALLOC_FREE(sid);
+ return NULL;
}
TALLOC_FREE(sid_str);
(*sddlp) += len;
static bool sddl_decode_access(const char *str, uint32_t *pmask)
{
const char *str0 = str;
- char *end = NULL;
+ char *end = NULL;
uint32_t mask = 0;
unsigned long long numeric_mask;
int err;
mask |= flags;
str += len;
}
- if (*str != '\0') {
+ if (*str != '\0') {
DBG_WARNING("Bad characters in '%s'\n", str0);
- return false;
- }
+ return false;
+ }
*pmask = mask;
return true;
}
static bool sddl_decode_guid(const char *str, struct GUID *guid)
{
- if (strlen(str) != 36) {
- return false;
- }
- return parse_guid_string(str, guid);
+ if (strlen(str) != 36) {
+ return false;
+ }
+ return parse_guid_string(str, guid);
}
struct GUID_txt_buf object_buf, iobject_buf;
const char *sddl_type="", *sddl_flags="", *sddl_mask="",
*sddl_object="", *sddl_iobject="", *sddl_trustee="";
-
tmp_ctx = talloc_new(mem_ctx);
if (tmp_ctx == NULL) {
DEBUG(0, ("talloc_new failed\n"));
&iobject_buf);
}
}
-
sddl_trustee = sddl_transition_encode_sid(tmp_ctx, &ace->trustee, state);
if (sddl_trustee == NULL) {
goto failed;