1

I have a git-daemon accessed through ssh. All repositories are in /srv/git.

I have some other projects saved on a exfat disk, so I want to create a symbolic link from that disk to /srv/git.

For example, I have /mnt/Medias/Projects/Defi\ H.git so I simply do:

cd /srv/git
sudo ln -s /mnt/Medias/Projects/Defi\ H.git

But the file is created as root:root, 777.

To restrict access to the repositories, I want to change the posix rights of that file. If first try:

sudo chmod 755 Defi\ H.git
chmod: changing permissions of `Defi H.git': Function not implemented

I've found that this is because the link points to a folder stored on an exfat disk. In the same way, this fails:

sudo chown git:defih Defi\ H.git
chown: changing ownership of `Defi H.git': Function not implemented

So I want to create the link as the right user directly:

sudo -u git -g defih ln -s /mnt/Medias/Projects/Defi\ H.git
Sorry, user geoffroy is not allowed to execute '/bin/ln -s /mnt/Medias/Projects/Defi H.git' as git:defih on Aethelflaed.

I'm part of group wheel and sudo's configuration shows:

%wheel ALL=(ALL) ALL

I don't understand why this last command fail? Any advice?

Or am I supposed to make a copy of the file on another filesystem? /srv/git is btrfs, if this have any importance.

Geoffroy
  • 218
  • 4
  • 10

1 Answers1

3

The permission of the link has no effect for the target, what you are trying to do is not restricting permission on the target at all.
Only the permission of the target is what has effect.

Quoting http://en.wikipedia.org/wiki/Symbolic_link:

The file system permissions of a symbolic link usually have relevance only to rename or removal operations of the link itself, not to the access modes of the target file which are controlled by the target file's own permissions.

faker
  • 17,326
  • 2
  • 60
  • 69