From d06d1d76dcbc7cdbda34c6ebefa72c706d2fa1cb Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sat, 17 Oct 2020 17:07:40 -0700 Subject: [PATCH] fix params permissions for offroad (#2356) * fix params permissions * don't need that one old-commit-hash: 20a6ca83c9194025bb6f2edf2c3992b7b6c9001a --- selfdrive/common/params.cc | 6 ++++++ selfdrive/common/params.h | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/selfdrive/common/params.cc b/selfdrive/common/params.cc index 2abfca11dd..a44933402e 100644 --- a/selfdrive/common/params.cc +++ b/selfdrive/common/params.cc @@ -167,6 +167,12 @@ int Params::write_db_value(const char* key, const char* value, size_t value_size if (result < 0) { goto cleanup; } + } else { + // Ensure permissions are correct in case we didn't create the symlink + result = chmod(path.c_str(), 0777); + if (result < 0) { + goto cleanup; + } } // Write value to temp. diff --git a/selfdrive/common/params.h b/selfdrive/common/params.h index 926c2c0798..d8c96a8cb2 100644 --- a/selfdrive/common/params.h +++ b/selfdrive/common/params.h @@ -7,10 +7,10 @@ #define ERR_NO_VALUE -33 class Params { - private: +private: std::string params_path; - public: +public: Params(bool persistent_param = false); Params(std::string path);