Skip to content
Commit 45fa23e9 authored by Christian Kastner's avatar Christian Kastner
Browse files

Remove redundant effort to drop privileges during editing

This is an odd artifact from 2003.

crontab creates a temporary file and then forks an editor to edit that
file. Before this happens, privileges must be dropped, because crontab
is SGID "crontab".

Before the fork, there was a call to swap_uids(), which temporarily
drops the privileges. After the editor has returned, the privileges are
reasumed with swap_uids_back().

However, after forking but before exec'ing the editor, the child
also drops privileges.

The swap_uid() and swap_uid_back() therefore only affect the parent
process, but all the parent does in between this calls is to wait for
the client to exit.
parent 8beb02d8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment