Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
Thank you, didn't know that :) –  Geoffroy Jan 22 '12 at 11:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.