mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-22 14:23:59 -07:00
check file exists before changing permissions
This commit is contained in:
parent
0d1456d9dc
commit
fe0e7817f7
1 changed files with 6 additions and 2 deletions
4
one.cpp
4
one.cpp
|
@ -2239,16 +2239,20 @@ int main(int argc,char **argv)
|
|||
try {
|
||||
char p[4096];
|
||||
OSUtils::ztsnprintf(p, sizeof(p), "%s" ZT_PATH_SEPARATOR_S "identity.secret", homeDir.c_str());
|
||||
if (OSUtils::fileExists(p)) {
|
||||
OSUtils::lockDownFile(p, false);
|
||||
}
|
||||
}
|
||||
catch (...) {
|
||||
}
|
||||
|
||||
try {
|
||||
char p[4096];
|
||||
OSUtils::ztsnprintf(p, sizeof(p), "%s" ZT_PATH_SEPARATOR_S "authtoken.secret", homeDir.c_str());
|
||||
if (OSUtils::fileExists(p)) {
|
||||
OSUtils::lockDownFile(p, false);
|
||||
}
|
||||
}
|
||||
catch (...) {
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue