Skip to content

Commit

Permalink
Merge pull request lxc#4417 from mihalicyn/revert-3951-2021-08-25.fixes
Browse files Browse the repository at this point in the history
Rework "lxccontainer: fixes" PR
  • Loading branch information
stgraber authored Apr 1, 2024
2 parents bb2f37b + 4464cee commit 80e28c1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lxc/lxccontainer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2705,7 +2705,7 @@ static bool mod_rdep(struct lxc_container *c0, struct lxc_container *c, bool inc
/* Here we know that we have or can use an lxc-snapshot file
* using the new format. */
if (inc) {
fd = open(path, O_APPEND | O_RDWR | O_CLOEXEC);
fd = open(path, O_APPEND | O_WRONLY | O_CREAT | O_CLOEXEC);
if (fd < 0)
goto out;

Expand Down Expand Up @@ -3287,6 +3287,11 @@ static int copy_file(const char *old, const char *new)
char buf[8096];
struct stat sbuf;

if (file_exists(new)) {
ERROR("copy destination %s exists", new);
return -1;
}

fd_from = open(old, PROTECT_OPEN);
if (fd_from < 0)
return syserror("Error opening original file %s", old);
Expand Down

0 comments on commit 80e28c1

Please sign in to comment.