Bug Report: aechown doesn't update recipient's user state file
Cal Webster <[email protected]>
| Newsgroups | gmane.comp.version-control.aegis.user |
|---|---|
| Message-ID | <1340036703.11102.8.camel@kc130ssa> |
Host platform: CentOS 6.2
Architecture: i386 and x86_64
Aegis versions affected: 4.24.4-rc1 and 4.24.3-1
[Symptoms]
Expected results: Developer is accustomed to omitting project and change
arguments in aegis commands when current working directory is within the
development tree.
Actual results: After executing aechown the recipient developer receives
an error when attempting to run aegis commands within his development
directory, requiring him to use arguments for project and change number.
We don't use aechown very often so this went unnoticed for some time. We
installed a previous version of Aegis (4.24.3-1) and found problem
present there as well.
[Problem Analysis]
Whenever Aegis admin changes owner of a change from one developer to
another, only the donor user's state file is modified to remove the
change. The recipient's state file is not touched. There are no errors
or warning raised when this happens, leading us to believe the code is
doing what it thinks is right.
Oddly, however, if the recipient is the Aegis admin executing the
aechown command both donor and recipient state files are properly
modified.
Only state files are affected. Development directories are properly
moved to the new developer and no other errors are raised.
[Bug in aechown.cc] Travis Clark, one of our developers and my primary
sysadmin, discovered that the routine apparently designed to modify the
user state files incorrectly points to the Aegis administrator
(cid.get_up()) state file instead of the recipient (up2) state files.
This explains why it only works if the Aegis admin is the intended
recipient.
[Fix]
Replaced "cid.get_up()" with "up2" as shown in patch below.
---%<-----------------------------------
aegis-4.24.3.orig/aegis/aechown.cc 2010-03-08 12:36:28.000000000 -0500
+++ aegis-4.24.3.new/aegis/aechown.cc 2012-06-14 14:50:37.314228016
-0400
@@ -385,7 +385,7 @@
change_cstate_write(cid.get_cp());
cid.get_pp()->pstate_write();
up1->ustate_write();
- cid.get_up()->ustate_write();
+ up2->ustate_write();
commit();
lock_release();
---%<-----------------------------------
[Confirmation testing]
Installed Aegis source RPM created during last RC1 update (4.24.4-rc1
from Walter).
Extracted aegis tar-ball, patched aechown.cc, re-packaged tar-ball, and
rebuilt RPMs.
Un-installed Aegis RPMs then re-installed patched, re-built, RPMs.
Changed ownership of a test change back and forth between developers.
Observed that both user state files were properly modified each time.
Cal Webster