Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit on config read error to avoid crash on EACCES #1798

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

klemensn
Copy link

Failure to read does not exit despite
/* Read the file. If there is an error, report it and exit. */

EACCES (e.g. insufficient filesystem permissions) is enough to crash on access through later config_*() such as those when either of either of D-Bus, MPRIS or MQTT is used.

Seen --with-mpris-interface and

$ ls -l /etc/shairport-sync.conf
-rw-r-----  1 root  _shairport  28114 Jan 25 01:53 /etc/shairport-sync.conf
$ shairport-sync
Segmentation fault (core dumped)

Failure to read does not exit despite
`    /* Read the file. If there is an error, report it and exit. */`

EACCES (e.g. insufficient filesystem permissions) is enough to crash
on access through later `config_*()` such as those when either of
either of D-Bus, MPRIS or MQTT is used.

Seen `--with-mpris-interface` and
```
$ ls -l /etc/shairport-sync.conf
-rw-r-----  1 root  _shairport  28114 Jan 25 01:53 /etc/shairport-sync.conf
$ shairport-sync
Segmentation fault (core dumped)
```
@mikebrady mikebrady merged commit 2810559 into mikebrady:development Jan 30, 2024
9 checks passed
@mikebrady
Copy link
Owner

Many thanks again for this.

@klemensn klemensn deleted the config-perm-segfault branch January 31, 2024 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants