summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorMichael Larson <slioch@slioch.vyatta.com>2010-06-23 14:53:26 -0700
committerMichael Larson <slioch@slioch.vyatta.com>2010-06-23 14:53:26 -0700
commit6b42d818585a4f10cfb5af55bc8d09cee27284da (patch)
tree79c8fad3573ff254e562a634a0c858b3d634f135 /src/common
parent34a05603b080375f1ec0cccfa613ae24ae79f0f4 (diff)
downloadvyatta-cfg-6b42d818585a4f10cfb5af55bc8d09cee27284da.tar.gz
vyatta-cfg-6b42d818585a4f10cfb5af55bc8d09cee27284da.zip
partial fix for bug 5729 (comment #1).
Diffstat (limited to 'src/common')
-rw-r--r--src/common/unionfs.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/common/unionfs.c b/src/common/unionfs.c
index d96ef0e..3f932d6 100644
--- a/src/common/unionfs.c
+++ b/src/common/unionfs.c
@@ -354,13 +354,23 @@ retrieve_data(char* rel_data_path, GNode *node, const char* root,
}
else { //do a lstat check in the local dir
struct stat s;
+
+ char namebuf[MAX_LENGTH_HELP_STR];
+ if (strncmp(dirp->d_name,DELETED_NODE,4) == 0) {
+ strcpy(namebuf,dirp->d_name+4); //SKIP THE .WH.
+ }
+ else {
+ strcpy(namebuf,dirp->d_name);
+ }
+
+
char buf[MAX_LENGTH_HELP_STR];
- sprintf(buf,"%s/%s/%s/%s",get_mdirp(),rel_data_path,dirp->d_name,DISABLE_FILE);
+ sprintf(buf,"%s/%s/%s/%s",get_mdirp(),rel_data_path,namebuf,DISABLE_FILE);
if (lstat(buf,&s) == 0) {
//need to check existence of file in active configuration here as well!
deactivated |= K_LOCAL_DISABLE_OP;
}
- sprintf(buf,"%s/%s/%s/%s",get_adirp(),rel_data_path,dirp->d_name,DISABLE_FILE);
+ sprintf(buf,"%s/%s/%s/%s",get_adirp(),rel_data_path,namebuf,DISABLE_FILE);
if (lstat(buf,&s) == 0) {
deactivated |= K_ACTIVE_DISABLE_OP;
}
@@ -369,7 +379,6 @@ retrieve_data(char* rel_data_path, GNode *node, const char* root,
char *data_buf = malloc(MAX_LENGTH_DIR_PATH*sizeof(char));
if (strncmp(dirp->d_name,DELETED_NODE,4) == 0) {
struct VyattaNode *vn = calloc(1,sizeof(struct VyattaNode));
-
if (strncmp(dirp->d_name,DELETED_NODE,4) == 0) {
strcpy(data_buf,dirp->d_name+4); //SKIP THE .WH.
vn->_data._operation = K_DEL_OP;