Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1734  / 2 Years ago, fri, august 5, 2022, 11:13:28

Is it possible to start a program normally, and then later give it root or some other level of permission without restarting it?


More From » permissions

 Answers
4

No. In general, a program can only reduce its privileges (although there are ways for root owned programs to temporarily drop privileges and regain them).



The current best practice for such programs is to separate the privileged and non-privileged portions into separate processes, and have the non-privileged process invoke the privileged one as needed (e.g. this is how the clock indicator's preferences panel lets you change the system time, or how the terminal updates the list of logged in users).



This needs to be part of the program's design though: if a program is not designed to act this way, then you'll need to run it under sudo or similar if it needs administrator privileges.


[#39849] Friday, August 5, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
atereress

Total Points: 79
Total Questions: 106
Total Answers: 119

Location: Federated States of Micronesia
Member since Sun, May 16, 2021
3 Years ago
;