rpccookieperms: Allow setting setxid/sticky bits

Simply for backward compatibility
This commit is contained in:
Luke Dashjr 2024-01-25 17:36:26 +00:00
parent f17c2aea59
commit 9d3399d466
2 changed files with 4 additions and 4 deletions

View File

@ -342,8 +342,7 @@ static std::optional<unsigned> StringToOctal(const std::string& str)
static auto ConvertPermsToOctal(const std::string& str) noexcept -> std::optional<unsigned> static auto ConvertPermsToOctal(const std::string& str) noexcept -> std::optional<unsigned>
{ {
// Don't permit setting special bits as they're not relevant to cookie files if ((str.length() == 3) || (str.length() == 4)) return StringToOctal(str);
if (str.length() == 3) return StringToOctal(str);
return std::nullopt; return std::nullopt;
} }

View File

@ -127,8 +127,9 @@ class HTTPBasicsTest(BitcoinTestFramework):
"group": 0o640, "group": 0o640,
"all": 0o644, "all": 0o644,
"440": 0o440, "440": 0o440,
"640": 0o640, "0640": 0o640,
"444": 0o444, "444": 0o444,
"1660": 0o1660,
} }
if os.name == 'nt': if os.name == 'nt':
@ -137,7 +138,7 @@ class HTTPBasicsTest(BitcoinTestFramework):
self.log.info('Check cookie file permissions can be set using -rpccookieperms') self.log.info('Check cookie file permissions can be set using -rpccookieperms')
cookie_file_path = self.nodes[1].chain_path / '.cookie' cookie_file_path = self.nodes[1].chain_path / '.cookie'
PERM_BITS_UMASK = 0o777 PERM_BITS_UMASK = 0o7777
def test_perm(perm: Optional[str]): def test_perm(perm: Optional[str]):
if not perm: if not perm: