Bug 32105 - alias l. is inadequate
Summary: alias l. is inadequate
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: fileutils (Show other bugs)
(Show other bugs)
Version: 7.1
Hardware: All Linux
medium
medium
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact: Aaron Brown
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-03-18 00:10 UTC by Michal Jaegermann
Modified: 2007-04-18 16:32 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-01-24 23:09:55 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Michal Jaegermann 2001-03-18 00:10:59 UTC
Alias 'l.' defined in /etc/profile.d/colorls.sh fails in this that
it does not work called like 'l. /dev' and it will not catch infamous
security breaches like '...' and similar.  I would propose instead
the following fragment of 'colors.sh':

if echo $SHELL |grep bash 2>&1 >/dev/null; then # aliases are bash only
  if ! egrep -qi "^COLOR.*none" $COLORS &>/dev/null; then
        alias ll='ls -l --color=tty'
#       alias l.='ls -d .[a-zA-Z]* --color=tty'
        alias ls='ls --color=tty'
  else
        alias ll='ls -l'
#       alias l.='ls -d .[a-zA-Z]*'
  fi
  function l. { local d="$1" ; [ "$d" ] && d="${d%/}/" ;
   ( shopt -s nullglob ; ls -d "$d".[^.] "$d".??* ) ; }
fi

or maybe even define 'l.' function unconditionally.  Otherwise
people which will get into a habit of using 'l.' may be mislead
to a presence of problems.

  Michal
  michal@harddata.com

Comment 1 Bernhard Rosenkraenzer 2002-08-29 22:33:33 UTC
Using your code is problematic because it's highly bash specific.
I've changed the alias to ls -d .* instead. That adds . and .., but I guess
that's not as bad as missing ... and the likes.
[4.1.9-10]

Comment 2 Michal Jaegermann 2002-08-29 23:56:01 UTC
> Using your code is problematic because it's highly bash specific.

As original 'l.' was protected by "if echo $SHELL |grep bash ..."
then I did not see anything wrong with a bash specific code but if you
have something better then by all means.


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