@@ -14885,14 +14885,27 @@ static authn_status wsgi_check_password(request_rec *r, const char *user,
14885
14885
adapter = newAuthObject(r, config);
14886
14886
14887
14887
if (adapter) {
14888
+ PyObject *user_string = NULL;
14889
+ PyObject *password_string = NULL;
14890
+
14891
+ #if PY_MAJOR_VERSION >= 3
14892
+ user_string = PyUnicode_DecodeLatin1(user, strlen(user), NULL);
14893
+ password_string = PyUnicode_DecodeLatin1(password, strlen(password), NULL);
14894
+ #else
14895
+ user_string = PyString_FromString(user);
14896
+ password_string = PyString_FromString(password);
14897
+ #endif
14898
+
14888
14899
vars = Auth_environ(adapter, group);
14889
14900
14890
14901
Py_INCREF(object);
14891
- args = Py_BuildValue("(Oss )", vars, user, password );
14902
+ args = Py_BuildValue("(OOO )", vars, user_string, password_string );
14892
14903
result = PyObject_CallObject(object, args);
14893
14904
Py_DECREF(args);
14894
14905
Py_DECREF(object);
14895
14906
Py_DECREF(vars);
14907
+ Py_DECREF(user_string);
14908
+ Py_DECREF(password_string);
14896
14909
14897
14910
if (result) {
14898
14911
if (result == Py_None) {
@@ -15128,14 +15141,27 @@ static authn_status wsgi_get_realm_hash(request_rec *r, const char *user,
15128
15141
adapter = newAuthObject(r, config);
15129
15142
15130
15143
if (adapter) {
15144
+ PyObject *user_string = NULL;
15145
+ PyObject *realm_string = NULL;
15146
+
15147
+ #if PY_MAJOR_VERSION >= 3
15148
+ user_string = PyUnicode_DecodeLatin1(user, strlen(user), NULL);
15149
+ realm_string = PyUnicode_DecodeLatin1(realm, strlen(realm), NULL);
15150
+ #else
15151
+ user_string = PyString_FromString(user);
15152
+ realm_string = PyString_FromString(realm);
15153
+ #endif
15154
+
15131
15155
vars = Auth_environ(adapter, group);
15132
15156
15133
15157
Py_INCREF(object);
15134
- args = Py_BuildValue("(Oss )", vars, user, realm );
15158
+ args = Py_BuildValue("(OOO )", vars, user_string, realm_string );
15135
15159
result = PyObject_CallObject(object, args);
15136
15160
Py_DECREF(args);
15137
15161
Py_DECREF(object);
15138
15162
Py_DECREF(vars);
15163
+ Py_DECREF(user_string);
15164
+ Py_DECREF(realm_string);
15139
15165
15140
15166
if (result) {
15141
15167
if (result == Py_None) {
@@ -15379,14 +15405,23 @@ static int wsgi_groups_for_user(request_rec *r, WSGIRequestConfig *config,
15379
15405
adapter = newAuthObject(r, config);
15380
15406
15381
15407
if (adapter) {
15408
+ PyObject *user_string = NULL;
15409
+
15410
+ #if PY_MAJOR_VERSION >= 3
15411
+ user_string = PyUnicode_DecodeLatin1(r->user, strlen(r->user), NULL);
15412
+ #else
15413
+ user_string = PyString_FromString(r->user);
15414
+ #endif
15415
+
15382
15416
vars = Auth_environ(adapter, group);
15383
15417
15384
15418
Py_INCREF(object);
15385
- args = Py_BuildValue("(Os )", vars, r->user );
15419
+ args = Py_BuildValue("(OO )", vars, user_string );
15386
15420
result = PyObject_CallObject(object, args);
15387
15421
Py_DECREF(args);
15388
15422
Py_DECREF(object);
15389
15423
Py_DECREF(vars);
15424
+ Py_DECREF(user_string);
15390
15425
15391
15426
if (result) {
15392
15427
PyObject *iterator;
@@ -15930,14 +15965,27 @@ static int wsgi_hook_check_user_id(request_rec *r)
15930
15965
adapter = newAuthObject(r, config);
15931
15966
15932
15967
if (adapter) {
15968
+ PyObject *user_string = NULL;
15969
+ PyObject *password_string = NULL;
15970
+
15971
+ #if PY_MAJOR_VERSION >= 3
15972
+ user_string = PyUnicode_DecodeLatin1(r->user, strlen(r->user), NULL);
15973
+ password_string = PyUnicode_DecodeLatin1(password, strlen(password), NULL);
15974
+ #else
15975
+ user_string = PyString_FromString(r->user);
15976
+ password_string = PyString_FromString(password);
15977
+ #endif
15978
+
15933
15979
vars = Auth_environ(adapter, group);
15934
15980
15935
15981
Py_INCREF(object);
15936
- args = Py_BuildValue("(Oss )", vars, r->user, password );
15982
+ args = Py_BuildValue("(OOO )", vars, user_string, password_string );
15937
15983
result = PyObject_CallObject(object, args);
15938
15984
Py_DECREF(args);
15939
15985
Py_DECREF(object);
15940
15986
Py_DECREF(vars);
15987
+ Py_DECREF(user_string);
15988
+ Py_DECREF(password_string);
15941
15989
15942
15990
if (result) {
15943
15991
if (result == Py_None) {
0 commit comments