Bug 172023 - Can't mount as user: link to device (hdd)
Summary: Can't mount as user: link to device (hdd)
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR normal with 81 votes (vote)
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 203074 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-02 11:30 UTC by F. Di Milia
Modified: 2010-11-03 17:57 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.5.3


Attachments
kdebug output (11.78 KB, text/plain)
2009-02-27 04:15 UTC, F. Di Milia
Details
Fstab (1.00 KB, application/octet-stream)
2009-10-07 18:44 UTC, F. Di Milia
Details
Command line for mount invocation (662 bytes, patch)
2009-12-31 13:48 UTC, Stefano Solfaroli
Details

Note You need to log in before you can comment on or make changes to this bug.
Description F. Di Milia 2008-10-02 11:30:13 UTC
Version:            (using KDE 4.1.1)
OS:                Linux
Installed from:    Unspecified Linux

Hi

I can't mount any partition as user using link to device icon in KDE4.

My fstab entry is correct and works with KDE 3.5.x and in the Terminal as user (See: http://www.2blabla.ch/stuff/Bugreports/KDE4-Bugs/kde-3.5.png).

I think it's a bug in KDE.

Tested with:
Fedora, Kubuntu, Archlinux
KDE 4.0, 4.0.5, 4.1.0, 4.1.1, 4.1.2

Steps:

1. Add Partition in /etc/fstab
2. Create a Icon (right click, link to device, hard disk drive)
3. Select the fstab entry
4. double click the icon as user

Pictures:

http://www.2blabla.ch/stuff/Bugreports/KDE4-Bugs/fstab.png
http://www.2blabla.ch/stuff/Bugreports/KDE4-Bugs/device.png
http://www.2blabla.ch/stuff/Bugreports/KDE4-Bugs/error.png
Comment 1 Jesse L. Zamora 2008-12-03 15:26:23 UTC
It's not a bug with KDE4. Partitions in /etc/fstab can ONLY be mounted by the root user.

An optimum solution would be to ask the user for the root password so it can mount it; sorta like Kubuntu 8.10 does, but only make it part of KDE 4.
Comment 2 F. Di Milia 2008-12-03 20:11:28 UTC
(In reply to comment #1)
> It's not a bug with KDE4. Partitions in /etc/fstab can ONLY be mounted by the
> root user.
> 
> An optimum solution would be to ask the user for the root password so it can
> mount it; sorta like Kubuntu 8.10 does, but only make it part of KDE 4.
> 

And why it works with KDE 3.5? 
And why it works as user in konsole?

man mount
man fstab
Comment 3 Aaron J. Seigo 2008-12-11 03:08:30 UTC
that error comes from mount, not KDE.

what user do you run your virtual machines sessions as? can you mount them from konsole inside the VMs?
Comment 4 F. Di Milia 2008-12-11 22:13:20 UTC
(In reply to comment #3)
> that error comes from mount, not KDE.
> 
> what user do you run your virtual machines sessions as? can you mount them from
> konsole inside the VMs?
> 

I have this fstab entry since 5 years and it works in console and in kde < 4.0 but not in >= 4.0.

Here Screenshot from Kubuntu 8.04 (LiveCD Mode + 1 HDD) in Virtualbox.

http://www.2blabla.ch/stuff/Bugreports/KDE4-Bugs/3.5.10/1.png
http://www.2blabla.ch/stuff/Bugreports/KDE4-Bugs/3.5.10/2.png
http://www.2blabla.ch/stuff/Bugreports/KDE4-Bugs/3.5.10/3.png
http://www.2blabla.ch/stuff/Bugreports/KDE4-Bugs/3.5.10/4.png

And you can see... it works!

it's not a mount problem!





Comment 5 F. Di Milia 2008-12-11 22:42:31 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > that error comes from mount, not KDE.
> > 
> > what user do you run your virtual machines sessions as? can you mount them from
> > konsole inside the VMs?
> > 
> 
> I have this fstab entry since 5 years and it works in console and in kde < 4.0
> but not in >= 4.0.
> 
> Here Screenshot from Kubuntu 8.04 (LiveCD Mode + 1 HDD) in Virtualbox.
> 
> http://www.2blabla.ch/stuff/Bugreports/KDE4-Bugs/3.5.10/1.png
> http://www.2blabla.ch/stuff/Bugreports/KDE4-Bugs/3.5.10/2.png
> http://www.2blabla.ch/stuff/Bugreports/KDE4-Bugs/3.5.10/3.png
> http://www.2blabla.ch/stuff/Bugreports/KDE4-Bugs/3.5.10/4.png
> 
> And you can see... it works!
> 
> it's not a mount problem!
> 

Here again with KDE 4 and Kubuntu 8.10 in Virtualbox.

http://www.2blabla.ch/stuff/Bugreports/KDE4-Bugs/1.png
http://www.2blabla.ch/stuff/Bugreports/KDE4-Bugs/2.png
http://www.2blabla.ch/stuff/Bugreports/KDE4-Bugs/3.png
http://www.2blabla.ch/stuff/Bugreports/KDE4-Bugs/4.png

Works in console but not with KDE 4
Comment 6 Davide Bettio 2008-12-22 21:11:45 UTC
If I remember well HAL has got its own set of permissions. Anyway it may be an HAL issue or it may be a Solid bug.
Comment 7 Michael 2009-01-18 13:33:25 UTC
Hi I'm having the same problem, searching for solutions. In KDE 3.5 it worked fine.

Using /mnt/backup instead /dev/sda0 as device in plasma-icon could be a workaround for you on mounting BUT! Neither it works for unmounting nor opening folders in dolphin.
Comment 8 F. Di Milia 2009-02-14 20:07:28 UTC
Is it really posible that no kde-dev can fix the problem in 4 month and no kde-dev knows kde 3.5 (it works on kde 3.5!!!) or can test it? -.-'

Same error since 4.0 to 4.2.0.
Comment 9 F. Di Milia 2009-02-16 13:25:29 UTC
Find a KDE/Plasma bug for dummies:

KDE 3.5 Vid: http://www.2blabla.ch/stuff/Bugreports/KDE4-Bugs/kde3.5.avi (34MB - XVid4)
KDE 4 Vid: http://www.2blabla.ch/stuff/Bugreports/KDE4-Bugs/kde4.avi (36MB - XVid4)


i hope the kde devs see and understand the problem now. 
Comment 10 Kevin Ottens 2009-02-22 13:41:22 UTC
This one clearly goes through the old KDesktopFileActions facilities in kio. No idea if there's plan there to support solid. Reassign there.
Comment 11 David Faure 2009-02-23 12:09:35 UTC
Why would mount() in kio_file need to support solid? We just call `mount` there, (or pmount) like we did in 3.5. I don't remember changes in that code....

F. Di Milia: no need to call us dummies, and 4 months is nothing compared to some other open bugs. There are thousands of open bug reports, we're overloaded.

I need to see the contents of the desktop file, and the output from kio_file to find out more about the problem. You can find it in ~/.xsession-errors, most probably. Debug area 7101 (check with kdebugdialog that it's enabled), and a debug build is needed (otherwise debug output is turned off).
Comment 12 Kevin Ottens 2009-02-23 13:26:22 UTC
Right, I made no sense there. What's sure though is that this feature doesn't go through solid at all.
Comment 13 F. Di Milia 2009-02-23 17:48:30 UTC
File created with "Link to dev"

[Desktop Entry]
Dev=/dev/sdd1
Icon=drive-harddisk
MountPoint=/mnt/backup
ReadOnly=false
Type=FSDevice
UnmountIcon=hdd_unmount


I've nothing in .xsession-error if i try to mount the HDD with link to dev.

I'll compile my Gentoo now with debug useflag on.


Btw. Sorry for the dummies but i was soooooo nerved.
Comment 14 F. Di Milia 2009-02-26 15:10:45 UTC
Hm.

I compiled gentoo with debug useflag and i can see some output in .xsession-erro but nothing like 7107 kio_file and 7101 (kio_file) is turned on in kdebug.

Example:

angelus ~ $  cat .xsession-errors | tail -n 5
kded(3246)/khotkeys KHotKeys::ActionData::update_triggers: ### Update triggers:  "Vorheriges Unterfenster aktivieren" : false
knotify(3284) KNotify::event: 1297  ref= 0
yakuake(3341)/kdeui (KNotification) KNotification::slotReceivedId: 0
yakuake(3341)/kdeui (KNotification) KNotification::close: 0
yakuake(3341)/kdeui (KNotification) KNotification::~KNotification: -2
angelus ~ $

do i something wrong?


Btw. The contextmenu of root has a "u/mount" option for "link to device" but there is no "u/mount" option in the contextmenu of a normal user like in KDE 3. 


I found out:

Orginal created from Link to Device (u/mount doesn't work as user):

[Desktop Entry]
Dev=/dev/sdd1
Icon=drive-harddisk
MountPoint=/mnt/backup
ReadOnly=false
Type=FSDevice
UnmountIcon=hdd_unmount

Edited by me (only mount does work as user (double click on icon to mount)):

[Desktop Entry]
Dev=/dev/sdd1
Icon=drive-harddisk
MountPoint=
ReadOnly=false
Type=FSDevice
UnmountIcon=hdd_unmount
Comment 15 Michael 2009-02-26 21:46:45 UTC
Hi David. 

Your tip with 'pmount' was a good hint.
pmount wasn't installed at all in my intrepid based kubuntu.

After installing pmount, i could mount my nfs device with the kde-link and it was opened automatically in Dolphin. Before I installed pmount, I had the same problems like F. Di Milla.

Right now I'm just missing the "u/mount" option in contextmenu of that icon.
Comment 16 F. Di Milia 2009-02-27 02:15:23 UTC
(In reply to comment #15)
> Hi David. 
> 
> Your tip with 'pmount' was a good hint.
> pmount wasn't installed at all in my intrepid based kubuntu.
> 
> After installing pmount, i could mount my nfs device with the kde-link and it
> was opened automatically in Dolphin. Before I installed pmount, I had the same
> problems like F. Di Milla.
> 
> Right now I'm just missing the "u/mount" option in contextmenu of that icon.


angelus ~ $  pacman -Qs pmount
local/pmount 0.9.18-2
    mount removable devices as normal user
angelus ~ $


I've installed pmount but still not works.

KDE 3.5 = works
KDE 4 = not works

And i can't believe that all Distrobtion forgot to install pmount but kde 3 works.
Comment 17 F. Di Milia 2009-02-27 04:15:18 UTC
Created attachment 31663 [details]
kdebug output

Here the kdebug output from kio_file 7101
Comment 18 Michael 2009-02-27 22:20:46 UTC
as I executed following line, I got same error message before installing pmount as on desktop by clicking that link.
'kioclient exec file://path-to-link'

some Versions:

ii  linux-image-2.6.27-12-generic              2.6.27-12.28                                Linux kernel image for version 2.6.27 on x86
(uname 2.6.27-12-generic #1 SMP Thu Feb 5 09:26:42 UTC 2009 x86_64 GNU/Linux)

ii  kdebase-runtime-bin-kde4                   4:4.2.0-0ubuntu1~intrepid1                  core binaries for the KDE 4 base runtime mod


dpkg -l | grep pmount
ii  pmount                                     0.9.17-2                                    mount removable devices as normal user

dpkg -l | grep kio
ii  kde-zeroconf                               4:4.2.0-0ubuntu1~intrepid1                  zeroconf plugins and kio slaves for KDE 4
ii  kdemultimedia-kio-plugins                  4:4.2.0-0ubuntu1~intrepid1                  transparent audio CD access for KDE 4 applic
Comment 19 Michael 2009-02-27 22:25:05 UTC
I'm using it for a nfs-mount.
Comment 20 F. Di Milia 2009-07-24 22:56:01 UTC
The bug is still in  KDE 4.3 RC3.

Testet with Kubuntu 9.10 Alpha 3.

Can pls someone fix it?
Comment 21 FiNeX 2009-08-27 14:09:50 UTC
This bug is still reproducible in current trunk too.
Comment 22 Martin Samek 2009-09-04 10:52:08 UTC
I can confirm. Still in 4.3.1 - Gentoo.
Could someone fix it?
Comment 23 F. Di Milia 2009-10-06 23:35:18 UTC
Link 2 Device works with KDE 4.3.2 for me. :)

Can someone comfirm it?
Comment 24 F. Di Milia 2009-10-06 23:36:33 UTC
"Link to Device" works with KDE 4.3.2 for me. :)

Can someone comfirm it?
Comment 25 Martin Samek 2009-10-07 15:21:50 UTC
No, still without luck on 4.3.2 Gentoo. Still getting "Only root can do this" error. I have same issue also with NFS volume. Am I missing something in fstab or groups?

/dev/sdb2               /mnt/win.c      ntfs-3g         users,noauto,umask=022  0 0
/dev/sdb3               /mnt/win.d      ntfs-3g         user                    0 0

tiberius:/mnt/data/music                /mnt/music      nfs     rsize=8192,wsize=8192,nolock,user       0 0

groups: tty disk lp wheel audio cdrom video games usb users plugdev scanner wireshark vboxusers

More about nfs issue is in <a href="show_bug.cgi?id=203074">bug 172023</a>.
Comment 26 Martin Samek 2009-10-07 15:25:05 UTC
Sorry for badly posted reference to bug 203074
Comment 27 Martin Samek 2009-10-07 16:01:12 UTC
I can confirm, that this bug disapper when the MountPoint option in desktop file is leaved empty. When MountPoint is set than error ocurred.
Comment 28 F. Di Milia 2009-10-07 18:44:29 UTC
Created attachment 37428 [details]
Fstab

link to device works for me with...

Sama Shares (mount.cifs)
Linux Partitions (mount)
Windows Partitions (mount.ntfs-3g)

I can't test NFS. :(

Works NFS as user in the console?

Have you tried to setuid for mount.nfs and are the permissions for you mount-point right?

I ask because i needed setuid for mount.cifs.


Here my fstab
Comment 29 F. Di Milia 2009-10-07 19:00:47 UTC
I forgot...

Here my link to device files.

[Desktop Entry]
Dev=//Mediabox/Storage
Icon=folder-remote
MountPoint=/mnt/smb/mediabox
ReadOnly=false
Type=FSDevice
UnmountIcon=drive-removable-media


[Desktop Entry]
Dev=/dev/sda1
Icon=drive-harddisk
MountPoint=/mnt/windows
ReadOnly=false
Type=FSDevice
UnmountIcon=drive-harddisk


[Desktop Entry]
Dev=/dev/md0
Icon=drive-harddisk
MountPoint=/mnt/backup
ReadOnly=false
Type=FSDevice
UnmountIcon=drive-harddisk
Comment 30 Martin Samek 2009-10-07 21:50:39 UTC
Yes, mount as user in console works prefectly for win/linux partitions also for NFS volumes. Today I managed link to work properly with MountPoint left empty.
Comment 31 Dario Andres 2009-10-11 01:00:55 UTC
*** Bug 203074 has been marked as a duplicate of this bug. ***
Comment 32 Martin Samek 2009-11-04 00:46:32 UTC
Bug remains in KDE 4.3.3
Comment 33 Martin Samek 2009-12-04 14:02:07 UTC
This bug getting worse in KDE 4.3.4. The workaround, when MountPoint variable in the desktop file is left empty, stopped to work. Now following error appears: Could not mount device. The reported error was: mount.nfs: an incorrect mount option was specified.

I ask developers, please, do something with this annoying bug.
Comment 34 Stefano Solfaroli 2009-12-31 13:37:46 UTC
I think I found the bug, perhaps? Sorry but I have no time to try for myself...
Looking at the source code (I'm on Gentoo, KDE 4.3.3, don't know how is mapped on official repository) the file kioslave/file/file.cpp inside the archive kdelibs-4.3.3.tar.bz2):
- at line 972 there is a for statement to make 2 iteration and call "mount" with different parameters; but the variabile containing the string with the command line is initialized at line 969 (before the for cycle) and never resetted.

In the log file attached kdebug.dbg I saw this lines that seems to confirm my idea:
kio_file(4000) FileProtocol::mount: FileProtocol::mount _fstype=
>>> First try
kio_file(4000) FileProtocol::mount: "/bin/mount  /dev/sdd1 /mnt/backup 2>/tmp/kde-angelus/kio_fileSL4000.tmp" 
kio_file(4000) FileProtocol::mount: "mount: Nur „root“ kann dies tun
" 
kio_file(4000) FileProtocol::mount: Mounting with those options didn't work, trying with only mountpoint 
>>>Second try
kio_file(4000) FileProtocol::mount: "/bin/mount  /dev/sdd1 /mnt/backup 2>/tmp/kde-angelus/kio_fileSL4000.tmp  /mnt/backup 2>/tmp/kde-angelus/kio_fileSL4000.tmp" 

The second iteration should be "/bin/mount mnt/backup 2>/tmp/kde-angelus/kio_fileSL4000.tmp" (only the mount point, no device) instead is the first try with appended the parameters of the second.

I will attach a patch for you to review.

Regards,
Stefano
Comment 35 Stefano Solfaroli 2009-12-31 13:48:09 UTC
Created attachment 39481 [details]
Command line for mount invocation

Move the declaration/intialization of the string with the mount command line inside the 'for' statement.
Comment 36 Martin Samek 2010-02-21 21:00:37 UTC
Still remains in KDE 4.4. No solution yet.
Comment 37 Paolo 2010-02-28 17:14:45 UTC
Hi all,
I'm a kubuntu user 9.10 with kde 4.4. I have the same problem.
Comment 38 Stefano Solfaroli 2010-03-05 19:47:02 UTC
I can confirm that the patch I attached some time ago is fixing this bug, at least in my case, an nfs share declared in /etc/fstab:
netsrv:/mnt/archivio /mnt/archivio nfs noauto,user,users,tcp,noatime 0 0

I tried it on Gentoo with kde 4.3.3 and 4.3.5.
Comment 39 Martin Samek 2010-03-05 21:57:38 UTC
But it is not included in the mainline.
Comment 40 F. Di Milia 2010-03-09 18:06:46 UTC
Still not workeee in 4.4.1 :(

Can someone pls add the patch to mainline for 4.4.2 if it works?
Comment 41 Martin Samek 2010-03-09 18:20:40 UTC
We need to add patch to the mainline.
Comment 42 Martin Samek 2010-08-06 22:57:13 UTC
So this small nasty bug is here for almost two year. Will it be fixed in SC 4.5? Anybody knows???
Comment 43 F. Di Milia 2010-08-07 00:09:23 UTC
(In reply to comment #42)
> So this small nasty bug is here for almost two year. Will it be fixed in SC
> 4.5? Anybody knows???

Good question...

I mean 110 votes and two years gone and the bug is still there :/

I'm note hopefully that they ever fix the bug :/
Comment 44 Martin Samek 2010-08-11 10:12:26 UTC
So, still persist in KDE SC 4.5.0. This is really hopeless. Is there anybody able to fix this?
Comment 45 David Faure 2010-10-22 20:29:53 UTC
SVN commit 1188587 by dfaure:

Fix mounting partitions as user, the "second step" wasn't done correctly (dev wasn't emptied, and the command line wasn't reset)
Of course I debugged it before seeing that bug 172023 had a patch for one of the two issues...
FIXED-IN: 4.5.3
BUG: 172023
(next step, fixing the icon, and fixing this logic again for bug 98804...)


 M  +4 -4      file.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1188587
Comment 46 David Faure 2010-10-22 21:12:23 UTC
SVN commit 1188630 by dfaure:

Use "emblem-mounted" to show mounted devices, looks better than the old UnmountIcon/Icon solution.
CCBUGS: 172023 251156


 M  +11 -13    kfileitem.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1188630
Comment 47 David Faure 2010-10-22 21:37:41 UTC
SVN commit 1188635 by dfaure:

Remove unused "unmounted icon" button in the properties dialog.
CCBUG: 172023


 M  +4 -27     kpropertiesdialog.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1188635
Comment 48 Martin Samek 2010-11-03 17:57:29 UTC
I can confirm that this long living bug is finally fixed in KDE SC 4.5.3 :-) One thing, it is not possile to change link icon in the creation dialog.