Bug 32235 - dns/host_record with no IP is not shown / deletable
dns/host_record with no IP is not shown / deletable
Status: RESOLVED DUPLICATE of bug 40839
Product: UCS
Classification: Unclassified
Component: UMC - DNS
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 3.2-x
Assigned To: UMC maintainers
:
: 24652 31969 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-13 16:11 CEST by Philipp Hahn
Modified: 2017-07-11 17:04 CEST (History)
4 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2013-08-13 16:11:11 CEST
I created an dns/host_record without an IP address by accident.
This is possible from both the UMC and the CLI.
After that the entry is not shown in the list of zone entries.
Only ldapsearch finds the entry.
Creating an entry fails with "E: object exists: relativeDomainName=foo,zoneName=pmhahn.de,dc=phahn,dc=dev"

zone="$(udm dns/forward_zone list | sed -ne 's/^DN: //;T;p;q')"
udm dns/host_record create --superordinate "$zone" --set name=foo
udm dns/host_record list --superordinate "$zone"
univention-ldapsearch -xLLLb "$zone" relativeDomainName=foo

Theres a discepancy in the handler#lookup() function, which requires one of the 3 RRs 'aRecord', 'aAAARecord', or 'mXRecord' being set, but all properties are defines as optional (required=0).
Comment 1 Philipp Hahn univentionstaff 2013-08-13 16:23:50 CEST
Similar for txt_record: There at least one entry should be required.

index db6f32a..d5b89ae 100644
--- a/branches/ucs-3.2/ucs-3.2-0/management/univention-directory-manager-modules/modules/univention/admin/handlers/dns/txt_record.py
+++ b/branches/ucs-3.2/ucs-3.2-0/management/univention-directory-manager-modules/modules/univention/admin/handlers/dns/txt_record.py
@@ -78,7 +78,7 @@ property_descriptions={
                        syntax = univention.admin.syntax.string,
                        multivalue = True,
                        options = [],
-                       required = False,
+                       required = True,
                        may_change = True
                )
 }


Also notice, that a host_record created with only an TXT entry is _not_ shown in UMC, but the the CLI does find it as a dns/txt_record type. (both UDM modules overlap when handling TXT records.)
Comment 2 Philipp Hahn univentionstaff 2013-08-13 16:25:41 CEST
The entries are still visible in the LDAP navigation and can be modified there.
Comment 3 Florian Best univentionstaff 2016-03-10 13:42:43 CET
It is displayed in the LDAP directory tree because it contains univentionObjectType: dns/host_record. The lookup() function is used if the search is for an explicit object type (like dns/host_record, or dns/dns). The LDAP directory doesn't use lookup() but it searchs for all objects and finds out the type via univention.admin.modules.objectType().
Comment 4 Florian Best univentionstaff 2016-10-18 14:17:54 CEST
I stumbled on this today:

# eval "$(ucr shell)"
# udm dns/host_record create --superordinate "zoneName=univention.intranet,cn=dns,$ldap_base" --set name=foo
Object created: relativeDomainName=foo,zoneName=univention.intranet,cn=dns,dc=univention,dc=intranet
# udm dns/host_record remove --dn "relativeDomainName=foo,zoneName=univention.intranet,$ldap_base"
E: object not found

Reason is the filter which doesn't match because no aRecord/aAAARecord/mXRecord is set:
univention-ldapsearch -LLL -b relativeDomainName=foo,zoneName=oldschool.local,cn=dns,ou=oldschool,dc=school,dc=local '(&(objectClass=dNSZone)(!(relativeDomainName=@))(!(zoneName=*.in-addr.arpa))(!(zoneName=*.ip6.arpa))(!(cNAMERecord=*))(!(sRVRecord=*))(|(aRecord=*)(aAAARecord=*)(mXRecord=*))(zoneName=oldschool.local))'
Comment 5 Florian Best univentionstaff 2016-10-21 15:47:23 CEST
*** Bug 24652 has been marked as a duplicate of this bug. ***
Comment 6 Florian Best univentionstaff 2016-11-05 00:35:45 CET
*** Bug 31969 has been marked as a duplicate of this bug. ***
Comment 7 Florian Best univentionstaff 2017-07-11 17:04:26 CEST
I fixed this during Bug #40839. The detection of dns/host_record's without aRecord/aAAARecord/txtRecord/mxRecord is now possible if univentionObjectType=dns/host_record is set. What is missing is setting any of the properties to required. REOPEN this bug if this should be done.

*** This bug has been marked as a duplicate of bug 40839 ***