lbrycrd/packaging/docker-for-binary/stuff/fix-permissions.c

10 lines
333 B
C
Raw Normal View History

2019-11-27 15:31:35 +01:00
#include <unistd.h>
int main() {
// This program needs to run with setuid == root
// This needs to be in a compiled language because you cannot setuid bash scripts
setuid(0);
execle("/bin/bash", "bash", "-c",
"/bin/chown -R lbrycrd:lbrycrd /data && /bin/chmod -R 755 /data/",
(char*) NULL, (char*) NULL);
}