diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d2bbc0e..823b903 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -64,6 +64,7 @@ jobs: sudo mkdir -p /lower /upper /mnt sudo sh -c "(cd /; git clone https://github.com/amir73il/unionmount-testsuite.git)" sudo go get github.com/containers/storage + sudo GOPATH=$GOPATH sh -c "(cd /root/go/src/github.com/containers/storage; make tests/tools/build/ffjson; cp tests/tools/build/ffjson /usr/bin)" sudo GOPATH=$GOPATH sh -c "(cd /root/go/src/github.com/containers/storage; sed -i -e 's|^AUTOTAGS.*$|AUTOTAGS := exclude_graphdriver_devicemapper exclude_graphdriver_btrfs|' Makefile; make GO111MODULE=on containers-storage)" - name: run autogen.sh diff --git a/main.c b/main.c index 8f0697a..1cad322 100644 --- a/main.c +++ b/main.c @@ -179,7 +179,7 @@ print_stats (int sig) char fmt[128]; int l = snprintf (fmt, sizeof (fmt) - 1, "# INODES: %zu\n# NODES: %zu\n", stats.inodes, stats.nodes); fmt[l] = '\0'; - write (STDERR_FILENO, fmt, l + 1); + (void) write (STDERR_FILENO, fmt, l + 1); } static double @@ -1398,7 +1398,7 @@ make_ovl_node (struct ovl_data *lo, const char *path, struct ovl_layer *layer, c ret = calloc (1, sizeof (*ret)); if (ret == NULL) - return NULL; + return NULL; ret->parent = parent; ret->layer = layer; @@ -1562,7 +1562,6 @@ static struct ovl_node * insert_node (struct ovl_node *parent, struct ovl_node *item, bool replace) { struct ovl_node *old = NULL, *prev_parent = item->parent; - int is_dir = node_dirp (item); int ret; if (prev_parent) @@ -5022,7 +5021,7 @@ do_fsync (fuse_req_t req, fuse_ino_t ino, int datasync, int fd) } if (fd < 0) - strcpy (path, node->path); + strncpy (path, node->path, PATH_MAX); if (! do_fsync) { @@ -5423,7 +5422,11 @@ load_default_plugins () if (dent->d_type != DT_DIR) { char *new_plugins = NULL; - asprintf (&new_plugins, "%s/%s:%s", PKGLIBEXECDIR, dent->d_name, plugins); + if (asprintf (&new_plugins, "%s/%s:%s", PKGLIBEXECDIR, dent->d_name, plugins) < 0) + { + free (plugins); + return NULL; + } free (plugins); plugins = new_plugins; } diff --git a/tests/fedora-installs.sh b/tests/fedora-installs.sh index bbde865..eaf7d93 100755 --- a/tests/fedora-installs.sh +++ b/tests/fedora-installs.sh @@ -207,7 +207,7 @@ sleep_pid=$! rm merged/toremove grep 12345 /proc/$sleep_pid/fd/0 -RUN touch merged/a merged/b -RUN chmod 6 merged/a -RUN mv merged/a merged/x -RUN mv merged/b merged/a +touch merged/a merged/b +chmod 6 merged/a +mv merged/a merged/x +mv merged/b merged/a diff --git a/utils.h b/utils.h index bb2183c..13a177e 100644 --- a/utils.h +++ b/utils.h @@ -18,7 +18,9 @@ #ifndef UTILS_H # define UTILS_H +#ifndef _GNU_SOURCE # define _GNU_SOURCE +#endif # include