Comments (1)
The following patches should allow the module to build on AIX and work well at run time. I can submit them in a pull request if they'd be accepted.
--- a/src/kerberospw.c
+++ b/src/kerberospw.c
@@ -131,24 +131,33 @@
}
if (result_code) {
char *message = NULL;
- bytes = asprintf(
- &message, "%.*s: %.*s",
- (int) result_code_string.length,
- (char *) result_code_string.data,
- (int) result_string.length,
- (char *) result_string.data
- );
- if (bytes == -1)
- {
- PyErr_NoMemory();
+ int msgSz =
+ (int) result_code_string.length +
+ (int) result_string.length + 2 + 1; // as per format string + null term
+ message = (char *)malloc(msgSz);
+ if (message) {
+ int rc = snprintf(
+ message, msgSz, "%.*s: %.*s",
+ (int) result_code_string.length,
+ (char *) result_code_string.data,
+ (int) result_string.length,
+ (char *) result_string.data
+ );
+ if (rc > 0 && rc <= msgSz) {
+ PyErr_SetObject(
+ PwdChangeException_class,
+ Py_BuildValue("((s:i))", message, result_code)
+ );
+ }
+ else
+ {
+ PyErr_NoMemory();
+ }
+ free(message);
}
else
{
- PyErr_SetObject(
- PwdChangeException_class,
- Py_BuildValue("((s:i))", message, result_code)
- );
- free(message);
+ PyErr_NoMemory();
}
goto end;
}
--- a/src/kerberosgss.c
+++ b/src/kerberosgss.c
@@ -34,6 +34,14 @@
extern PyObject *GssException_class;
extern PyObject *KrbException_class;
+#if defined(__xlC__) || defined(_AIX) || (defined(__SVR4) && defined(__sun))
+void *
+mempcpy (void *dest, const void *src, size_t len)
+{
+ return memcpy (dest, src, len) + len;
+}
+#endif
+
char* server_principal_details(const char* service, const char* hostname)
{
char match[1024];
from ccs-pykerberos.
Related Issues (20)
- current pypi release (1.2.5) is incompatible with python 3 HOT 3
- Cannot build or install from pip due to krb5-config HOT 4
- GCC unrecognised command line option -m prevents install, Python 3.6 HOT 1
- checkPassword gives Permission Denied Error
- destructors don't appear to be called: leaking memory & file descriptors HOT 19
- Support authGSSServerWrap/Unwrap() ?
- _HOST in principal is not supported HOT 1
- .travis.yml: The 'sudo' tag is now deprecated in Travis CI
- Does pykerberos support both Windows and POSIX systems? HOT 3
- Is there any way to authenticate using password?
- windows authentication giving error "kerberos: Bad HTTP response returned from server. Code 500" in new virtual environment | Ansible HOT 3
- README rename from rst to md has broken setup.py HOT 1
- SystemError thrown with Python 3.10 HOT 6
- Add ccs-pykerberos to conda-forge
- How are you building wheels?
- Add pre-built wheel for python 3.10 HOT 1
- Issue install in venv in CentOS 8 with Python 3.9 HOT 2
- Use cibuildwheel to automatically publish wheels for more environments
- Memory leak in kerberos.authGSSServerStep() HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ccs-pykerberos.