quotacheck: change to the directory before opening it, not after

This avoids the race between opening the directory being scanned
and changing into that directory for processing its contants.

This is not the only race of that kind, but chdir return code
has to be checked anyway and the fix costs nothing, so let it be fixed.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jan Kara <jack@suse.cz>
1 file changed