carb::launcher::restoreParentDeathSignal

Defined in carb/launcher/ILauncher.h

inline void carb::launcher::restoreParentDeathSignal(KillFlags flags = 0)

Restores the parent death signal on set-user-ID and set-group-ID images.

Remark

This restores the parent death signal on Linux after executing an image file that has a set-user-ID or set-group-ID capability set on it. Unfortunately, executing one of these image files has the result of clearing the parent death signal attribute that is set when using the fLaunchFlagKillOnParentExit flag. These capabilities are set on the image file with the “setcap” command line tool and require super user access. The capabilities of an executable image file can be discovered with the “capsh –print” command line tool. See the notes on ILauncher::launch() for more information.

Note

This only needs to be called when a child process’s image file has a set-user-ID or set-group-ID capability set on it on Linux and the fLaunchFlagKillOnParentExit flag was used when launching the child process. This is still safe to call on Windows and will simply do nothing. Note that calling this when the child was not launched with the fLaunchFlagKillOnParentExit flag will cause that behavior to be imposed on the child process. Communicating the need for this call is left as an exercise for both the child and parent processes.

Parameters

flags[in] Flags to indicate which signal should be sent on on parent process exit. This may be 0 to cause the child process to be asked to gracefully terminate or fKillFlagForce to forcibly terminate the child process. In the latter case, the child process will not get any chance to clean up or release resources.

Returns

No return value.