David.Comay at Sun.COM wrote:
> >> usr/src/lib/libc/port/regex/wordexp.c
> 
> >>         Line 151 - Cstyle error - continuation lines should be indented
> >>         four spaces.
> >
> > Uhm... cstyle doesn't complain:
> > -- snip --
> > $ cstyle -P
> > /home/gisburn/ksh93/on_build1/test1_x86/usr/src/lib/libc/port/regex/wordexp.c
> > $ cstyle -p
> > /home/gisburn/ksh93/on_build1/test1_x86/usr/src/lib/libc/port/regex/wordexp.c
> > $ cstyle -pP
> > /home/gisburn/ksh93/on_build1/test1_x86/usr/src/lib/libc/port/regex/wordexp.c
> > $ cstyle
> > /home/gisburn/ksh93/on_build1/test1_x86/usr/src/lib/libc/port/regex/wordexp.c
> 
> Unfortunately, cstyle(1) doesn't flag "Cstyle" issues.  In the case of
> continuation liesn, you need to add the "-c" flag to the program and
> even then it will flag lines which aren't in error.  Someday, perhaps
> it can be turned on by default.

Fixed (I had some problems figuring out how this works and finally
copied-over the lines from usr/src/cmd/zonename/zonename.c to get it
working (IMO the documentation could be a little bit clearer how the
algorithm works/should work)).

> >>         Lines 217-226 - Could you provide more details here?  Is
> >>         /usr/lib/libc/libc_wordexp_commands another interface that can
> >>         be customized by users?
> >
> > No, it is not intended as official interface. The path could be named
> > /chicken/monster/has/rabies/ or something like that (pointing to a
> > non-existing location to prevent the execution of path-bound commands
> > when the shell runs in restricted mode (the only commands which can be
> > used are "print" and "sleep" which are safe to use, e.g. both cannot be
> > used to escape the restricted shell "jail")). ${PATH} is set to a
> > location which is more or less "guranteed" to be not accessible by
> > normal users and IMO the ${PATH} element should have a descriptive name.
> 
> Sigh.  Instead of something that looks like a valid path name,

Well, during development we populated
"/usr/lib/libc/libc_wordexp_commands/" for testing... :-)

> how
> about /no/such/path?

Well, yes... but my preference would be something like
"/usr/no/such/path/element/" (assuming that admin-created things like
automounter roots may be created in "/" and not in "/usr") to make sure
that this is in a read-only location (maybe even as a CPP symbol (e.g.
|#define NOSUCHDIRECTORY "/usr/no/such/dir/ectory/"| that other
applications use the same path for the same task (but I guess we would
need an ARC case for such a #define, right ?)).

... anyway... fixed (by setting "PATH=/usr/no/such/path/element/").

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)

Reply via email to