--- coreapi/lpconfig.c 2011-10-16 13:37:39.000000000 +0200 +++ coreapi/lpconfig-modif.c 2011-10-16 13:37:15.000000000 +0200 @@ -218,10 +218,11 @@ fclose(lpconfig->file); #if !defined(_WIN32_WCE) /* make existing configuration files non-group/world-accessible */ - if (chmod(filename, S_IRUSR | S_IWUSR) == -1) - ms_warning("unable to correct permissions on " - "configuration file: %s", - strerror(errno)); + if (lpconfig->sections!=NULL) /* only if config file is not empty */ + if (chmod(filename, S_IRUSR | S_IWUSR) == -1) + ms_warning("unable to correct permissions on " + "configuration file: %s", + strerror(errno)); #endif /*_WIN32_WCE*/ lpconfig->file=NULL; lpconfig->modified=0;