summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-08-22 12:35:29 +0200
committerStefan Metzmacher <metze@samba.org>2012-08-24 13:43:31 +0200
commit774c28416bd05c66f398dfbc999cff0e209b3620 (patch)
tree5c88461f911d43a6e6eb3e4958d692e5fdaa831a
parent99b134adbe6b02388665c3b34f00b6723f6a1120 (diff)
downloadsamba-774c28416bd05c66f398dfbc999cff0e209b3620.tar.gz
samba-774c28416bd05c66f398dfbc999cff0e209b3620.tar.bz2
samba-774c28416bd05c66f398dfbc999cff0e209b3620.zip
s3:g_lock: use serverid_exists() with SERVERID_UNIQUE_ID_NOT_TO_VERIFY
metze
-rw-r--r--source3/lib/g_lock.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source3/lib/g_lock.c b/source3/lib/g_lock.c
index 4535b35569..fbd90225f0 100644
--- a/source3/lib/g_lock.c
+++ b/source3/lib/g_lock.c
@@ -29,6 +29,7 @@
#include "../lib/util/tevent_ntstatus.h"
#include "system/select.h"
#include "messages.h"
+#include "serverid.h"
struct g_lock_ctx {
struct db_context *db;
@@ -124,8 +125,16 @@ static NTSTATUS g_lock_trylock(struct db_record *rec, struct server_id self,
goto done;
}
if (g_lock_conflicts(type, locks[i].lock_type)) {
+ struct server_id pid = locks[i].pid;
- if (process_exists(locks[i].pid)) {
+ /*
+ * As the serverid_exists might recurse into
+ * the g_lock code, we use
+ * SERVERID_UNIQUE_ID_NOT_TO_VERIFY to avoid the loop
+ */
+ pid.unique_id = SERVERID_UNIQUE_ID_NOT_TO_VERIFY;
+
+ if (serverid_exists(&pid)) {
status = NT_STATUS_LOCK_NOT_GRANTED;
goto done;
}