Re: [PATCH] C version of git-count-objects
- From
- Morten Welinder <mwelinder@gmail.com>
- Date
- Apr 27, 2006, 13:16 UTC
- Message-ID
- <118833cc0604270616u2961ab10waef5807c429be784@mail.gmail.com>
- In-Reply-To
- <20060427101254.GA22769@peppar.cs.umu.se>
> + if (access(subdir, R_OK | X_OK)) > + continue; > + chdir(subdir);
You've got yourself a needless race condition right there. Just do the chdir and check the return value. (And besides, access checks with the wrong set of permissions, should this ever end up in set[ug]id context.)
Morten