This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[ls PATCH] Re: ntsec odds and ends


On Thu, 6 Feb 2003, Igor Pechtchanski wrote:

> <WILD>
> I just had another really wild idea (feel free to ignore): since we want
> this visible in the "ls" output, suppose ls recognized these special names
> you are going to use (whatever they are), and used the existing
> "--color=auto" mechanism to output them in red to the terminal (and same
> with numeric values, I guess)?  I mean, ls *never* colors the user and
> group names, so it would be immediately visible...  Of course, the
> drawback is that we might need to allow the user to customize this (the
> color and all)...  Once the names for unknown user/group is decided, I
> might take a stab at making this patch to "ls".
> </WILD>

Well, I'm not at all sure this is the right list for it, but here's a
patch to ls that implements the above (except color control, but that can
be added).  The invalid user/group names will be colored bright white on
red if the output is to a tty (I tried to make it blink as well, but I
don't think you can do both bold and blink with ANSI color sequences).
This can be inhibited by the new '--inhibit-ntsec-warning' option (I
deliberately did not include a short option).

I'm sending it here, since it has to do with the recent ntsec changes that
are still in development.  Please let me know if this is too
inappropriate.  Otherwise, please evaluate it.  If it's useful, I can
re-send it to <cygwin at cygwin dot com> once 1.3.20 is released.
	Igor
P.S. This patch is against the fileutils-4.1-1 source.
========================================================================
2003-02-07  Igor Pechtchanski <pechtcha@cs.nyu.edu>

	* ls.c (print_long_format): Output color indicators for
	invalid users/groups (unless inhibit_ntsec_warning is in
	effect).
	(inhibit_ntsec_warning): New option.
	(main): Add "inhibit-ntsec-warning" option.
	(UNKNOWN_UID,UNKNOWN_GID,UNKNOWN_GROUP): New #defines.
	(copy_indicator): New function.

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune

Attachment: ls-ntsec-warn.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]