git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: git archive setting user and group

From
Jason Pyeron <jpyeron@pdinc.us>
Date
Jan 22, 2021, 20:40 UTC
Message-ID
<043f01d6f0fe$d6ad7660$84086320$@pdinc.us>
Show 6 quoted lines
> From: Jason Pyeron <jpyeron@pdinc.us>
> Sent: Friday, January 22, 2021 3:09 PM
> 
> I am about to make a release for logwatch tonight. Historically the files are owned by logwatch in the
> tgz file. When I use git archive it is owned by uid 0, is there an option to set the uid/uname,
> gid/gname owner of the files?
Answer: not at this time, as it is hard coded in the source.
archive-tar.c:
static void prepare_header(struct archiver_args *args,
                           struct ustar_header *header,
                           unsigned int mode, unsigned long size)
{
        xsnprintf(header->mode, sizeof(header->mode), "%07o", mode & 07777);
        xsnprintf(header->size, sizeof(header->size), "%011"PRIoMAX , S_ISREG(mode) ? (uintmax_t)size : (uintmax_t)0);
        xsnprintf(header->mtime, sizeof(header->mtime), "%011lo", (unsigned long) args->time);
        xsnprintf(header->uid, sizeof(header->uid), "%07o", 0);
        xsnprintf(header->gid, sizeof(header->gid), "%07o", 0);
        strlcpy(header->uname, "root", sizeof(header->uname));
        strlcpy(header->gname, "root", sizeof(header->gname));
meh.
Next: René Scharfe
Message 1 of 12 in “RE: git archive setting user and group”
  1. Jason PyeronJan 22, 2021
  2. René ScharfeJan 22, 2021
  3. Jason PyeronJan 22, 2021
  4. Konstantin RyabitsevJan 22, 2021
  5. Jason PyeronJan 22, 2021
  6. Ævar Arnfjörð BjarmasonJan 22, 2021
  7. brian m. carlsonJan 23, 2021
  8. Jeff KingJan 23, 2021
  9. Konstantin RyabitsevJan 23, 2021
  10. Konstantin RyabitsevJan 23, 2021
  11. Junio C HamanoJan 22, 2021
  12. Jason PyeronJan 22, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.