summaryrefslogtreecommitdiff
path: root/src
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 /src
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.
Diffstat (limited to 'src')
-rw-r--r--src/common/unionfs.c26
1 files changed, 19 insertions, 7 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