Skip to contentSkip to conversation

Make creation of pack/pack-*.keep obey the umask

PATCH In review Jason Gunthorpe 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make creation of pack/pack-*.keep obey the umask

Prevents git clone from complaining on shared repositories

Initialized empty Git repository in /tmp/src/.git/
cpio: objects/pack/pack-601efa4cfe63e081c0591b463549aeba3f7c6164.keep: Cannot open: Permission denied 3376 blocks

---

I'm uncertain if the keep files should be sticking around for so long, commit b8077709 makes it sounds like they are shorted lived lock files. In the case I have the keep file contains:

fetch-pack 20810 on bertha1

But, I don't see anything in fetch-pack to erase the keep file.. In any event making the file the same permissions as everything else can't hurt.

 index-pack.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
index-pack.c +1 -1
index 9c0c278..eb19e98 100644
@@ -707,7 +707,7 @@ static void final(const char *final_pack_name, const char *curr_pack_name,
 				 get_object_directory(), sha1_to_hex(sha1));
 			keep_name = name;
 		}
-		keep_fd = open(keep_name, O_RDWR|O_CREAT|O_EXCL, 0600);
+		keep_fd = open(keep_name, O_RDWR|O_CREAT|O_EXCL, 0666);
 		if (keep_fd < 0) {
 			if (errno != EEXIST)
 				die("cannot write keep file");
Signature · 1 line
1.5.4.2
#1 lore raw

Last night I was going through old mail-logs and found this , which I think is still needed. Does anybody see anything wrong with them?

Quoted 42 lines · Jason Gunthorpe

Prevents git clone from complaining on shared repositories

Initialized empty Git repository in /tmp/src/.git/
cpio: objects/pack/pack-601efa4cfe63e081c0591b463549aeba3f7c6164.keep: Cannot open: Permission denied 3376 blocks

---

I'm uncertain if the keep files should be sticking around for so long, commit b8077709 makes it sounds like they are shorted lived lock files. In the case I have the keep file contains:

fetch-pack 20810 on bertha1

But, I don't see anything in fetch-pack to erase the keep file.. In any event making the file the same permissions as everything else can't hurt.

 index-pack.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
index-pack.c +1 -1
index 9c0c278..eb19e98 100644
@@ -707,7 +707,7 @@ static void final(const char *final_pack_name, const char *curr_pack_name,
 				 get_object_directory(), sha1_to_hex(sha1));
 			keep_name = name;
 		}
-		keep_fd = open(keep_name, O_RDWR|O_CREAT|O_EXCL, 0600);
+		keep_fd = open(keep_name, O_RDWR|O_CREAT|O_EXCL, 0666);
 		if (keep_fd < 0) {
 			if (errno != EEXIST)
 				die("cannot write keep file");
Signature · 6 lines
1.5.4.2

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html