Bug 487914

Summary: sln removes files without a warning
Product: [Fedora] Fedora Reporter: Lauri Nurmi <lanurmi>
Component: glibcAssignee: Andreas Schwab <schwab>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: low    
Version: 11CC: drepper, jakub, pmuller
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-08-20 13:08:23 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 Lauri Nurmi 2009-03-01 11:46:53 UTC
Description of problem:
As far as I understand, 'sln' is supposed to be a statically linked equivalent of 'ln', i.e. a tool for creating symlinks, and not for example deleting files.

In certain error situations sln seems to simply remove files, no questions asked.


Version-Release number of selected component (if applicable):
glibc-2.9.90-7.x86_64

How reproducible:
Always.


Steps to Reproduce:
1. mkdir X && cd X && touch MyFile
2. sln MyFile MyFile

or alternatively:
2. sln NonExistingFile MyFile
  

Actual results:
An error message about "Invalid link ..." is shown.  Additionally, MyFile is gone forever.


Expected results:
An error message shown, and MyFile intact.


Additional info:

Comment 1 Ulrich Drepper 2009-03-16 20:58:16 UTC
(In reply to comment #0)
> Description of problem:
> As far as I understand, 'sln' is supposed to be a statically linked equivalent
> of 'ln',

No.  sln is an error recovery tool.  It's kept as simple as possible and you have to know what to do.  I have no intention to make it the equivalent of ln.  If you want that, just link ln statically and call it sln.

Comment 2 Lauri Nurmi 2009-03-17 15:29:56 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > Description of problem:
> > As far as I understand, 'sln' is supposed to be a statically linked equivalent
> > of 'ln',
> 
> No.  sln is an error recovery tool.  It's kept as simple as possible and you
> have to know what to do.  I have no intention to make it the equivalent of ln.

You intentionally left out the relevant part of the sentence.

Besides, unlike you imply, sln is not even "as simple as possible", as it has some sort of human-readable help and and error messages.  Surely a zero or non-zero exit status would be enough when you know what you are doing.


> If you want that, just link ln statically and call it sln.  

Keeping sln simple does not justify its undocumented and unexpected behavior of removing files.

Reopening to get a second opinion.

Comment 3 Bug Zapper 2009-06-09 11:45:54 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 4 Andreas Schwab 2009-08-20 13:08:23 UTC
sln is not in any way equivalent to ln, but ln -sf a b will zap b as well.