Bug 3520 - Misc. bugs in grid-mapfile-check-consistency
: Misc. bugs in grid-mapfile-check-consistency
: 4.0.0
: All All
: P3 normal
: ---
Assigned To:
  Show dependency treegraph
Reported: 2005-06-26 03:09 by
Modified: 2008-08-11 15:22 (History)



You need to log in before you can comment on or make changes to this bug.

Description From 2005-06-26 03:09:02
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.)
------- Comment #1 From 2005-09-07 13:55:56 -------
Chris is rewriting this in perl.
------- Comment #2 From 2005-10-13 15:41:20 -------
perl version of this script (written by chris) fixing all the issues raised has
been committed to trunk
------- Comment #3 From 2005-11-04 08:54:18 -------
Can the new version also be put on globus_4_0_0_branch?
------- Comment #4 From 2006-02-17 15:14:19 -------
The new version is now available in globus_4_0_branch as well.