mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
node-driver: open PHC as readonly
RW access is usually denied to a user unit. RO might be as well but it's more safe to make /dev/ptpX just user-readable
This commit is contained in:
parent
fffda6b6d1
commit
5edd3f240b
1 changed files with 2 additions and 2 deletions
|
|
@ -588,7 +588,7 @@ impl_init(const struct spa_handle_factory *factory,
|
|||
if (this->clock_fd >= 0) {
|
||||
close(this->clock_fd);
|
||||
}
|
||||
this->clock_fd = open(s, O_RDWR);
|
||||
this->clock_fd = open(s, O_RDONLY);
|
||||
|
||||
if (this->clock_fd == -1) {
|
||||
spa_log_warn(this->log, "failed to open clock device '%s'", s);
|
||||
|
|
@ -602,7 +602,7 @@ impl_init(const struct spa_handle_factory *factory,
|
|||
} else {
|
||||
char dev[19];
|
||||
spa_scnprintf(dev, sizeof(dev), "/dev/ptp%d", phc_index);
|
||||
this->clock_fd = open(dev, O_RDWR);
|
||||
this->clock_fd = open(dev, O_RDONLY);
|
||||
}
|
||||
|
||||
if (this->clock_fd == -1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue