Re: chmod symlink

Nicolas George <nicolas$george@xxxxxxxxxxx> wrote:
JohnF , dans le message <jdk4k8$7mj$1@xxxxxxxxxxxxxxxxx>, a ?crit?:
I'm running a cgi on my website (Debian linux hosted by
isp with required 755 permissions.
But a symlink to it from another directory fails with an
Internal Server Error due to the symlink's 777 (when I
chmod 777 the cgi itself, then that fails identically).
For the time being, I just cp'ed the cgi where needed.
But I'd rather chmod a symlink, but can't google a solution.

Theoretically, you could do it with fchmodat and flag AT_SYMLINK_NOFOLLOW,
but Linux does not support it, and neither does it have a function to
emulate it.

Thanks, Nicolas, and everyone else. From all the posts, I gather
"theoretical" is as good as it gets, and "practical" ain't gonna
happen. Guess I'll have to keep separate copies several places,
and try to keep them all in sync. At least it works that way.

By the way, here's how you can see the problem: two different
copies are at
and the program will just emit a formatted error page when
run like that (without what it considers a valid query_string).
A symlink to the image is at
and you know what'll happen pointing your browser there.

If you are root on the box, your best luck would be to use some kind of
debugfs tool (possibly custom) to change the permissions in the filesystem

Shared host. I have enough trouble admin'ing my own linux desktops.

But taking into account the permissions of a symlink is just plain bogus,
you should file a bug on the web server.

Also from those subsequent posts, I gather that's not definitive.
And I have been on other isp's servers where apache (or whatever)
exhibited the same behavior -- demanded cgi's have particular
permissions, and barfed otherwise. I just never cared before,
and simply chmod'ed them as required.
John Forkosh ( mailto: j@xxxxx where j=john and f=forkosh )