libcgroup should allow SUID, SGID or sticky bit to be set either in
cgconfig.conf file or in API calls. Especially the sticky bit can be useful for
cooperation with systemd.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
* Use owner permissions as an umask for group and others
* permissions because we trust kernel to initialize owner
* permissions to something useful.
+ * Keep SUID and SGID bits.
*/
if (stat(path, &buf) == -1)
goto fail;
gmask = umask >> 3;
omask = gmask >> 3;
- mask = umask|gmask|omask;
+ mask = umask|gmask|omask|S_ISUID|S_ISGID|S_ISVTX;
}
if (chmod(path, mode & mask))