diff options
author | Stig Thormodsrud <stig@io.vyatta.com> | 2009-03-04 18:04:41 -0800 |
---|---|---|
committer | Stig Thormodsrud <stig@io.vyatta.com> | 2009-03-04 18:04:41 -0800 |
commit | 45a5466e2225494d237243689f666eb34d85d34e (patch) | |
tree | 60c3275f5abcb538afcbade185a95d641a3d7e05 /src/common | |
parent | b6e48dd4171703e403626c5506c0607b1ec6327a (diff) | |
parent | 6d5458fbd0cfbcc3b4b16f4d3d6682dd474d60b6 (diff) | |
download | vyatta-cfg-45a5466e2225494d237243689f666eb34d85d34e.tar.gz vyatta-cfg-45a5466e2225494d237243689f666eb34d85d34e.zip |
Merge branch 'jenner' of http://git.vyatta.com/vyatta-cfg into jenner
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/unionfs.c | 26 |
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 |