| 17 | { |
| 18 | |
| 19 | bool dropHelperGroup() |
| 20 | { |
| 21 | // Raw per-thread setresgid, not glibc's wrapper: glibc broadcasts the change to every thread (the |
| 22 | // setxid mechanism), which would strip the group from the connect thread (HelperConnector) before |
| 23 | // it finishes connecting. Dropping the saved gid too makes the drop permanent. |
| 24 | if (syscall(SYS_setresgid, getgid(), getgid(), getgid()) != 0) { |
| 25 | qCCritical(LOG_BASIC) << "Could not drop group"; |
| 26 | return false; |
| 27 | } |
| 28 | return true; |
| 29 | } |
| 30 | |
| 31 | QString getOsVersionString() |
| 32 | { |