#1078129 git: permission denied on NFS filesystem while cloning repository

Package:
git
Source:
git
Description:
fast, scalable, distributed revision control system
Submitter:
Roberto Lumbreras
Date:
2024-08-07 09:57:04 UTC
Severity:
normal
#1078129#5
Date:
2024-08-07 09:52:48 UTC
From:
To:
Over NFS, git clone fails:

$ git clone URL directory
Cloning into 'directory'...
fatal: Unable to create temporary file
'.../.git/objects/pack/tmp_pack_XXXXXX': Permission denied
fatal: fetch-pack: invalid index-pack output

325727      0.000030 openat(AT_FDCWD,
"/home/rover/intranet-src/.git/objects/pack/tmp_pack_jIbpEU",
O_RDWR|O_CREAT|O_EXC
L, 0444) = -1 EACCES (Permission denied)

The problem seems to be the O_RDWR + 0444, that fails on NFS, but not on
ext4 or tmpfs.

Confirmed with this code, it returns same error:

openat(AT_FDCWD, "testfile", O_RDWR|O_CREAT|O_EXCL, 0444) = -1 EACCES
(Permission denied)

#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
#include <unistd.h>

int
main() {
        int fd=open("testfile", O_RDWR|O_CREAT|O_EXCL, 0444);
        printf("errno=%d\n", errno);
        unlink("testfile");
        close(fd);
}