Skip to content

Linux's chattr i.e. ioctl(FS_IOC_SETFLAGS) is not supported in os.chflags() #87105

Description

@socketpair
BPO 42939
Nosy @tiran, @socketpair, @eryksun, @corona10

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2021-01-16.14:25:34.618>
labels = ['library', '3.9', '3.10']
title = "Linux's chattr i.e. ioctl(FS_IOC_SETFLAGS) is not supported in os.chflags()"
updated_at = <Date 2021-01-30.20:50:43.418>
user = 'https://github.com/socketpair'

bugs.python.org fields:

activity = <Date 2021-01-30.20:50:43.418>
actor = 'eryksun'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2021-01-16.14:25:34.618>
creator = 'socketpair'
dependencies = []
files = []
hgrepos = []
issue_num = 42939
keywords = []
message_count = 2.0
messages = ['385141', '385995']
nosy_count = 4.0
nosy_names = ['christian.heimes', 'socketpair', 'eryksun', 'corona10']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue42939'
versions = ['Python 3.9', 'Python 3.10']

Activity

  1. socketpair commented on Jan 16, 2021

    socketpairmannequin
    MannequinAuthor

    https://man7.org/linux/man-pages/man2/ioctl_iflags.2.html

    Seems the ioctl is only way to implement chattr(). I propose to add all these flags to os.chflags() and to gain its support in Linux.

  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Jan 16, 2021
  3. eryksun commented on Jan 30, 2021

    @eryksun
    Contributor

    bpo-39533 is a related issue that seeks to support the Linux statx() system call. A statx record includes an stx_attributes field, which supports the following file attributes that can be set with chattr:

    [a]ppend    : STATX_ATTR_APPEND
    [c]ompressed: STATX_ATTR_COMPRESSED
    no [d]ump   : STATX_ATTR_NODUMP
    [i]mmutable : STATX_ATTR_IMMUTABLE
    da[x]       : STATX_ATTR_DAX (5.8)
    

    and the following read-only file attributes that can be listed with lsattr:

    [E]ncrypted : STATX_ATTR_ENCRYPTED
    [V]erity    : STATX_ATTR_VERITY (5.5)
    
  4. transferred this issue fromon Apr 10, 2022
  5. encukou commented on Aug 25, 2026

    @encukou
    Member

    This is a duplicate of #75494.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.10 (EOL)end of life3.9 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directory

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions