8000 [3.13] gh-116622: Don't expose `FICLONE` ioctl on Android (GH-122522)… · python/cpython@69cf92f · GitHub
[go: up one dir, main page]

Skip to content

Commit 69cf92f

Browse files
miss-islingtonmhsmithfreakboy3742
authored
[3.13] gh-116622: Don't expose FICLONE ioctl on Android (GH-122522) (#122539)
gh-116622: Don't expose `FICLONE` ioctl on Android (GH-122522) Don't expose `FICLONE` ioctl on Android (cherry picked from commit 06656e2) Co-authored-by: Malcolm Smith <smith@chaquo.com> Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
1 parent a604b24 commit 69cf92f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
On Android, the ``FICLONE`` and ``FICLONERANGE`` constants are no longer
2+
exposed by :mod:`fcntl`, as these ioctls are blocked by SELinux.

Modules/fcntlmodule.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,12 +580,17 @@ all_ins(PyObject* m)
580580
#ifdef F_GETPIPE_SZ
581581
if (PyModule_AddIntMacro(m, F_GETPIPE_SZ)) return -1;
582582
#endif
583+
584+
/* On Android, FICLONE is blocked by SELinux. */
585+
#ifndef __ANDROID__
583586
#ifdef FICLONE
584587
if (PyModule_AddIntMacro(m, FICLONE)) return -1;
585588
#endif
586589
#ifdef FICLONERANGE
587590
if (PyModule_AddIntMacro(m, FICLONERANGE)) return -1;
588591
#endif
592+
#endif
593+
589594
#ifdef F_GETOWN_EX
590595
// since Linux 2.6.32
591596
if (PyModule_AddIntMacro(m, F_GETOWN_EX)) return -1;

0 commit comments

Comments
 (0)
0