File tree Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -708,11 +708,29 @@ __xml_acl_post_process(xmlNode * xml)
708
708
xmlNode * cIter = __xml_first_child (xml );
709
709
xml_private_t * p = xml -> _private ;
710
710
711
- if (is_set (p -> flags , xpf_created ) && __xml_acl_check (xml , NULL , xpf_acl_write ) == FALSE) {
712
- char * path = xml_get_path (xml );
713
- crm_trace ("Cannot add new node %s at %s" , crm_element_name (xml ), path );
714
- free_xml (xml );
715
- return ;
711
+ if (is_set (p -> flags , xpf_created )) {
712
+ xmlAttr * xIter = NULL ;
713
+
714
+ /* Always allow new scaffolding, ie. node with no attributes or only an 'id' */
715
+
716
+ for (xIter = crm_first_attr (xml ); xIter != NULL ; xIter = xIter -> next ) {
717
+ const char * prop_name = (const char * )xIter -> name ;
718
+
719
+ if (strcmp (prop_name , XML_ATTR_ID ) == 0 ) {
720
+ /* Delay the acl check */
721
+ continue ;
722
+
723
+ } else if (__xml_acl_check (xml , NULL , xpf_acl_write )) {
724
+ crm_trace ("Creation of %s=%s is allowed" , crm_element_name (xml ), ID (xml ));
725
+ break ;
726
+
727
+ } else {
728
+ char * path = xml_get_path (xml );
729
+ crm_trace ("Cannot add new node %s at %s" , crm_element_name (xml ), path );
730
+ free_xml (xml );
731
+ return ;
732
+ }
733
+ }
716
734
}
717
735
718
736
while (cIter != NULL ) {
You can’t perform that action at this time.
0 commit comments