mirror of https://github.com/apache/cassandra
Avoid CQLSH throwing an exception loading .cqlshrc on non-supported platforms
While we do not support Windows as such (at least on server), reviewers evaluated that this might be fixed as the gains (Windows users using CQLSH to connect to Cassandra running on supported platforms) are justified. patch by Brad Schoening; reviewed by Brandon Williams, Josh McKenzie for CASSANDRA-20478
This commit is contained in:
parent
ac05c94e6a
commit
49c8122d8f
|
|
@ -1,4 +1,5 @@
|
|||
5.0.5
|
||||
* Avoid CQLSH throwing an exception loading .cqlshrc on non-supported platforms (CASSANDRA-20478)
|
||||
* Relax validation of snapshot name as a part of SSTable files path validation (CASSANDRA-20649)
|
||||
* Optimize initial skipping logic for SAI queries on large partitions (CASSANDRA-20191)
|
||||
* Fix reading mmapped trie-index exceeding 2GiB (CASSANDRA-20351)
|
||||
|
|
|
|||
|
|
@ -117,12 +117,15 @@ def trim_if_present(s, prefix):
|
|||
def is_file_secure(filename):
|
||||
try:
|
||||
st = os.stat(filename)
|
||||
uid = os.getuid()
|
||||
except OSError as e:
|
||||
if e.errno != errno.ENOENT:
|
||||
raise
|
||||
# the file doesn't exist, the security of it is irrelevant
|
||||
return True
|
||||
uid = os.getuid()
|
||||
except AttributeError as e:
|
||||
# not-Unix os
|
||||
return True
|
||||
|
||||
# Skip enforcing the file owner and UID matching for the root user (uid == 0).
|
||||
# This is to allow "sudo cqlsh" to work with user owned credentials file.
|
||||
|
|
|
|||
Loading…
Reference in New Issue