kdesu leads to no permission for X

Bug #144722 reported by wateenellende
This bug report is a duplicate of:  Bug #155032: kdesu ownership change. Edit Remove
16
Affects Status Importance Assigned to Milestone
kdesudo (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: kdesudo

Using kdesu is not particularly sucessful:

$ kdesu adept_updater
X Error: BadDevice, invalid or uninitialized input device 171
  Major opcode: 147
  Minor opcode: 3
  Resource id: 0x0
Failed to open device
X Error: BadDevice, invalid or uninitialized input device 171
  Major opcode: 147
  Minor opcode: 3
  Resource id: 0x0
Failed to open device
Xlib: connection to ":0.0" refused by server
Xlib:
No protocol specified

adept_updater: cannot connect to X server :0
$ xhost +
$ kdesu adept_updater
... now it works fine.

Revision history for this message
jeroenl (jeroenl) wrote :

I can confirm this, but the solution with xhost + doesn't seem to work.

See also bug #140793 .

If I do e.g. kdesudo kedit, it starts kedit, but as myself, not as root

When I do a kdesudo -u testuser kedit, it gives a:
- No protocol specified
- Xlib: connection to ":0.0" refused by server

It gives also sometimes these error messages:
- Error: "/var/tmp/kdecache-jeroen" is owned by uid 1000 instead of uid 0.
- Error: "/tmp/ksocket-jeroenzvlc9S" is owned by uid 1000 instead of uid 0.

Please fix. Seems very critical.

Revision history for this message
wateenellende (fpbeekhof) wrote : Re: [Bug 144722] Re: kdesu leads to no permission for X

By the way, this is a GUTSY problem, it works fine in FEISTY, at least
in my installations.

On 9/26/07, jeroenvrp <email address hidden> wrote:
> I can confirm this, but the solution with xhost + doesn't seem to work.
>
> See also bug #140793 .
>
> If I do e.g. kdesudo kedit, it starts kedit, but as myself, not as root
>
> When I do a kdesudo -u testuser kedit, it gives a:
> - No protocol specified
> - Xlib: connection to ":0.0" refused by server
>
> It gives also sometimes these error messages:
> - Error: "/var/tmp/kdecache-jeroen" is owned by uid 1000 instead of uid 0.
> - Error: "/tmp/ksocket-jeroenzvlc9S" is owned by uid 1000 instead of uid 0.
>
> Please fix. Seems very critical.
>
> --
> kdesu leads to no permission for X
> https://bugs.launchpad.net/bugs/144722
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
jeroenl (jeroenl) wrote :

Two more things:

1. When starting adept or other root-needed-things from guidance, it works; but not from konsole and 'run command' .

2. When I do 'sudo konqueror' it starts konqueror, but as myself, not as root (same as with kdesudo)

Revision history for this message
jeroenl (jeroenl) wrote :

The issue with kdesu, without the -u (as root) only effects kde applications.

Revision history for this message
Anthony Mercatante (tonio) wrote :

Just tested here and I can't reproduce.

kdesu adept_installer just works perfectly here even in konsole...

Could you please give the result of a "sudo adept_installer" ?

Kdesudo is just a wrapper to sudo, and calls sudo in the first place.

I'm pretty sure that if it fails with kdesudo, it'll fail with sudo, and therefore that the problem is with your sudo installation...

Revision history for this message
Anthony Mercatante (tonio) wrote :

Also, despite kdesu (original) indeed worked in feisty, it also caused a bunch of 10 really annoying bugs, as it didn't use sudo directly, and didn't manage any specific sudoers file config...

Revision history for this message
wateenellende (fpbeekhof) wrote :

On 9/28/07, Anthony Mercatante <email address hidden> wrote:
> Just tested here and I can't reproduce.

Poor guy! But why are you telling me about this ?
*ROFL*

> kdesu adept_installer just works perfectly here even in konsole...
>

On topic,
-it works on feisty, i386, home dir on NFS
-it works on gusty; i386, home on local disk
-it does not work on gutsy, home dir on NFS

Did you have gutsy/NFS ?

Revision history for this message
jeroenl (jeroenl) wrote :

@Anthony: I tested the following:

1. kdesudo -s > to clear the password cache (just to be sure)
2. kdesu adept_installer > asks for password > adept_installer is started as "root" > works indeed
3. kdesudo -s
4. kdesu dolphin > asks for password > dolphin is started, but as user "jeroen", not as "root"
5. kdesudo -s
6. kdesu kwrite > same as 4
7. kdesudo -s
8. kdesu xterm > asks for password > xterm is started as "root"
9. kdesudo -s
10. kdesu openoffice > same as 4

etc etc etc

The applications that did NOT work:
dolphin
konqueror
kwrite
kedit
marble
openoffice
firefox

Other kind of errors:
ktorrent: ERROR: Communication problem with ktorrent, it probably crashed.
ark: ERROR: Communication problem with ark, it probably crashed.

The applications that DID work:
adept_installer
xterm
pan
konsole
firestarter
amule
gimp

I also saw that the error "Error: "/var/tmp/kdecache-jeroen" is owned by uid 1000 instead of uid 0." is happening with the applications that worked and didn't worked.

Revision history for this message
wateenellende (fpbeekhof) wrote :

By the way, that could be very serious problem for the following reason.

Because I could not run adept-updater, I used "sudo apt-get update;
sudo apt-get -y dist-upgrade" to update my system.

This resulted in a problem with udev and some other packages, which
were not updated. I filed a bug-report. However, this report was
marked "invalid" because "if you had used adept-updater, you would
have been fine."

Obviously, that is not true.
So I suspect there will be some trouble if this issue is not fixed and
gutsy is released.

Revision history for this message
wateenellende (fpbeekhof) wrote :

>
> On topic,
> -it works on feisty, i386, home dir on NFS
> -it works on gusty; i386, home on local disk
> -it does not work on gutsy, home dir on NFS
>
> Did you have gutsy/NFS ?
>

I upgraded the "feisty, i386, home dir on NFS" machine to gutsy
(with a lot of pain, there are conflicts).

So now I have one gutsy/i386 and one gutsy/amd64 machine, sharing the
same NFS dir. On the i386 machine kdesu/adept is working. On the amd64
machine, it doesn't.
I never messed with the kdesu / kdesudo / sudo settings, so there is no
reason for this behaviour.

Please do fix this, this is going to hurt people.

Revision history for this message
jott (joachim-ott) wrote :

I am also having trouble with kdesu after upgrading from 7.04 to 7.10RC.

I have a couple of partitions that are not listed in /etc/fstab.
In Kubuntu 7.04 I could mount+open them by opening a konqueror as
root, going to media:/ and opening the drive icon.
Doing the same after upgrade to 7.10RC gives me an error:
   hal-storage-fixed-mount refused for uid 1001

What I did:
  Alt+F2 kdesu konqueror
kdesudo popped up and received my passwd.
konqueror started.
When I klicked the home button, I was in MY homedir, not in /root.
However, I could access all files as if I were root!
I went to media:/, klicked on an unmounted drive icon and got
the error.

ps aux shows:
jo 14523 0.0 2.7 27200 14076 ? S 18:23 0:00 kdesu konqueror
root 14526 0.6 5.5 44756 28736 ? S 18:23 0:05 konqueror

Opening a Konsole from root-konqueror (F9, KDE-services>programs>system>Konsole)
starts with MY uid, NOT root, same with 'whoami'

As kdesu seems now to be a link to kdesudo, I tried
   Alt+F2 kdesu.distrib konqueror
Kde-su (not kdesudo!!!) pops up and asks for the passwd.
And everything is fine as in 7.04 (home is /root, could mount
drives etc.)

All the same applies to dolphin i.s.o. konqueror.

I hope it's a bug, not a feature?
... and yes, Kubuntu 7.10RC rocks!

Revision history for this message
jott (joachim-ott) wrote :

I just detected another nice side-effect of this uid mixing:

When I closed a normal dolphin window (i.e. running under my uid), I got
the error (translated):
  could not save bookmarks in
  /home/jo/.kde/share/apps/d3lphin/bookmarks.xml ... Permission denied.

ls -l to the file shows:
-rw-r--r-- 1 root root 1156 2007-10-16 18:00 bookmarks.xml

Obviously an earlier 'kdesudo dolphin' session had stored bookmarks
under my /home/jo/... dir with uid=root, blocking me out.

Revision history for this message
jott (joachim-ott) wrote :

seems the dolphin thing is related to Bug #136458:
dolphin not able to save bookmarks after using "open as root" option

sorry I didn't see that before. But anyhow, both bugs seem to
suffer from the strange kdesudo behaviour.

Revision history for this message
gogh (gogh) wrote :

I have exactly the same behaviour as wateenellende here.

Bug 155032 fix doesn't solve this issue, I'm don't think this is a duplicate.

My /home is also through NFSv4. The problem appears after an upgrade from feisty to gutsy.

Revision history for this message
Frode M. Døving (frode) wrote :

If you did not have this problem in feisty, you can remove the kdesudo package, to change back to the real 'kdesu'.
'sudo dpkg -P kdesudo' in a konsole.

While kdesu have some issues that kdesudo address, kdesudo introduces its own bunch of new issues.

Revision history for this message
wateenellende (fpbeekhof) wrote :

Hey! It worked! I can run things again!

On Nov 23, 2007 9:06 AM, Frode M. Døving <email address hidden> wrote:
> *** This bug is a duplicate of bug 155032 ***
> https://bugs.launchpad.net/bugs/155032
>
> If you did not have this problem in feisty, you can remove the kdesudo package, to change back to the real 'kdesu'.
> 'sudo dpkg -P kdesudo' in a konsole.
>
> While kdesu have some issues that kdesudo address, kdesudo introduces
> its own bunch of new issues.
>
>
> --
> kdesu leads to no permission for X
> https://bugs.launchpad.net/bugs/144722
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
gogh (gogh) wrote :

Worked for me as well!

Thanks!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.