Sample Header Ad - 728x90

How to update user/group settings of a running process?

5 votes
3 answers
5872 views
Suppose I change some user settings like its initial login group or add it to a new group. I now can do su user and work with these new settings. But all the previously running processes will still have the same permissions as before. How can I force a specific running process to re-read /etc/passwd and /etc/group to reinitialize its user and group settings, without terminating any activity it was doing? I've tried attaching to the process with gdb and do print setuid(MY_USER_ID), but despite the result was 0 (i.e. success), the process still remained with the same data (checked on bash running groups to see whether additional group has appeared).
Asked by Ruslan (3429 rep)
Jun 10, 2015, 03:47 AM
Last activity: Jun 14, 2023, 09:40 AM