apple / ccs-pykerberos

Python Kerberos library used by CalendarServer
https://www.calendarserver.org
Apache License 2.0
117 stars 65 forks source link

Fix gss_server_state cast #65

Closed behackett closed 6 years ago

behackett commented 6 years ago

While testing builds of master I discovered that I got this cast wrong.

By submitting a request, you represent that you have the right to license your contribution to Apple and the community, and agree that your contributions are licensed under the Apache License Version 2.0.

For existing files modified by your request, you represent that you have retained any existing copyright notices and licensing terms. For each new file in your request, you represent that you have added to the file a copyright notice (including the year and the copyright owner's name) and the Calendar and Contacts Server's licensing terms.

Before submitting the request, please make sure that your request follows the Calendar and Contacts Server's guidelines for contributing code.

behackett commented 6 years ago

@dreness - you're going to need this before releasing.

dreness commented 6 years ago

@behackett Ok, thanks. While we're here, how hard would it be to add a test for the destructor stuff?

behackett commented 6 years ago

Good question. I'm not quite sure. The problem you previously would have had not calling authGSSClientClean() is you would leak memory, since the context object wouldn't be freed. That problem would compound over time as the process created more auth contexts. The destructor change just means the memory is freed without the application having to take any special action. I'm not sure the best way to test a memory leak in a Python unittest.

dreness commented 6 years ago

@behackett Yeah, it can be hard, and I'm fairly sure there are platform-specific influences as well. Let's proceed without a test in this case...