s3-passdb: Display username when reporting error on add_sam_account.
[idra/samba.git] / source3 / passdb / py_passdb.c
index 54dbb0d3893bd357757d4d7ca6b2c423cc8b78b3..878886d6d520ab3f49b33509730a568237969750 100644 (file)
@@ -1366,7 +1366,8 @@ static PyObject *py_pdb_add_sam_account(pytalloc_Object *self, PyObject *args)
 
        status = methods->add_sam_account(methods, sam_acct);
        if (!NT_STATUS_IS_OK(status)) {
-               PyErr_Format(py_pdb_error, "Unable to add sam account, (%d,%s)",
+               PyErr_Format(py_pdb_error, "Unable to add sam account '%s', (%d,%s)",
+                               sam_acct->username,
                                NT_STATUS_V(status),
                                get_friendly_nt_error_msg(status));
                talloc_free(tframe);