From: Stefan Sperling Subject: Re: Packfile permissions To: Alisdair MacLeod Cc: gameoftrees@openbsd.org Date: Wed, 28 Oct 2020 16:56:56 +0100 On Wed, Oct 28, 2020 at 12:38:15PM +0000, Alisdair MacLeod wrote: > Here is a patch that I am currently running successfully on my server. Thank you! Your patch is now in the main repository. Something to keep in mind for the future: Your patch arrived here with whitespace mangled. Tabs were replaced by spaces, and the "@@ .. .. @@ ..." chunk header line was wrapped. This did not apply with patch(1). If your mailer is unable to keep patch files intact inline then attaching them might work better. Thanks again! > diff --git lib/fetch.c lib/fetch.c > index 3bdd5de6..0e60b215 100644 > --- lib/fetch.c > +++ lib/fetch.c > @@ -800,6 +800,15 @@ got_fetch_pack(struct got_object_id **pack_hash, struct > got_pathlist_head *refs, > free(tmpidxpath); > tmpidxpath = NULL; > > + if (chmod(packpath, GOT_DEFAULT_FILE_MODE) != 0) { > + err = got_error_from_errno2("chmod", packpath); > + goto done; > + } > + if (chmod(idxpath, GOT_DEFAULT_FILE_MODE) != 0) { > + err = got_error_from_errno2("chmod", idxpath); > + goto done; > + } > + > done: > if (tmppackpath && unlink(tmppackpath) == -1 && err == NULL) > err = got_error_from_errno2("unlink", tmppackpath); > >