Re: xfs initscript enhancements, take 5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 11 Oct 2003, Philip Rowlands wrote:

>OK; this is a revision of the patched file. The claimed improvements
>are:
>
>- Add double-quotes to all variables, for safety against evil vars e.g.
>";rm -rf ..;"

Looks ok to me - applied.

>- Reduction/readability. This isn't to turn the script into a write-only
>Perl-style monstrosity, but I find smaller scripts easy to brain-parse.

Sensible in many cases.  I strive for both readability and also 
avoid crypticism where possible.

>- Layout. Might want to use diff -b to compare.

Yup, but it is always best and preferred when fixing/enhancing a 
piece of code - C, shell, etc. to do functional bug fixes, 
enhancements separately, or in some cases together, but always do 
whitespace/formatting changes separately.  It's often difficult 
to grok the scope of a patch that mixes functional and 
nonfunctional changes.  Not much of a problem with this case 
though.  ;o)

>- Eliminate duplicates from chkfontpath

Sane, applied.

>- Assumed that umask works correctly, and remove chmod lines

The chmod lines were there originally because umask wasn't in the 
script, and mkfontdir was affected by it.  A patch to mkfontdir 
ended up being broken and going unnoticed, and later umask was 
added to the initscript.  At that time, I added quadruple 
redundancy to ensure the permissions on those files are always 
mode 0644 at all costs.  ;o)  I agree it is redundant though.

Removed.

>>If anyone is interested in debugging and/or fixing fontconfig in Red
>>Hat Linux 8.0, that would be nice, however I'll likely still need the
>>initscript hack anyway.
>
>I've added a HOME, which prevents the SEGV.

Applied.

>I couldn't see any good reason for the "umask 133", so changed it to
>022.

Because the fonts.dir and other files generated by mkfontdir et 
al should always be mode 0644 or 0444.  XFree86's default is the 
latter, but I prefer the former.  Using umask 022 would make the 
files mode 0755 by default, however the files should never be 
executable.

Our mkfontdir now forces permissions to 0644, however I'm leaving 
the umask in there as a safeguard, as the mkfontdir patch hasn't 
been accepted upstream, and I want a fallback if the patch gets 
disabled by accident or something in the future as we've had lots 
of problems due to the permissions of these files in the past.

>Is there a reason for using the -cnewer test rather than -mnewer? Is it
>important to rebuild after changes to file metadata?

* Mon Sep 17 2001 Mike A. Harris <mharris@xxxxxxxxxx>
- Changed xfs initscript to use find -cnewer instead of -newer to 
  fix bug (#53737)


Thanks for the fixes/suggestions.  Some of them will be in the 
next build.

Take care!
TTYL


_______________________________________________
xfree86-list mailing list
xfree86-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/xfree86-list
IRC: #xfree86 on irc.redhat.com

[Red Hat General]     [Red Hat Watch]     [Red Hat Development]     [Kernel Development]     [Yosemite Camping]

  Powered by Linux