[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Freeipa-devel] [PATCH] Fix saving new nextID



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The attached patch fixes the problem when sss_ tools segfaulted when
there was no nextID for a given domain.

Jakub
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkpds+IACgkQHsardTLnvCWq3QCfX8xvsshpsd4Gsh4nZncvpzw0
Yy4AoJmlkMUOjA2gyEyGaTm0Ki4Urd9k
=LfeM
-----END PGP SIGNATURE-----
From 19285c0d37065cdc998e9ce6b1861e4dd165ebe1 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek redhat com>
Date: Wed, 15 Jul 2009 12:43:08 +0200
Subject: [PATCH] Fix saving new nextID

---
 server/db/sysdb_ops.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/server/db/sysdb_ops.c b/server/db/sysdb_ops.c
index ad4a63e..8e566aa 100644
--- a/server/db/sysdb_ops.c
+++ b/server/db/sysdb_ops.c
@@ -1448,7 +1448,16 @@ static void sysdb_get_new_id_verify(struct tevent_req *subreq)
         tevent_req_error(req, ENOMEM);
         return;
     }
-    msg->dn = state->base->dn;
+
+    if (state->base) {
+        msg->dn = state->base->dn;
+    } else {
+        msg->dn = sysdb_domain_dn(state->handle->ctx, state, state->domain->name);
+        if(!msg->dn) {
+            tevent_req_error(req, ENOMEM);
+            return;
+        }
+    }
 
     ret = add_ulong(msg, LDB_FLAG_MOD_REPLACE,
                     SYSDB_NEXTID, state->new_id + 1);
-- 
1.6.2.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]