Tom Mueller (plain-text) wrote:
Please review these changes for fixing bug 1530.

bug: http://defect.opensolaris.org/bz/show_bug.cgi?id=1530
webrev: http://cr.opensolaris.org/~tmueller/ips-1530.1/

This change eliminates the traceback by checking to see if the owner and group for every file and directory action exists in the preinstall method of the actions. The fix takes into account having user and group actions in the same install set, so the user and group actions have to record what is going to happen in the imageplan. Also, the preinstall actions have to be executed in the same order as the install actions so that the user/group changes are recorded before the file/dir actions are checked.

There are two new exceptions that inherit from ActionExecutionError, UnknownUser and UnknownGroup.

The api version is advanced because the ImageInterface.prepare method can now through an ActionExecutionError exception. I advanced the API client version in the GUI code because it handles exceptions from the prepare method the same way as it handles exceptions from execute_plan. However, I noticed that it doesn't seem to handle ActionExecutionErrors directly, which is really a problem unrelated to this particular bug.

For a full image, not having a user or group is considered an error. pkg(1) now prints a message and returns 1. However, for a user image where the user is unable to change the ownership of a file anyway, not having the required user/group is ignored.

Thanks.

I'm just back from Burning Man; sorry for the late comments...

I guess I'm wondering why you're making the effort to predict which
errors will occur, rather than dealing with them if and when they do.

It would seem far less code, and would effect performance less.

BTW, what is the performance impact of these changes?


- Bart

--
Bart Smaalders                  Solaris Kernel Performance
[email protected]         http://blogs.sun.com/barts
"You will contribute more with mercurial than with thunderbird."
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to