Merge lp:~parthm/bzr/2.0_376388_dot_bazaar_ownership into lp:bzr/2.0
Proposed by
Parth Malwankar
Status: | Rejected |
---|---|
Rejected by: | Martin Pool |
Proposed branch: | lp:~parthm/bzr/2.0_376388_dot_bazaar_ownership |
Merge into: | lp:bzr/2.0 |
Diff against target: |
124 lines (+56/-3) 4 files modified
NEWS (+5/-0) bzrlib/config.py (+4/-2) bzrlib/osutils.py (+42/-0) bzrlib/trace.py (+5/-1) |
To merge this branch: | bzr merge lp:~parthm/bzr/2.0_376388_dot_bazaar_ownership |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Pool | Needs Fixing | ||
Review via email: mp+19593@code.launchpad.net |
To post a comment you must log in.
This patch fixes bug #376388
It ensure that .bazaar, .bazaar/bazaar.conf and .bzr.log when created
by bzr run under sudo, have the same usr/grp ownership as the containing
folder and not root.
copy_ownership(src, dst) function copies user and group ownership
from src to dst. copy_ownership does nothing on windows.
This function is used during creation of .bazaar, .bazaar/bazaar.conf
and .bzr.log.
.bzr.log location of /dev/null and NUL are ignored.
This was tested by creating a user 'sandbox' and running
'sudo bzr whoami a@b'. The latter creates the above files with
the correct ownership.
I am not sure what would be a good way to write a automated test case
for this. Any ideas/suggestion are welcome. I would be happy to
implement them.
Below is the log of the manual test run:
sandbox@ parthm- laptop: ~$ ls -la .bazaar .bzr.log .bazaar/bazaar.conf bazaar. conf: No such file or directory
ls: cannot access .bazaar: No such file or directory
ls: cannot access .bzr.log: No such file or directory
ls: cannot access .bazaar/
sandbox@ parthm- laptop: ~$ sudo /storage/ parth/src/ bzr.dev/ 2.0_376388_ dot_bazaar_ ownership/ bzr whoami a@b
[sudo] password for sandbox:
sandbox@ parthm- laptop: ~$ ls -la .bazaar .bzr.log .bazaar/ bazaar. conf-rw- r--r-- 1 sandbox sandbox 22 2010-02-18 18:13 .bazaar/bazaar.conf
-rw-r--r-- 1 sandbox sandbox 727 2010-02-18 18:13 .bzr.log
.bazaar: parthm- laptop: ~$
total 12
drwxr-xr-x 2 sandbox sandbox 4096 2010-02-18 18:13 .
drwxr-xr-x 4 sandbox sandbox 4096 2010-02-18 18:13 ..
-rw-r--r-- 1 sandbox sandbox 22 2010-02-18 18:13 bazaar.conf
sandbox@