Bug 487914 - sln removes files without a warning
sln removes files without a warning
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
11
All Linux
low Severity high
: ---
: ---
Assigned To: Andreas Schwab
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-01 06:46 EST by Lauri Nurmi
Modified: 2009-08-20 09:08 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-08-20 09:08:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Lauri Nurmi 2009-03-01 06:46:53 EST
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 16:58:16 EDT
(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 11:29:56 EDT
(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 07:45:54 EDT
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 09:08:23 EDT
sln is not in any way equivalent to ln, but ln -sf a b will zap b as well.

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