From aa25334286a509a30aef9ecd16d8f0e7683827da Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 19 Oct 2011 18:06:06 -0400 Subject: [PATCH] repo: Only open regular files Otherwise we'll try to open device files with predictably bad consequences. --- src/libostree/ostree-core.c | 2 +- src/libostree/ostree-repo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libostree/ostree-core.c b/src/libostree/ostree-core.c index ccf35dd6..fb6ad1b2 100644 --- a/src/libostree/ostree-core.c +++ b/src/libostree/ostree-core.c @@ -193,7 +193,7 @@ ostree_stat_and_checksum_file (int dir_fd, const char *path, goto out; } - if (!S_ISLNK(stbuf.st_mode)) + if (S_ISREG(stbuf.st_mode)) { fd = ot_util_open_file_read_at (dir_fd, basename, error); if (fd < 0) diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index 0dfe67d3..096953b7 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -1096,7 +1096,7 @@ add_one_file_to_tree_and_import (OstreeRepo *self, } static gboolean -add_one_path_to_tree_and_import (OstreeRepo *self, +add_one_path_to_tree_and_import (OstreeRepo *self, const char *base, const char *filename, ParsedTreeData *tree,