/* Map generic permissions to file object specific permissions */
-const struct generic_mapping file_generic_mapping;
+extern const struct generic_mapping file_generic_mapping;
static int delete_fn(struct db_record *rec, void *priv)
{
{
const char *vstring = "INFO/version";
int32 vers_id;
-
+
if (share_db != NULL) {
return True;
}
state_path("share_info.tdb"), strerror(errno) ));
return False;
}
-
+
vers_id = dbwrap_fetch_int32(share_db, vstring);
if (vers_id == SHARE_DATABASE_VERSION_V2) {
return true;
SEC_DESC *get_share_security_default( TALLOC_CTX *ctx, size_t *psize, uint32 def_access)
{
- SEC_ACCESS sa;
+ uint32_t sa;
SEC_ACE ace;
SEC_ACL *psa = NULL;
SEC_DESC *psd = NULL;
se_map_generic(&spec_access, &file_generic_mapping);
- init_sec_access(&sa, def_access | spec_access );
+ sa = (def_access | spec_access );
init_sec_ace(&ace, &global_sid_World, SEC_ACE_TYPE_ACCESS_ALLOWED, sa, 0);
if ((psa = make_sec_acl(ctx, NT4_ACL_REVISION, 1, &ace)) != NULL) {
char *key;
NTSTATUS status;
+ if (!share_info_db_init()) {
+ return False;
+ }
+
if (!(key = talloc_asprintf(talloc_tos(), "SECDESC/%s",
servicename))) {
return False;
NTSTATUS status;
SEC_DESC *psd = NULL;
size_t sd_size;
- bool ret = True;
psd = get_share_security(talloc_tos(), sharename, &sd_size);
return True;
}
- ret = se_access_check(psd, token, desired_access, &granted, &status);
+ status = se_access_check(psd, token, desired_access, &granted);
TALLOC_FREE(psd);
- return ret;
+ return NT_STATUS_IS_OK(status);
}
/***************************************************************************
}
for (i = 0; i < num_aces; i++) {
- SEC_ACCESS sa;
+ uint32_t sa;
uint32 g_access;
uint32 s_access;
DOM_SID sid;
pacl++; /* Go past any ',' */
se_map_generic(&s_access, &file_generic_mapping);
- init_sec_access(&sa, g_access | s_access );
+ sa = (g_access | s_access);
init_sec_ace(&ace_list[i], &sid, type, sa, 0);
}