Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 272439 - sys-apps/coreutils-7.4: ln creates broken links
Summary: sys-apps/coreutils-7.4: ln creates broken links
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-03 14:31 UTC by Martin Mokrejš
Modified: 2009-06-03 16:38 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mokrejš 2009-06-03 14:31:27 UTC
I think I found a bug or two in coreutils. ln(1) allows me to create link to a non-exiting directory. I would expect to be required to specify -f argument to force it. At least a warning message would have been advantageous.

Definitely, when the target does not exist the shell expansion does not work. In that case, ln creates a link to 'blah.*'. Or is that a bash issue (app-shells/bash-4.0_p24)?

$ ln -s /blah/blah/blah.* .
$ ls -la
total 56
drwx------ 2 mmokrejs mmokrejs 4096 Jun  3 16:24 .
drwx------ 4 mmokrejs mmokrejs 4096 Feb 18 20:29 ..
lrwxrwxrwx 1 mmokrejs mmokrejs   17 Jun  3 16:24 blah.* -> /blah/blah/blah.*
$
Comment 1 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-06-03 15:51:11 UTC
No, its not a bash-4 issue. The shell can't expand blah.* to anything so it is treated literally.

I'm 95% sure that this is expected coreutils behavior given that -f is not for creating symlinks, only removing.

-f, --force                 remove existing destination files
Comment 2 Peter Alfredsen (RETIRED) gentoo-dev 2009-06-03 16:38:25 UTC
This bug is invalid. This is how ln has always worked.