Fix input size computation in SetSPrefs pioctl

Patchset 718f85a8b6 contained
a small typo that prevents the SetSPrefs pioctl processing from
functioning in all cases.  fs setserverprefs continues to work
for non-DB preference lists because fs.c pokeServers() attempts
to try the old SetSPrefs33 pioctl in the non-DB server case.

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

Change-Id: I2226334c558bdc4d24e17d32751154f99f2a53a6
Reviewed-on: http://gerrit.openafs.org/5566
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
Jeffrey Altman 2011-09-19 10:35:11 -04:00 committed by Jeffrey Altman
parent be937e205a
commit 8c9187a127

View File

@ -3949,7 +3949,7 @@ DECL_PIOCTL(PSetSPrefs)
ssp = (struct setspref *)ainPtr; ssp = (struct setspref *)ainPtr;
if (ainSize < (sizeof(struct setspref) if (ainSize < (sizeof(struct setspref)
+ sizeof(struct spref) * ssp->num_servers-1)) + sizeof(struct spref) * (ssp->num_servers-1)))
return EINVAL; return EINVAL;
afs_setsprefs(&(ssp->servers[0]), ssp->num_servers, afs_setsprefs(&(ssp->servers[0]), ssp->num_servers,