Bug 23864

Summary: The "-f" option of "ln" fails with directories
Product: [Retired] Red Hat Linux Reporter: cradford
Component: fileutilsAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED NOTABUG QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: cradford
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-01-12 09:08:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description cradford 2001-01-12 09:08:25 UTC
"ln -fs" fails when applied to directories (both hard & soft link work for 
files, user privelidge make no difference).
drwxr-xr-x    2 root     root         4096 Jan 12 08:39 one
drwxr-xr-x    2 root     root         4096 Jan 12 08:39 two
[root@linus pu]# ln -s one ug
[root@linus pu]# ls -l
total 8
drwxr-xr-x    2 root     root         4096 Jan 12 08:39 one
drwxr-xr-x    2 root     root         4096 Jan 12 08:39 two
lrwxrwxrwx    1 root     root            3 Jan 12 08:40 ug -> one
[root@linus pu]# ln -fs two ug
[root@linus pu]# ls -l
total 8
drwxr-xr-x    2 root     root         4096 Jan 12 08:40 one
drwxr-xr-x    2 root     root         4096 Jan 12 08:39 two
lrwxrwxrwx    1 root     root            3 Jan 12 08:40 ug -> one
[root@linus pu]# ls -l one
total 0
lrwxrwxrwx    1 root     root            3 Jan 12 08:40 two -> two

root@linus pu]# rpm -qif /bin/ln
Name        : fileutils                    Relocations: (not relocateable)
Version     : 4.0x                              Vendor: Red Hat, Inc.
Release     : 3                             Build Date: Fri 25 Aug 2000 
02:24:18 PM GMT
Install date: Thu 16 Nov 2000 11:12:34 AM GMT      Build Host: 
porky.devel.redhat.com
Group       : Applications/File             Source RPM: fileutils-4.0x-
3.src.rpm
Size        : 1905548                          License: GPL
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Summary     : The GNU versions of common file management utilities.

Comment 1 Bernhard Rosenkraenzer 2001-01-12 11:09:41 UTC
This is the intended behavior. Linking anything to a directory will create a
link inside the directory, even with -f.