Ticket #29 (closed enhancement: fixed)
source steps should 'chmod -R u+w' before deleting old directory
| Reported by: | warner | Owned by: | warner |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.7.6 |
| Version: | Keywords: | ||
| Cc: |
Description
Every once in a while, a source tree gets some files set to u-w (either due to an interrupted checkout, or test cases that fiddle with permissions as they run and then fail to set them back again). When a Source step with mode=clobber or mode=copy tries to delete these files, it gets an exception.
The Source step should do a 'chmod -R u+w workdir' before trying to delete the tree, to avoid this problem.
Change History
comment:2 Changed 5 years ago by warner
- Status changed from new to closed
- Resolution set to fixed
I've committed a modified form of this patch: rather than looking in the child and chmoding everything there before entering, I just chmod the directory upon entry and the file just before deletion. I wrote up a unit test that seems to cover everything.
closing this one out. thanks for the patch!
![[Buildbot Logo]](/chrome/site/header-text-transparent.png)
Here is a patch (not fully tested, just unit tested locally) that should change permissions to 0700 on each file before removing to ensure that it can remove the file instead of assuming that it is possible. I did 0700 instead of 0600 since 0600 directories can not be removed: