[issue35677] Do not automount in stat() by default

Serhiy Storchaka report at bugs.python.org
Mon Jan 7 04:18:02 EST 2019


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

There is a subtle difference between implementations of os.stat() that use system calls stat() and fstatat(). On Linux, fstatat() by default automounts the terminal ("basename") component of pathname if it is a directory that is an automount point. The Linux-specific AT_NO_AUTOMOUNT flag should be set to prevent automounting. Both stat() and lstat() act as though AT_NO_AUTOMOUNT was set.

Therefore os.stat() should set AT_NO_AUTOMOUNT if it is defined to simulate the behavior of stat() and lstat(). New keyword parameter can be added to os.stat() in new Python release to control this behavior.

There is the same issue with DirEntry.stat().

----------
components: Extension Modules
messages: 333143
nosy: larry, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Do not automount in stat() by default
type: behavior
versions: Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35677>
_______________________________________


More information about the Python-bugs-list mailing list