diff --git a/CHANGES.txt b/CHANGES.txt index 8c64d012f0..4aaed8bdb9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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) diff --git a/pylib/cqlshlib/util.py b/pylib/cqlshlib/util.py index 144586aae0..90d95b9afe 100644 --- a/pylib/cqlshlib/util.py +++ b/pylib/cqlshlib/util.py @@ -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.