mirror of
https://github.com/owntracks/recorder.git
synced 2026-02-13 20:49:51 +00:00
just try to open defaults file instead of using access(2) due to suid
This commit is contained in:
26
misc.c
26
misc.c
@@ -156,21 +156,19 @@ void get_defaults(char *filename, struct udata *ud)
|
||||
char *v;
|
||||
int iv;
|
||||
|
||||
if (access(filename, R_OK) == -1) {
|
||||
olog(LOG_ERR, "Skipping open defaults file %s: %s", filename, strerror(errno));
|
||||
cf = NULL;
|
||||
} else {
|
||||
config_init(cf = &cfg);
|
||||
|
||||
config_init(cf = &cfg);
|
||||
|
||||
if (!config_read_file(cf, filename)) {
|
||||
olog(LOG_ERR, "Syntax error in %s:%d - %s",
|
||||
filename,
|
||||
config_error_line(cf),
|
||||
config_error_text(cf));
|
||||
config_destroy(cf);
|
||||
exit(2);
|
||||
}
|
||||
if (config_read_file(cf, filename) == CONFIG_FALSE) {
|
||||
fprintf(stderr, "Syntax error in %s:%d - %s\n",
|
||||
filename,
|
||||
config_error_line(cf),
|
||||
config_error_text(cf));
|
||||
olog(LOG_ERR, "Syntax error in %s:%d - %s",
|
||||
filename,
|
||||
config_error_line(cf),
|
||||
config_error_text(cf));
|
||||
config_destroy(cf);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
v = c_str(cf, "OTR_STORAGEDIR", STORAGEDEFAULT);
|
||||
|
||||
Reference in New Issue
Block a user