mirror of
https://github.com/samba-team/samba.git
synced 2025-08-30 17:49:30 +03:00
s4 dns: Implement dns name equality check
This commit is contained in:
@ -55,6 +55,7 @@ WERROR dns_server_process_update(struct dns_server *dns,
|
|||||||
|
|
||||||
uint8_t werr_to_dns_err(WERROR werror);
|
uint8_t werr_to_dns_err(WERROR werror);
|
||||||
bool dns_name_match(const char *zone, const char *name, size_t *host_part_len);
|
bool dns_name_match(const char *zone, const char *name, size_t *host_part_len);
|
||||||
|
bool dns_name_equal(const char *name1, const char *name2);
|
||||||
WERROR dns_name2dn(struct dns_server *dns,
|
WERROR dns_name2dn(struct dns_server *dns,
|
||||||
TALLOC_CTX *mem_ctx,
|
TALLOC_CTX *mem_ctx,
|
||||||
const char *name,
|
const char *name,
|
||||||
|
@ -100,6 +100,15 @@ bool dns_name_match(const char *zone, const char *name, size_t *host_part_len)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Names are equal if they match and there's nothing left over */
|
||||||
|
bool dns_name_equal(const char *name1, const char *name2)
|
||||||
|
{
|
||||||
|
size_t host_part_len;
|
||||||
|
bool ret = dns_name_match(name1, name2, &host_part_len);
|
||||||
|
|
||||||
|
return ret && (host_part_len == 0);
|
||||||
|
}
|
||||||
|
|
||||||
WERROR dns_name2dn(struct dns_server *dns,
|
WERROR dns_name2dn(struct dns_server *dns,
|
||||||
TALLOC_CTX *mem_ctx,
|
TALLOC_CTX *mem_ctx,
|
||||||
const char *name,
|
const char *name,
|
||||||
|
Reference in New Issue
Block a user