|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
And delete .redshift.conf.
Redshift 1.12 when trying to read a configuration file hangs/loops with
an error dialog saying:
Failed to run Redshift
fopen: Permission denied
Unable to load config file.
Similar bug, but caused by AppArmor:
https://github.com/jonls/redshift/issues/672
Relevant code:
src/redshift.c
/* Load settings from config file. */
config_ini_state_t config_state;
r = config_ini_init(&config_state, options.config_filepath);
if (r < 0) {
fputs("Unable to load config file.\n", stderr);
exit(EXIT_FAILURE);
}
src/config-ini.c
static FILE *
open_config_file(const char *filepath)
{
[...]
if (filepath == NULL) {
[...]
} else {
f = fopen(filepath, "r");
if (f == NULL) {
perror("fopen");
return NULL;
}
}
return f;
}
int
config_ini_init(config_ini_state_t *state, const char *filepath)
{
config_ini_section_t *section = NULL;
state->sections = NULL;
FILE *f = open_config_file(filepath);
if (f == NULL) {
/* Only a serious error if a file was explicitly requested. */
if (filepath != NULL) return -1;
return 0;
}
|