mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-26 07:38:09 +00:00
Patch preventing chmod on /dev/null
This commit is contained in:
parent
7e06844a25
commit
83ea53b599
1 changed files with 9 additions and 6 deletions
|
|
@ -215,14 +215,17 @@ LpConfig * lp_config_new(const char *filename){
|
|||
lpconfig->filename=ortp_strdup(filename);
|
||||
lpconfig->file=fopen(filename,"rw");
|
||||
if (lpconfig->file!=NULL){
|
||||
struct stat fileStat;
|
||||
lp_config_parse(lpconfig,lpconfig->file);
|
||||
fclose(lpconfig->file);
|
||||
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 ((stat(filename,&fileStat) == 0) && (S_ISREG(fileStat.st_mode))) {
|
||||
/* 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));
|
||||
}
|
||||
}
|
||||
#endif /*_WIN32_WCE*/
|
||||
lpconfig->file=NULL;
|
||||
lpconfig->modified=0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue