diff --git a/CHANGES.txt b/CHANGES.txt index 0f123645d9..48a33eb6f4 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -194,6 +194,7 @@ * Add the ability to disable bulk loading of SSTables (CASSANDRA-18781) * Clean up obsolete functions and simplify cql_version handling in cqlsh (CASSANDRA-18787) Merged from 5.0: + * 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) * zero copy streaming allocates direct memory that isn't used, but does help to fragment the memory space (CASSANDRA-20577) diff --git a/pylib/cqlshlib/util.py b/pylib/cqlshlib/util.py index 96d9bd272e..4474a46331 100644 --- a/pylib/cqlshlib/util.py +++ b/pylib/cqlshlib/util.py @@ -74,12 +74,15 @@ def identity(x): 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.