auth: Simplify DNS lookups with asprintf
authorSimon Wilkinson <sxw@your-file-system.com>
Wed, 16 May 2012 19:27:22 +0000 (20:27 +0100)
committerDerrick Brashear <shadow@dementix.org>
Thu, 24 May 2012 15:48:55 +0000 (08:48 -0700)
commit8961793dbbae2f8b213372906a281dc38c77186c
treedc531c4377566351f9f1b89c35baeb4e9dc8d625
parent044785d587b15e02855b6c9e396d27db962d867a
auth: Simplify DNS lookups with asprintf

Instead of allocing a maximal string, and using snprintf to
construct each possible DNS search string, just use asprintf to
construct each string. This greatly simplifies the code, and makes
it much less likely that maths errors can creep in causing buffer
overflows in the future. The downside is that we have more round
trips to the allocator, but that shouldn't matter in this context.

Change-Id: Iae9ab7d45f454c90a937354c71c9ec7fa2c55b69
Reviewed-on: http://gerrit.openafs.org/7452
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/auth/cellconfig.c