Author: tridge
Date: 2005-08-07 06:16:10 +0000 (Sun, 07 Aug 2005)
New Revision: 9172

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9172

Log:
- 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


Modified:
   branches/SAMBA_4_0/source/lib/appweb/mpr/var.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/appweb/mpr/var.c
===================================================================
--- branches/SAMBA_4_0/source/lib/appweb/mpr/var.c      2005-08-07 06:13:55 UTC 
(rev 9171)
+++ branches/SAMBA_4_0/source/lib/appweb/mpr/var.c      2005-08-07 06:16:10 UTC 
(rev 9172)
@@ -1416,7 +1416,9 @@
                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 @@
                                        srcProp->visited = 1;
                                        copyVarCore(destProp, srcProp, 
copyDepth);
                                        srcProp->visited = 0;
-                                       last = srcProp;
+                                       last = destProp;
                                }
                        }
                        dest->properties->numItems = src->properties->numItems;

Reply via email to