1 From 2089b4bf5880f49e8185b2e07966714a9ce9dcd5 Mon Sep 17 00:00:00 2001
2 From: Alexander Shishkin <ext-alexander.shishkin@nokia.com>
3 Date: Fri, 12 Jun 2009 14:43:26 +0300
4 Subject: [PATCH] Don't follow symlinks for -l or -s in ls. Fixes: NB#120999.
6 Signed-off-by: Alexander Shishkin <ext-alexander.shishkin@nokia.com>
8 coreutils/ls.c | 4 ++--
9 1 files changed, 2 insertions(+), 2 deletions(-)
11 diff --git a/coreutils/ls.c b/coreutils/ls.c
12 index 9e5c6de..e06f0eb 100644
15 @@ -908,8 +908,8 @@ int ls_main(int argc, char **argv)
16 /* stuff the command line file names into a dnode array */
18 for (oi = 0; oi < ac; oi++) {
19 - /* ls w/o -l follows links on command line */
20 - cur = my_stat(av[oi], av[oi], !(all_fmt & STYLE_LONG));
21 + /* NB: follow links on command line unless -l or -s */
22 + cur = my_stat(av[oi], av[oi], !(all_fmt & (STYLE_LONG|LIST_BLOCKS)));