Bug 48685 - Add debug message for unknown exceptions in patched heimdal password change
Add debug message for unknown exceptions in patched heimdal password change
Status: NEW
Product: UCS
Classification: Unclassified
Component: Password changes
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-02-14 20:45 CET by Florian Best
Modified: 2020-07-02 00:55 CEST (History)
0 users

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Error handling, Troubleshooting
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2019-02-14 20:45:25 CET
We've a patched heimdal kpasswdd which calls univention.admin.password.change().

Quoting from svn/patches/heimdal/4.2-0-0-ucs/1.6~rc2+dfsg-9-errata4.2-1/0001-password_sync.quilt:

+    call = PyEval_CallObject(lib_password_change, args);
+
+    if (call == NULL) {
+    »  PyErr_Fetch(&errobj, &errdata, &errtraceback);
+    »  pystring = PyObject_Str(errobj);
+    »  if ( PyString_Check(pystring) ) {
+    »  »   const char *err = PyString_AsString(pystring);
+    »  »   ucs_error = 1;
+
+    »  »   if( !strcmp(err, "<class 'univention.admin.uexceptions.pwalreadyused'>")) {
+    »  »   »   krb5_warnx (context, "%s", err);
+    »  »   »   reply_priv (auth_context, s, sa, sa_size, KRB5_KPASSWD_SOFTERROR, "Password already used");
+    »  »   } else if( !strcmp(err, "<class 'univention.admin.uexceptions.pwToShort'>")) {
+    »  »   »   krb5_warnx (context,"%s",  err);
+    »  »   »   reply_priv (auth_context, s, sa, sa_size, KRB5_KPASSWD_SOFTERROR, "Password is too short");
+    »  »   } else if( !strcmp(err, "<class 'univention.admin.uexceptions.pwQuality'>")) {
+    »  »   »   krb5_warnx (context, "%s", err);
+    »  »   »   reply_priv (auth_context, s, sa, sa_size, KRB5_KPASSWD_SOFTERROR, "The passwort didn't pass quality check");
+    »  »   } else {
+    »  »   »   /*
+    »  »   »    * Ignore all other errors, for example the user is not
+    »  »   »    * a valid UCS user.
+    »  »   »    */
+    »  »   »   ucs_error = -1;
+    »  »   }
+    »  }


The "else { Ignore all other errors }" block should create a log message with the "err" string!