Moderator
|
I want to start a process as another user from a C++ program (it should be detached). But I have only the UID (user identification number I think). How can I do this?
The shell command is: kdesu -u ME -c a command with arguments But there I must know the user name Thanks in advance |
KDE Developer
|
You could try to map the user id to the user name, but maybe there is a better approach to the overall problem.
What's your use case? Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
Moderator
|
There's an idea in Brainstorm to implement a runner to kill processes (brainstorm.php#idea62623). And the API ksysguardd uses returns the uid of the process owner (or I didn't see a method to return the user name) but KDE-su needs the user name. I could read the user names out of /etc/passwd but a easier way would be better.
|
Moderator
|
I mapped the user name by looking in /etc/passwd. But Pino Toscano (pino) corrected it by using KUser (which is quite easier) so this topic is solved:
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]