Skip to content

Commit 5d8d67f

Browse files
committed
Docs: Warn about display_as
This commit warns about the potential issues (segfaults with krb5 < 1.13.3 and incorrect behavior with canonicalized names) in the inline docs for `display_as`. Fixes #79
1 parent 3f45cbe commit 5d8d67f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

gssapi/names.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,21 @@ def display_as(self, name_type):
125125
This method attempts to display the current :class:`Name`
126126
using the syntax of the given :class:`NameType`, if possible.
127127
128+
Warning:
129+
130+
In MIT krb5 versions below 1.13.3, this method can segfault if
131+
the name was not *originally* created with a `name_type` that was
132+
not ``None`` (even in cases when a ``name_type``
133+
is later "added", such as via :meth:`canonicalize`).
134+
**Do not use this method unless you are sure the above
135+
conditions can never happen in your code.**
136+
137+
Warning:
138+
139+
In addition to the above warning, current versions of MIT krb5 do
140+
not actually fully implement this method, and it may return
141+
incorrect results in the case of canonicalized names.
142+
128143
:requires-ext:`rfc6680`
129144
130145
Args:

0 commit comments

Comments
 (0)