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
5ea823cf
Kaydet (Commit)
5ea823cf
authored
Agu 19, 2010
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Decode NIS data to fs encoding, using the surrogate error handler.
üst
f241afae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
9 deletions
+20
-9
NEWS
Misc/NEWS
+2
-1
nismodule.c
Modules/nismodule.c
+18
-8
No files found.
Misc/NEWS
Dosyayı görüntüle @
5ea823cf
...
...
@@ -69,7 +69,8 @@ Extensions
- Issue #5737: Add Solaris-specific mnemonics in the errno module. Patch by
Matthew Ahrens.
- Restore GIL in nis_cat in case of error.
- Restore GIL in nis_cat in case of error. Decode NIS data to fs encoding,
using the surrogate error handler.
- Issue #665761: ``functools.reduce()`` will no longer mask exceptions
other than ``TypeError`` raised by the iterator argument.
...
...
Modules/nismodule.c
Dosyayı görüntüle @
5ea823cf
...
...
@@ -117,8 +117,8 @@ nis_foreach (int instatus, char *inkey, int inkeylen, char *inval,
if
(
invallen
>
0
&&
inval
[
invallen
-
1
]
==
'\0'
)
invallen
--
;
}
key
=
PyUnicode_
FromString
AndSize
(
inkey
,
inkeylen
);
val
=
PyUnicode_
FromString
AndSize
(
inval
,
invallen
);
key
=
PyUnicode_
DecodeFSDefault
AndSize
(
inkey
,
inkeylen
);
val
=
PyUnicode_
DecodeFSDefault
AndSize
(
inval
,
invallen
);
if
(
key
==
NULL
||
val
==
NULL
)
{
/* XXX error -- don't know how to handle */
PyErr_Clear
();
...
...
@@ -159,30 +159,40 @@ nis_match (PyObject *self, PyObject *args, PyObject *kwdict)
{
char
*
match
;
char
*
domain
=
NULL
;
int
keylen
,
len
;
Py_ssize_t
keylen
;
int
len
;
char
*
key
,
*
map
;
int
err
;
PyObject
*
res
;
PyObject
*
ukey
,
*
bkey
,
*
res
;
int
fix
;
static
char
*
kwlist
[]
=
{
"key"
,
"map"
,
"domain"
,
NULL
};
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwdict
,
"
s#
s|s:match"
,
kwlist
,
&
key
,
&
keylen
,
&
map
,
&
domain
))
"
U
s|s:match"
,
kwlist
,
&
ukey
,
&
map
,
&
domain
))
return
NULL
;
if
(
!
domain
&&
((
err
=
yp_get_default_domain
(
&
domain
))
!=
0
))
if
((
bkey
=
PyUnicode_EncodeFSDefault
(
ukey
))
==
NULL
)
return
NULL
;
if
(
PyBytes_AsStringAndSize
(
bkey
,
&
key
,
&
keylen
)
==
-
1
)
{
Py_DECREF
(
bkey
);
return
NULL
;
}
if
(
!
domain
&&
((
err
=
yp_get_default_domain
(
&
domain
))
!=
0
))
{
Py_DECREF
(
bkey
);
return
nis_error
(
err
);
}
map
=
nis_mapname
(
map
,
&
fix
);
if
(
fix
)
keylen
++
;
Py_BEGIN_ALLOW_THREADS
err
=
yp_match
(
domain
,
map
,
key
,
keylen
,
&
match
,
&
len
);
Py_END_ALLOW_THREADS
Py_DECREF
(
bkey
);
if
(
fix
)
len
--
;
if
(
err
!=
0
)
return
nis_error
(
err
);
res
=
PyUnicode_
FromStringAndSize
(
match
,
len
);
res
=
PyUnicode_
DecodeFSDefaultAndSize
(
match
,
len
);
free
(
match
);
return
res
;
}
...
...
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