Bug 1215370 - Thoroughly misleading error message when running "losetup -f" as non-root user
Summary: Thoroughly misleading error message when running "losetup -f" as non-root user
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-25 21:42 UTC by Nick Coghlan
Modified: 2015-06-03 10:12 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-03 10:12:53 UTC
Type: Bug


Attachments (Terms of Use)

Description Nick Coghlan 2015-04-25 21:42:52 UTC
Description of problem:

Running "losetup -f" as a non-root user when no loop devices are available fails with an unhelpful error message that doesn't tell the user they can run "sudo losetup -f" to automatically create a new loopback device.

Version-Release number of selected component (if applicable):

util-linux-2.26.1-1.fc22.x86_64

How reproducible:

Always

Steps to Reproduce:
1. Run "losetup -f" as a non-root user with no loop devices created (the default)
2.
3.

Actual results:

$ losetup -f
losetup: cannot find an unused loop device: No such file or directory

Expected results:

$ losetup -f
losetup: cannot find an unused loop device (Root access required to automatically create new loop devices)

(It doesn't necessarily need to be that exact message, but there should be an explicit nudge towards "run losetup as root to create a new loop device"

Additional info:

The man pages for losetup, cryptsetup and tcplay also fail to mention this fact, which makes the default behaviour of failing to provide any loop devices by default (as per bug 896160) very confusing when attempting to follow the cryptsetup and tcplay man pages to mount an encrypted file as a volume (as per bug 1019440).

Comment 1 Karel Zak 2015-06-03 10:12:53 UTC
Improved in upstream tree by commit 362f5d203581e895005b91383ea7b1affafd8eba.

I don't think it's good idea to talk about "root", like in many other situations "Permission denied" is good enough.

$ losetup -f
lt-losetup: cannot find an unused loop device: Permission denied


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