]> git.michaelhowe.org Git - packages/o/openafs.git/commit
fs: fix setserverprefs where long is larger than afs_int32
authorMarc Dionne <marc.c.dionne@gmail.com>
Thu, 22 Sep 2011 00:31:33 +0000 (20:31 -0400)
committerDerrick Brashear <shadow@dementix.org>
Fri, 7 Oct 2011 12:39:25 +0000 (05:39 -0700)
commitdda39417e94e4463dd0fa49dddd918bc3a8765a6
treea351bb92a227d2c384f580346403819059fbf735
parenta16c594a127e9789215c1404c6cfa161dc090b07
fs: fix setserverprefs where long is larger than afs_int32

Make the fscanf and scanf format specifiers match the type of the
target variable.  This prevents trying to store a long int into an
afs_int32 variable which may be smaller, and overwriting neighbouring
data on the stack.

The effect on a 64-bit Linux system was that the high bits of "rank"
would overwrite the first 4 bytes of the scanned host name, causing
setserverprefs to fail with:
: couldn't resolve name.

Reviewed-on: http://gerrit.openafs.org/5486
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 649d3a0957eef0c607a63b47f11bd4a0ca8655ca)

Change-Id: I5869423a8512e6e5d64162b17a69106355ca3639
Reviewed-on: http://gerrit.openafs.org/5535
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/venus/fs.c