Bugzilla – Bug 3520
Misc. bugs in grid-mapfile-check-consistency
Last modified: 2008-08-11 15:22:05
You need to log in before you can comment on or make changes to this bug.
A quick look at grid-mapfile-check-consistency reveals a number of bugs. The word "writable" is misspelled throughout as "writeable". (Reference: Merriam-Webster Online Dictionary, www.m-w.com.) On one system, /etc/grid-security/grid-mapfile is a symbolic link to a file with permissions 444. If I run grid-mapfile-check-consistency from an account that doesn't own the grid-mapfile, it complains that it's world writable. It should be checking the permissions on the actual file, not on the symlink. Replacing "ls -l" with "ls -lL" should fix this. If I run grid-mapfile-check-consistency from the account that does own the grid-mapfile, it complains that it's not writable. A read-only grid-mapfile cannot be modified by grid-mapfile-{add,delete}-entry, but it's still a valid grid-mapfile. This should at least not be treated as a fatal error; it print a usage message and aborts without doing any further checks. (Note that gx-map maintains the grid-mapfile with permissions 444 by default.) The format of a grid-mapfile allows for comments introduced by a '#' character. The grid-mapfile-check-consistency doesn't recognize comments; it treats them as errors. The check for duplicate entries compares entire lines. As a result, it won't detect duplicate lines that differ only in insignificant whitespace. It does complain about duplicate lines consisting only of whitespace (though it doesn't complain about duplicate empty lines). The check for duplicate entries is probably redundant anyway, since grid-mapfile-check-consistency also checks for duplicate DNs (and this check appears to be done correctly). In my opinion, the whole thing would be significantly simpler, more efficient, and more robust if it were re-implemented in Perl rather than in Bourne shell. (I might take a stab at it myself, subject to time constraints.)
Chris is rewriting this in perl.
perl version of this script (written by chris) fixing all the issues raised has been committed to trunk
Can the new version also be put on globus_4_0_0_branch?
The new version is now available in globus_4_0_branch as well.