Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
6a65f85e
Kaydet (Commit)
6a65f85e
authored
Mar 01, 2010
tarafından
Gregory P. Smith
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixes issue #7999: os.setreuid() and os.setregid() would refuse to accept
a -1 parameter on some platforms such as OS X.
üst
3c699d33
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
6 deletions
+25
-6
test_os.py
Lib/test/test_os.py
+2
-0
NEWS
Misc/NEWS
+3
-0
posixmodule.c
Modules/posixmodule.c
+20
-6
No files found.
Lib/test/test_os.py
Dosyayı görüntüle @
6a65f85e
...
@@ -642,6 +642,7 @@ if sys.platform != 'win32':
...
@@ -642,6 +642,7 @@ if sys.platform != 'win32':
self
.
assertRaises
(
os
.
error
,
os
.
setreuid
,
0
,
0
)
self
.
assertRaises
(
os
.
error
,
os
.
setreuid
,
0
,
0
)
self
.
assertRaises
(
OverflowError
,
os
.
setreuid
,
1
<<
32
,
0
)
self
.
assertRaises
(
OverflowError
,
os
.
setreuid
,
1
<<
32
,
0
)
self
.
assertRaises
(
OverflowError
,
os
.
setreuid
,
0
,
1
<<
32
)
self
.
assertRaises
(
OverflowError
,
os
.
setreuid
,
0
,
1
<<
32
)
os
.
setreuid
(
-
1
,
-
1
)
# Does nothing, but it needs to accept -1
if
hasattr
(
os
,
'setregid'
):
if
hasattr
(
os
,
'setregid'
):
def
test_setregid
(
self
):
def
test_setregid
(
self
):
...
@@ -649,6 +650,7 @@ if sys.platform != 'win32':
...
@@ -649,6 +650,7 @@ if sys.platform != 'win32':
self
.
assertRaises
(
os
.
error
,
os
.
setregid
,
0
,
0
)
self
.
assertRaises
(
os
.
error
,
os
.
setregid
,
0
,
0
)
self
.
assertRaises
(
OverflowError
,
os
.
setregid
,
1
<<
32
,
0
)
self
.
assertRaises
(
OverflowError
,
os
.
setregid
,
1
<<
32
,
0
)
self
.
assertRaises
(
OverflowError
,
os
.
setregid
,
0
,
1
<<
32
)
self
.
assertRaises
(
OverflowError
,
os
.
setregid
,
0
,
1
<<
32
)
os
.
setregid
(
-
1
,
-
1
)
# Does nothing, but it needs to accept -1
else
:
else
:
class
PosixUidGidTests
(
unittest
.
TestCase
):
class
PosixUidGidTests
(
unittest
.
TestCase
):
pass
pass
...
...
Misc/NEWS
Dosyayı görüntüle @
6a65f85e
...
@@ -93,6 +93,9 @@ Extension Modules
...
@@ -93,6 +93,9 @@ Extension Modules
thread could raise an incorrect RuntimeError about not holding the import
thread could raise an incorrect RuntimeError about not holding the import
lock. The import lock is now reinitialized after fork.
lock. The import lock is now reinitialized after fork.
- Issue #7999: os.setreuid() and os.setregid() would refuse to accept a -1
parameter on some platforms such as OS X.
Tests
Tests
-----
-----
...
...
Modules/posixmodule.c
Dosyayı görüntüle @
6a65f85e
...
@@ -5650,9 +5650,16 @@ posix_setreuid (PyObject *self, PyObject *args)
...
@@ -5650,9 +5650,16 @@ posix_setreuid (PyObject *self, PyObject *args)
uid_t
ruid
,
euid
;
uid_t
ruid
,
euid
;
if
(
!
PyArg_ParseTuple
(
args
,
"ll"
,
&
ruid_arg
,
&
euid_arg
))
if
(
!
PyArg_ParseTuple
(
args
,
"ll"
,
&
ruid_arg
,
&
euid_arg
))
return
NULL
;
return
NULL
;
ruid
=
ruid_arg
;
if
(
ruid_arg
==
-
1
)
euid
=
euid_arg
;
ruid
=
(
uid_t
)
-
1
;
/* let the compiler choose how -1 fits */
if
(
euid
!=
euid_arg
||
ruid
!=
ruid_arg
)
{
else
ruid
=
ruid_arg
;
/* otherwise, assign from our long */
if
(
euid_arg
==
-
1
)
euid
=
(
uid_t
)
-
1
;
else
euid
=
euid_arg
;
if
((
euid_arg
!=
-
1
&&
euid
!=
euid_arg
)
||
(
ruid_arg
!=
-
1
&&
ruid
!=
ruid_arg
))
{
PyErr_SetString
(
PyExc_OverflowError
,
"user id too big"
);
PyErr_SetString
(
PyExc_OverflowError
,
"user id too big"
);
return
NULL
;
return
NULL
;
}
}
...
@@ -5677,9 +5684,16 @@ posix_setregid (PyObject *self, PyObject *args)
...
@@ -5677,9 +5684,16 @@ posix_setregid (PyObject *self, PyObject *args)
gid_t
rgid
,
egid
;
gid_t
rgid
,
egid
;
if
(
!
PyArg_ParseTuple
(
args
,
"ll"
,
&
rgid_arg
,
&
egid_arg
))
if
(
!
PyArg_ParseTuple
(
args
,
"ll"
,
&
rgid_arg
,
&
egid_arg
))
return
NULL
;
return
NULL
;
rgid
=
rgid_arg
;
if
(
rgid_arg
==
-
1
)
egid
=
egid_arg
;
rgid
=
(
gid_t
)
-
1
;
/* let the compiler choose how -1 fits */
if
(
egid
!=
egid_arg
||
rgid
!=
rgid_arg
)
{
else
rgid
=
rgid_arg
;
/* otherwise, assign from our long */
if
(
egid_arg
==
-
1
)
egid
=
(
gid_t
)
-
1
;
else
egid
=
egid_arg
;
if
((
egid_arg
!=
-
1
&&
egid
!=
egid_arg
)
||
(
rgid_arg
!=
-
1
&&
rgid
!=
rgid_arg
))
{
PyErr_SetString
(
PyExc_OverflowError
,
"group id too big"
);
PyErr_SetString
(
PyExc_OverflowError
,
"group id too big"
);
return
NULL
;
return
NULL
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment