vos: convertROtoRW susceptible to VLDB changes during override prompt
authorMark Vitale <mvitale@sinenomine.net>
Mon, 20 Aug 2012 21:39:06 +0000 (17:39 -0400)
committerDerrick Brashear <shadow@dementix.org>
Wed, 22 Aug 2012 19:25:06 +0000 (12:25 -0700)
commit3c489db55811dfe3fdf5e555bf229989e5b58aa6
treeb2a66fc76301655b16765bb82b2df3f3f30896f0
parent185699e631ec3548bb6d1e68302d4a652632d3e6
vos: convertROtoRW susceptible to VLDB changes during override prompt

vos convertROtoRW obtains a VLDB entry, then peforms some setup logic
(including a possible user prompt) before obtaining a volume lock.
This exposes the code to possible time-of-check/time-of-use issues.
After obtaining the volume lock, get a second copy of the VLDB entry
and compare it to the first copy; if it has changed, fail the conversion
with an error message asking the user to re-issue the vos convertROtoRW
command.

Change-Id: I9c1a634cea2e22188869d54b00b7831aed12b1cd
Reviewed-on: http://gerrit.openafs.org/8008
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/volser/vos.c