[hacktree] repo: Only open regular files



commit aa25334286a509a30aef9ecd16d8f0e7683827da
Author: Colin Walters <walters verbum org>
Date:   Wed Oct 19 18:06:06 2011 -0400

    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 ccf35dd..fb6ad1b 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 0dfe67d..096953b 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,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]