ssuconfperm.c 598 Bytes
Newer Older
Aard's avatar
Aard committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/**
 * @file ssuconfperm.c
 * @copyright 2012 Jolla Ltd.
 * @author Bernd Wachter <bernd.wachter@jollamobile.com>
 * @date 2012
 *
 * This is a dirty hack to make sure the main user can write to the
 * configuration file; this will be obsolete once we have some
 * security framework in place.
 */

#include <sys/stat.h>
#include <unistd.h>

#include "../constants.h"

Pekka Vuorela's avatar
Pekka Vuorela committed
17 18 19
int main(int argc, char **argv)
{
    struct stat sb;
Aard's avatar
Aard committed
20

Pekka Vuorela's avatar
Pekka Vuorela committed
21 22 23 24
    if (!stat(SSU_CONFIGURATION, &sb)){
        chown(SSU_CONFIGURATION, 0, SSU_GROUP_ID);
        chmod(SSU_CONFIGURATION, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH);
    }
Aard's avatar
Aard committed
25
}