summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d5a72fd)
raw | patch | inline | side by side (parent: d5a72fd)
author | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Thu, 5 May 2005 23:18:48 +0000 (16:18 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Thu, 5 May 2005 23:18:48 +0000 (16:18 -0700) |
The tree object parsing used to get the executable bit wrong,
and didn't know about symlinks. Also, fsck really wants the
full mode value so that it can verify the other bits for sanity,
so save it all in struct tree_entry.
and didn't know about symlinks. Also, fsck really wants the
full mode value so that it can verify the other bits for sanity,
so save it all in struct tree_entry.
fsck-cache.c | patch | blob | history | |
tree.c | patch | blob | history | |
tree.h | patch | blob | history |
diff --git a/fsck-cache.c b/fsck-cache.c
index 301cc67b76e36b47f6d35be62334fb0e5acda677..abdec92ffcf3d85d7307c972e74cc2c69037bb77 100644 (file)
--- a/fsck-cache.c
+++ b/fsck-cache.c
if (strchr(entry->name, '/'))
has_full_path = 1;
+ switch (entry->mode) {
+ /*
+ * Standard modes..
+ */
+ case S_IFREG | 0755:
+ case S_IFREG | 0644:
+ case S_IFLNK:
+ case S_IFDIR:
+ break;
+ /*
+ * This is nonstandard, but we had a few of these
+ * early on when we honored the full set of mode
+ * bits..
+ */
+ case S_IFREG | 0664:
+ break;
+ default:
+ printf("tree %s has entry %o %s\n",
+ sha1_to_hex(item->object.sha1),
+ entry->mode, entry->name);
+ }
+
if (last) {
if (verify_ordered(last, entry) < 0) {
fprintf(stderr, "tree %s not ordered\n",
index 4a26603f6e32866c0db8a01ac1c228be801f76c6..468f99e4944b139450ed5b1d2f84e6ef0b303e84 100644 (file)
--- a/tree.c
+++ b/tree.c
entry = xmalloc(sizeof(struct tree_entry_list));
entry->name = strdup(path + 1);
- entry->directory = S_ISDIR(mode);
- entry->executable = mode & S_IXUSR;
+ entry->directory = S_ISDIR(mode) != 0;
+ entry->executable = (mode & S_IXUSR) != 0;
+ entry->symlink = S_ISLNK(mode) != 0;
+ entry->mode = mode;
entry->next = NULL;
bufptr += len + 20;