Issue35677
Created on 2019-01-07 09:17 by serhiy.storchaka, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 11455 | closed | serhiy.storchaka, 2019-01-07 09:30 | |
| PR 11455 | closed | serhiy.storchaka, 2019-01-07 09:30 | |
| PR 11455 | closed | serhiy.storchaka, 2019-01-07 09:30 | |
| Messages (5) | |||
|---|---|---|---|
| msg333143 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2019-01-07 09:17 | |
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().
|
|||
| msg333155 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2019-01-07 14:40 | |
What if someone relies on the current behavior of os.stat(filename, dir_fd=fd)? Would it make sense to add a new "automount=False" optional parameter to os.stat()? AT_NO_AUTOMOUNT would only be added if automount is false. |
|||
| msg333291 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2019-01-09 06:53 | |
I was going to merge PR 11455 as a bug fix and backport it to 3.7, and add a new "automount=False" optional parameter in a separate issue. |
|||
| msg414852 - (view) | Author: Pádraig Brady (pixelbeat) | Date: 2022-03-10 15:30 | |
I think this change is not needed as fstatat() implies AT_NO_AUTOMOUNT since Linux 4.11 The fstatat(2) man page is confusing, and I've attempted to clarify with the patch attached to: https://lists.gnu.org/archive/html/coreutils/2022-03/msg00014.html |
|||
| msg414894 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2022-03-11 08:38 | |
Glad to see that this old inconsistency was fixed. But seems that if we will add support for statx() we will need to set AT_NO_AUTOMOUNT by default. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:10 | admin | set | github: 79858 |
| 2022-03-11 08:38:02 | serhiy.storchaka | set | status: open -> closed messages: + msg414894 keywords:
patch, patch, patch |
| 2022-03-10 15:30:06 | pixelbeat | set | nosy:
+ pixelbeat messages: + msg414852 |
| 2019-01-09 06:53:06 | serhiy.storchaka | set | keywords:
patch, patch, patch messages: + msg333291 |
| 2019-01-07 14:40:56 | vstinner | set | keywords:
patch, patch, patch nosy: + vstinner messages: + msg333155 |
| 2019-01-07 09:30:45 | serhiy.storchaka | set | keywords:
+ patch stage: patch review pull_requests: + pull_request10926 |
| 2019-01-07 09:30:40 | serhiy.storchaka | set | keywords:
+ patch stage: (no value) pull_requests: + pull_request10925 |
| 2019-01-07 09:30:35 | serhiy.storchaka | set | keywords:
+ patch stage: (no value) pull_requests: + pull_request10924 |
| 2019-01-07 09:17:58 | serhiy.storchaka | create | |
