dcopclient: Use default path for XDG_RUNTIME_DIR if the variable is not set #146

Merged
SlavekB merged 1 commits from fix/tdebase-241/dcop-client-as-root into master 3 years ago
Owner

This resolves issue TDE/tdebase#241.

This resolves issue TDE/tdebase#241.
SlavekB added the PR/rfc label 3 years ago
MicheleC requested changes 3 years ago
MicheleC left a comment
Owner

Looks good but it will be better to fix the indentation of the code.

Looks good but it will be better to fix the indentation of the code.
Owner

Running something like this

/opt/trinity/bin/dcop --user killy --session .DCOPserver_skynet__0 kdesktop KScreensaverIface lock

from a "su -" CLI session seems to work. But running the same from a non-root session (i.e. different user) doesn't, so we should ask @jstolarek to test it before we merge it.

Running something like this ``` /opt/trinity/bin/dcop --user killy --session .DCOPserver_skynet__0 kdesktop KScreensaverIface lock ``` from a "su -" CLI session seems to work. But running the same from a non-root session (i.e. different user) doesn't, so we should ask @jstolarek to test it before we merge it.
Collaborator

Sorry, but why does the path end with <uid> on line 604? Is this some kind of argument/placeholder? But I don't see it substituted anywhere.

Sorry, but why does the path end with `<uid>` on line [604](https://mirror.git.trinitydesktop.org/gitea/TDE/tdelibs/src/commit/46e0db2acfd9aa6c615b09f253ac4af1011aff57/dcop/client/dcop.cpp#L604)? Is this some kind of argument/placeholder? But I don't see it substituted anywhere.
Poster
Owner

Sorry, but why does the path end with <uid> on line 604? Is this some kind of argument/placeholder? But I don't see it substituted anywhere.

Yes, it's like a placeholder. On line 612 you can see that only the name of the parent folder is used – xdgRuntime.dirPath().

> Sorry, but why does the path end with `<uid>` on line [604](https://mirror.git.trinitydesktop.org/gitea/TDE/tdelibs/src/commit/46e0db2acfd9aa6c615b09f253ac4af1011aff57/dcop/client/dcop.cpp#L604)? Is this some kind of argument/placeholder? But I don't see it substituted anywhere. Yes, it's like a placeholder. On line [612](src/commit/46e0db2acfd9aa6c615b09f253ac4af1011aff57/dcop/client/dcop.cpp#L612) you can see that only the name of the parent folder is used – `xdgRuntime.dirPath()`.
Poster
Owner

Running something like this

/opt/trinity/bin/dcop --user killy --session .DCOPserver_skynet__0 kdesktop KScreensaverIface lock

from a "su -" CLI session seems to work. But running the same from a non-root session (i.e. different user) doesn't, so we should ask @jstolarek to test it before we merge it.

Calls can only be used if user has permission to read ICEAuthhority of a foreign user. This usually has only root.

> Running something like this > ``` > /opt/trinity/bin/dcop --user killy --session .DCOPserver_skynet__0 kdesktop KScreensaverIface lock > ``` > from a "su -" CLI session seems to work. But running the same from a non-root session (i.e. different user) doesn't, so we should ask @jstolarek to test it before we merge it. Calls can only be used if user has permission to read ICEAuthhority of a foreign user. This usually has only root.
Owner

Calls can only be used if user has permission to read ICEAuthhority of a foreign user. This usually has only root.

The point I was trying to make was that if the script of @jstolarek is called as a different user (acpid??), it may still not work, hence the need for testing.

> Calls can only be used if user has permission to read ICEAuthhority of a foreign user. This usually has only root. The point I was trying to make was that if the script of @jstolarek is called as a different user (acpid??), it may still not work, hence the need for testing.
Collaborator

Well, if things used to work on my machine before the regression then I'm guessing it must've been run with root permissions. If it works with root that's fine with me.

Well, if things used to work on my machine before the regression then I'm guessing it must've been run with root permissions. If it works with root that's fine with me.
Owner

It works with root, I tested.
About regression, this could have been caused by something else, not TDE, so it could turn out it still didn't work once this is merged. In any case, I think we can merge this and then you give it a go with the new packages and we take it from there.

It works with root, I tested. About regression, this could have been caused by something else, not TDE, so it could turn out it still didn't work once this is merged. In any case, I think we can merge this and then you give it a go with the new packages and we take it from there.
SlavekB force-pushed fix/tdebase-241/dcop-client-as-root from 46e0db2acf to 81d495430d 3 years ago
Poster
Owner

Originally I made a change to be minimal. But, it is true that indentation in this part of the code was very inconsistent. Now I changed the entire if block indentation. At the same time, I used the fromLocal8bit() and local8Bit() to manipulate with environment variables.

Originally I made a change to be minimal. But, it is true that indentation in this part of the code was very inconsistent. Now I changed the entire `if` block indentation. At the same time, I used the `fromLocal8bit()` and `local8Bit()` to manipulate with environment variables.
MicheleC approved these changes 3 years ago
MicheleC left a comment
Owner

Looks good

Looks good
SlavekB removed the PR/rfc label 3 years ago
SlavekB merged commit 81d495430d into master 3 years ago
SlavekB deleted branch fix/tdebase-241/dcop-client-as-root 3 years ago
SlavekB added this to the R14.0.12 release milestone 3 years ago
Collaborator

I'll let you know once I test the changes. When to expect updated package in the repo? It will be in the PBS I presume?

I'll let you know once I test the changes. When to expect updated package in the repo? It will be in the PBS I presume?
Poster
Owner

I'll let you know once I test the changes. When to expect updated package in the repo? It will be in the PBS I presume?

Yes, updated packages will be available in PSB pepository. And currently should already be provided for installation (tdelibs version 14.0.12~pre2).

> I'll let you know once I test the changes. When to expect updated package in the repo? It will be in the PBS I presume? Yes, updated packages will be available in PSB pepository. And currently should already be provided for installation (tdelibs version 14.0.12~pre2).
Collaborator

I can confirm this fix works as expected. Thanks!

I can confirm this fix works as expected. Thanks!
Poster
Owner

I can confirm this fix works as expected. Thanks!

Great, thank you for confirmation.

> I can confirm this fix works as expected. Thanks! Great, thank you for confirmation.

Reviewers

MicheleC approved these changes 3 years ago
The pull request has been merged as 81d495430d.
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
4 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: TDE/tdelibs#146
Loading…
There is no content yet.