mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-08-04 05:54:48 +02:00
rpccookieperms: Allow setting setxid/sticky bits
Simply for backward compatibility
This commit is contained in:
parent
f17c2aea59
commit
9d3399d466
@ -342,8 +342,7 @@ static std::optional<unsigned> StringToOctal(const std::string& str)
|
||||
|
||||
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) return StringToOctal(str);
|
||||
if ((str.length() == 3) || (str.length() == 4)) return StringToOctal(str);
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
|
@ -127,8 +127,9 @@ class HTTPBasicsTest(BitcoinTestFramework):
|
||||
"group": 0o640,
|
||||
"all": 0o644,
|
||||
"440": 0o440,
|
||||
"640": 0o640,
|
||||
"0640": 0o640,
|
||||
"444": 0o444,
|
||||
"1660": 0o1660,
|
||||
}
|
||||
|
||||
if os.name == 'nt':
|
||||
@ -137,7 +138,7 @@ class HTTPBasicsTest(BitcoinTestFramework):
|
||||
self.log.info('Check cookie file permissions can be set using -rpccookieperms')
|
||||
|
||||
cookie_file_path = self.nodes[1].chain_path / '.cookie'
|
||||
PERM_BITS_UMASK = 0o777
|
||||
PERM_BITS_UMASK = 0o7777
|
||||
|
||||
def test_perm(perm: Optional[str]):
|
||||
if not perm:
|
||||
|
Loading…
Reference in New Issue
Block a user