classification
Title: Add file-sealing ops to fcntl
Type: enhancement Stage: patch review
Components: Extension Modules Versions: Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, nanjekyejoannah
Priority: normal Keywords: patch

Created on 2016-04-24 13:53 by christian.heimes, last changed 2019-05-31 16:32 by christian.heimes.

Pull Requests
URL Status Linked Edit
PR 13015 closed nanjekyejoannah, 2019-04-29 21:30
PR 13694 merged christian.heimes, 2019-05-31 09:36
Messages (2)
msg264108 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2016-04-24 13:53
The file-sealing ops are useful for memfd_create(). The new syscall and ops are only available on Linux with a recent kernel.

http://man7.org/linux/man-pages/man2/fcntl.2.html
http://man7.org/linux/man-pages/man2/memfd_create.2.html

Code:

#include <linux/fcntl.h>

#ifndef F_ADD_SEALS

/*
 * Set/Get seals
 */
#define F_ADD_SEALS     (F_LINUX_SPECIFIC_BASE + 9)
#define F_GET_SEALS     (F_LINUX_SPECIFIC_BASE + 10)

/*
 * Types of seals
 */
#define F_SEAL_SEAL     0x0001  /* prevent further seals from being set */
#define F_SEAL_SHRINK   0x0002  /* prevent file from shrinking */
#define F_SEAL_GROW     0x0004  /* prevent file from growing */
#define F_SEAL_WRITE    0x0008  /* prevent writes */
/* (1U << 31) is reserved for signed error codes */

#endif /* F_ADD_SEALS */
msg344087 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-05-31 16:32
New changeset 8cbb5b6625268400d6e9092b75b06d6f90398dc9 by Christian Heimes in branch 'master':
bpo-26835: Add file sealing constants to fcntl (GH-13694)
https://github.com/python/cpython/commit/8cbb5b6625268400d6e9092b75b06d6f90398dc9
History
Date User Action Args
2019-05-31 16:32:36christian.heimessetmessages: + msg344087
2019-05-31 09:36:56christian.heimessetpull_requests: + pull_request13580
2019-04-29 21:30:56nanjekyejoannahsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request12938
2019-04-28 02:38:39nanjekyejoannahsetnosy: + nanjekyejoannah
2016-06-12 11:22:18christian.heimessetassignee: christian.heimes ->
2016-04-24 13:53:19christian.heimescreate