Conversation
Exclude files matching patterns listed in FILE. Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
poettering
left a comment
There was a problem hiding this comment.
Sorry for the late review! Looks great, just some minor nitpick!
|
|
||
| case ARG_UNDO_IMMUTABLE: | ||
| case ARG_EXCLUDE_FROM: | ||
| arg_exclude_from = strdup(optarg); |
There was a problem hiding this comment.
Why strdup? This now causes a leak when the program exits. I think it should be fine to use the optarg here.
|
btw, ideally we'd serialize all info we use for putting together an image into the caidx/catar. This means in the long run any additional exclusion lists should probably serialized somehow into both too. That way things become more reproducible, as this means you can validate a tree against a serialization and need no other info. |
|
|
||
| case ARG_UNDO_IMMUTABLE: | ||
| case ARG_EXCLUDE_FROM: | ||
| arg_exclude_from = strdup(optarg); |
There was a problem hiding this comment.
Why strdup? This now causes a leak when the program exits. I think it should be fine to use the optarg here.
| if (s->direction != CA_SYNC_ENCODE) | ||
| return -EINVAL; | ||
|
|
||
| s->exclude_from = strdup(path); |
There was a problem hiding this comment.
If s->exclude_from was previously set, it needs to be freed before reassigning.
A corresponding free at the end is also needed. Prolly where archive_path is being freed.
Exclude files matching patterns listed in FILE.
Signed-off-by: Dietmar Maurer dietmar@proxmox.com