From f9e0b8aca502357d64f4816204ddcb2c7e876c8d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 7 Aug 2005 06:16:10 +0000 Subject: r9172: - fixed a nasty bug in the 'deep copy' mpr code that caused variables called 'credentials' to not copy correctly (the bug was in handling of chaining in the copy code - ensure that C pointer variables are copied via a talloc reference so that we can persist rpc pipes and credentials between sessions (This used to be commit ca6f049693f8bfe69d5c7533b2cc92221d0cf6d4) --- source4/lib/appweb/mpr/var.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4/lib/appweb') diff --git a/source4/lib/appweb/mpr/var.c b/source4/lib/appweb/mpr/var.c index 9b02c0f8b0..77f4cbc55a 100644 --- a/source4/lib/appweb/mpr/var.c +++ b/source4/lib/appweb/mpr/var.c @@ -1416,7 +1416,9 @@ static void copyVarCore(MprVar *dest, MprVar *src, int copyDepth) break; case MPR_TYPE_PTR: - dest->ptr = src->ptr; + /* we have to reference here so talloc structures survive a + copy */ + dest->ptr = talloc_reference(dest, src->ptr); break; case MPR_TYPE_STRING_CFUNCTION: @@ -1477,7 +1479,7 @@ static void copyVarCore(MprVar *dest, MprVar *src, int copyDepth) srcProp->visited = 1; copyVarCore(destProp, srcProp, copyDepth); srcProp->visited = 0; - last = srcProp; + last = destProp; } } dest->properties->numItems = src->properties->numItems; -- cgit