diff options
| author | Sertonix <sertonix@posteo.net> | 2024-01-16 12:40:32 +0000 |
|---|---|---|
| committer | Simon Ser <contact@emersion.fr> | 2024-01-16 15:10:13 +0100 |
| commit | b63aaffcd17b4115aa779e49016c6c4dcf06ecd9 (patch) | |
| tree | cd5a31a4afbccc5706812905b7b409ab301d5075 /shadow.c | |
| parent | bb32fd1d5063e6f53a5bde644b7d0ddd16fe8c49 (diff) | |
Check setgid too after dropping root
Diffstat (limited to 'shadow.c')
| -rw-r--r-- | shadow.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -33,9 +33,9 @@ void initialize_pw_backend(int argc, char **argv) { swaylock_log_errno(LOG_ERROR, "Unable to drop root"); exit(EXIT_FAILURE); } - if (setuid(0) != -1) { + if (setuid(0) != -1 || setgid(0) != -1) { swaylock_log_errno(LOG_ERROR, "Unable to drop root (we shouldn't be " - "able to restore it after setuid)"); + "able to restore it after setuid/setgid)"); exit(EXIT_FAILURE); } } |
