X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=src%2Fconfigfile.c;h=4bdfb9e25918f52dbee7becb0843162fba0c7d2a;hb=b309ccfdfd4593f3aecbdf1dafaed2f2c9d4a779;hp=f06a16653f8fc1b389995b27f365381c9903dea2;hpb=244e5e599c40ea9005b1de0d91a4c0f6adec5258;p=dockapps%2Fwmnotify.git diff --git a/src/configfile.c b/src/configfile.c index f06a166..4bdfb9e 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -8,6 +8,7 @@ #include #include +#include #include #if STDC_HEADERS @@ -42,7 +43,14 @@ CreateDefaultConfigurationFile( char *file ) fprintf( stderr, "%s: Can't create file \"%s\"\n", PACKAGE, file ); exit( EXIT_FAILURE ); } - + + /* Changing permissions so that only the user can read/modify the file. */ + status = chmod( file, S_IRUSR | S_IWUSR ); + if( status < 0 ) { + fprintf( stderr, "%s: Can't set permission bits on file \"%s\"\n", PACKAGE, file ); + exit( EXIT_FAILURE ); + } + fprintf( fp, "# ~/.wmnotifyrc -- Default configuration file for wmnotify\n\n" ); fprintf( fp, "# Replace all 'xxxxxxxx' fields with your own settings.\n\n" ); fprintf( fp, "# Parameters preceded by a '#' character are optional.\n" );