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 dreamhost.com) 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
http://www.forkosh.com/weblist.cgi
http://www.forkosh.com/cgi-bin/weblist.cgi
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 forkosh.com/weblist.cgi image is at
http://www.forkosh.com/pcgi-bin/weblist.cgi
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
structures.

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 )
.



Relevant Pages

  • Re: chmod symlink
    ... Your problem is not that the server refuses to execute the ... a 500 error pointing your browser to the symlink. ... 'Identicially' here meaning "it's also reported as internal server ... the permissions likely don't matter ...
    (comp.unix.programmer)
  • Re: chmod symlink
    ... isp dreamhost.com) 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 ... But I'd rather chmod a symlink, ...
    (comp.unix.programmer)
  • Re: chmod symlink
    ... isp dreamhost.com) with required 755 permissions. ... Internal Server Error due to the symlink's 777 (when I ... But I'd rather chmod a symlink, ... and it maintains a log file that gets ...
    (comp.unix.programmer)
  • Re: chmod symlink
    ... isp dreamhost.com) with required 755 permissions. ... Internal Server Error due to the symlink's 777 (when I ... I just cp'ed the cgi where needed. ... But I'd rather chmod a symlink, ...
    (comp.unix.programmer)
  • Re: write with cURL
    ... execute permissions. ... of potential security risks from other users on the same server. ... I made this suggestion because their web host appears to run Apache ... risk to allow Apache's group write access, since all PHP scripts ran ...
    (alt.php)