auth: Don't overflow hostName array
authorSimon Wilkinson <sxw@your-file-system.com>
Sat, 2 Mar 2013 09:59:20 +0000 (09:59 +0000)
committerJeffrey Altman <jaltman@your-file-system.com>
Thu, 7 Mar 2013 15:53:26 +0000 (07:53 -0800)
commitfed5dac9f25f7fbd74b6834ce6f087eaf31be2f2
treebeefea1c9a70277841c392a9f0fb1629c2565c99
parent79abe9d68ea041a2ea6261c6f7bb1f055a45bf0a
auth: Don't overflow hostName array

afsconf_cell's hostName structure is a fixed length. Don't overflow
it by writing whatever comes back from gethostbyaddr into it. Use
strlcpy to catch an overflow, and if one occurs, just use
"UNKNOWNHOST", rather than a truncated host name.

Caught by coverity (#985906)

Change-Id: Iaa927f3e4860d99166789e8dc4950a03ea2237e4
Reviewed-on: http://gerrit.openafs.org/9354
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
src/auth/writeconfig.c