URL:
https://github.com/SSSD/sssd/pull/883
Title: #883: Minor fixes to util/sss_krb5
alexey-tikhonov commented:
"""
Hi,
I only have a minor nitpick about ` static char buff[512];`. The
`512` comes a bit out of the blue and one might ask why not 256 or 1024? I'd like to
ask you to either add a comment that 512 is consider sufficient to store any kind of
keytab description or use something like `sizeof("FILE:")+PATH_MAX` as size.
Thank you. I opted to add a comment (and rebased on current master).
In regards of PATH_MAX:
1) If I understand correctly, this value is merely max buffer size of some syscalls. It
has nothing to do with actual maximum file path length (which can be literally arbitrary).
Some details can be found
[
here](http://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html) and
[
here](https://eklitzke.org/path-max-is-tricky). Thus IMO it doesn't actually
guarantee that result will fit a buffer (but rather suggests a false assurance of this and
so is a little bit misleading).
2) Additionally posix [doesn't
guarantee](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limi...
PATH_MAX to be constant/defined at all and (even if defined) different platforms use
different headers for this definition, so it is tricky to use this properly.
"""
See the full comment at
https://github.com/SSSD/sssd/pull/883#issuecomment-543729534