summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorslioch <slioch@eng-140.vyatta.com>2009-03-02 22:28:16 -0800
committerslioch <slioch@eng-140.vyatta.com>2009-03-02 22:28:16 -0800
commit8a66041f90db8205db50fd83aed8001175c787ed (patch)
tree0f389f64ca92ee5fd8aa72e6b77dcca4b669ec9f
parentc6647afef2c1f8a64fb0ad423f4d7f56cd0e7a4f (diff)
downloadvyatta-cfg-8a66041f90db8205db50fd83aed8001175c787ed.tar.gz
vyatta-cfg-8a66041f90db8205db50fd83aed8001175c787ed.zip
added fix for nested priority and deletion failure. also priorities should not reside
on node.tags, but on parent (node name of multinode)--this is to prevent priorities splitting behaviors between different priorities on multinodes.
-rw-r--r--src/common/unionfs.c26
-rw-r--r--templates/priority22
2 files changed, 30 insertions, 18 deletions
diff --git a/src/common/unionfs.c b/src/common/unionfs.c
index 0aaffe0..4cb2ed6 100644
--- a/src/common/unionfs.c
+++ b/src/common/unionfs.c
@@ -1066,8 +1066,10 @@ delete_func(GNode *node, gpointer data)
char *command = malloc(MAX_LENGTH_DIR_PATH);
struct SrcDst *sd = (struct SrcDst*)data;
+ //DONT HAVE THE COMMAND BELOW BLOW AWAY WHITEOUT FILES!!!!!
static const char format[]="rm -f %s%s{*,.*} >&/dev/null;rmdir %s%s >&/dev/null ; /bin/true"; //need to remove opaque file.
- static const char format_force_delete[]="rm -f %s%s{*,.*} >&/dev/null;rm -fr %s%s >&/dev/null ; /bin/true"; //force delete as this is a delete operation with dependency
+ static const char format_force_delete[]="rm -f %s%s{*,.*} >&/dev/null;rmdir %s%s >&/dev/null ; /bin/true"; //force delete as this is a delete operation with dependency
+
static const char delete_format[]="rm %s%s../.wh.%s >&/dev/null";
char *path = ((struct VyattaNode*)(node->data))->_data._path;
@@ -1078,13 +1080,23 @@ delete_func(GNode *node, gpointer data)
//WILL ONLY REMOVE DIRS WITHOUT CHILD DIRS--just what we want..
- sprintf(command,format,sd->_src,path,sd->_src,path);
- if (g_debug) {
- printf("%s\n",command);
- fflush(NULL);
+ //NEED TO PREVENT THE COMMAND BELOW FROM DELETING WHITEOUT FILES....
+
+ if (IS_NOOP(((struct VyattaNode*)(node->data))->_data._operation)) {
+ return FALSE; //see if we can skip this node here
}
- if (sd->_test_mode == FALSE) {
- system(command);
+
+
+ //DOESN'T QUITE FIX THE PROBLEM, THE PARENT IS CALLED (AND PROBABLY SHOULDN'T BE)
+ if (!IS_DELETE(((struct VyattaNode*)(node->data))->_data._operation)) {
+ sprintf(command,format,sd->_src,path,sd->_src,path);
+ if (g_debug) {
+ printf("%s\n",command);
+ fflush(NULL);
+ }
+ if (sd->_test_mode == FALSE) {
+ system(command);
+ }
}
//if this is a deletion operation, need to remove
diff --git a/templates/priority b/templates/priority
index fe4babd..8b8118a 100644
--- a/templates/priority
+++ b/templates/priority
@@ -4,21 +4,21 @@
301 protocols/ospfv3
302 protocols/rip
303 protocols/ripng
-310 interfaces/bridge/node.tag
-320 interfaces/ethernet/node.tag
-320 interfaces/loopback/node.tag
-330 interfaces/adsl/node.tag
-340 interfaces/serial/node.tag
-350 interfaces/wirelessmodem/node.tag
-380 interfaces/tunnel/node.tag
-380 interfaces/openvpn/node.tag
-390 interfaces/bonding/node.tag
+310 interfaces/bridge
+320 interfaces/ethernet
+320 interfaces/loopback
+330 interfaces/adsl
+340 interfaces/serial
+350 interfaces/wirelessmodem
+380 interfaces/tunnel
+380 interfaces/openvpn
+390 interfaces/bonding
400 system
450 protocols/static
470 policy
-500 protocols/bgp/node.tag
+500 protocols/bgp
510 protocols/bgp/node.tag/parameters
-520 protocols/bgp/node.tag/neighbor/node.tag
+520 protocols/bgp/node.tag/neighbor
530 protocols/bgp/node.tag/ipv6
530 protocols/bgp/node.tag/network
530 protocols/bgp/node.tag/redistribute