mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-25 16:31:08 -06:00
3f59118ffc
ipa_sam was modifying the buffer returned by ipa_gethostfqdn(). Subsequent calls to ipa_gethostfqdn() returned the corrupt data, causing other operations to fail. Update ipa_sam to copy the string and modify the copy. Also document this characteristic of ipa_gethostfqdn() and explain that callers must not modify the returned data. Part of: https://pagure.io/freeipa/issue/8501 Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
23 lines
717 B
C
23 lines
717 B
C
/*
|
|
* Copyright (C) 2020 FreeIPA Contributors see COPYING for license
|
|
*/
|
|
|
|
/* FQDN host name length including trailing NULL byte
|
|
*
|
|
* This may be longer than HOST_NAME_MAX. The hostname (effectively uname()'s
|
|
* node name) is limited to 64 characters on Linux. ipa_gethostfqdn() returns
|
|
* a FQDN from NSS which can be up to 255 octets including NULL byte.
|
|
* Effectively the FQDN is 253 ASCII characters.
|
|
*/
|
|
#define IPA_HOST_FQDN_LEN 255
|
|
|
|
/* Get the host FQDN.
|
|
*
|
|
* Returns a null-terminated static char[]. The string length is
|
|
* at most IPA_HOST_FQDN_LEN - 1. The caller MUST NOT modify this
|
|
* buffer. If modification could occur, the caller MUST copy
|
|
* the string.
|
|
*/
|
|
const char*
|
|
ipa_gethostfqdn(void);
|