diff options
author | Michael Larson <slioch@slioch.vyatta.com> | 2010-06-23 14:53:26 -0700 |
---|---|---|
committer | Michael Larson <slioch@slioch.vyatta.com> | 2010-06-23 14:53:26 -0700 |
commit | 6b42d818585a4f10cfb5af55bc8d09cee27284da (patch) | |
tree | 79c8fad3573ff254e562a634a0c858b3d634f135 /src | |
parent | 34a05603b080375f1ec0cccfa613ae24ae79f0f4 (diff) | |
download | vyatta-cfg-6b42d818585a4f10cfb5af55bc8d09cee27284da.tar.gz vyatta-cfg-6b42d818585a4f10cfb5af55bc8d09cee27284da.zip |
partial fix for bug 5729 (comment #1).
Diffstat (limited to 'src')
-rw-r--r-- | src/commit2.c | 13 | ||||
-rw-r--r-- | src/common/unionfs.c | 15 |
2 files changed, 20 insertions, 8 deletions
diff --git a/src/commit2.c b/src/commit2.c index 45a1a11..a87010c 100644 --- a/src/commit2.c +++ b/src/commit2.c @@ -412,18 +412,21 @@ process_func(GNode *node, gpointer data) if (g_debug) { if (d->_name != NULL) { - printf("commit2::process_func(), calling process on : %s for action %d, type: %d, operation: %d, path: %s\n",d->_name,result->_action,c->_def.def_type, op, d->_path); - syslog(LOG_DEBUG,"commit2::process_func(), calling process on : %s for action %d, type: %d, operation: %d, path: %s",d->_name,result->_action,c->_def.def_type, op, d->_path); + printf("commit2::process_func(), calling process on : %s for action %d, type: %d, operation: %d, path: %s, disable state: %d\n",d->_name,result->_action,c->_def.def_type, op, d->_path,d->_disable_op); + syslog(LOG_DEBUG,"commit2::process_func(), calling process on : %s for action %d, type: %d, operation: %d, path: %s, disable state: %d",d->_name,result->_action,c->_def.def_type, op, d->_path,d->_disable_op); } else { - printf("commit2::process_func(), calling process on : [n/a] for action %d, operation: %d, path: %s\n",result->_action, op, d->_path); - syslog(LOG_DEBUG,"commit2::process_func(), calling process on : [n/a] for action %d, operation: %d, path: %s",result->_action, op, d->_path); + printf("commit2::process_func(), calling process on : [n/a] for action %d, operation: %d, path: %s, disable state: %d\n",result->_action, op, d->_path,d->_disable_op); + syslog(LOG_DEBUG,"commit2::process_func(), calling process on : [n/a] for action %d, operation: %d, path: %s, disable state: %d",result->_action, op, d->_path, d->_disable_op); } } //FIRST LET'S COMPUTE THE DEACTIVATE->ACTIVATE OVERRIDE if (d->_disable_op != K_NO_DISABLE_OP) { - if ((d->_disable_op & K_LOCAL_DISABLE_OP) && (d->_disable_op & K_ACTIVE_DISABLE_OP)) { + if (IS_DELETE(op) && (d->_disable_op & K_ACTIVE_DISABLE_OP)) { + return FALSE; //if this was actively disabled and is being deleted do nothing. + } + else if ((d->_disable_op & K_LOCAL_DISABLE_OP) && (d->_disable_op & K_ACTIVE_DISABLE_OP)) { //no state change: deactivated return FALSE; //skip operation on node } 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; |