Skip to content

Instantly share code, notes, and snippets.

@triffid
Created November 4, 2012 00:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save triffid/4009492 to your computer and use it in GitHub Desktop.
Save triffid/4009492 to your computer and use it in GitHub Desktop.
apache permissions issue - namei output
# this link works perfectly
$ namei -m public_html/gallery/Pictures
f: public_html/gallery/Pictures
drwxr-xr-x public_html
drwxr-xr-x gallery
lrwxrwxrwx Pictures -> ../../Pictures
drwxr-xr-x ..
drwxr-xr-x ..
lrwxrwxrwx Pictures -> aleisa/Pictures
drwxr-xr-x aleisa
drwxr-xr-x Pictures
# this one causes apache to say Symbolic link not allowed or link target not accessible: /home/triffid/public_html/gallery/old-pictures, referer: http://jinsuul/~triffid/cgi-bin/gallery/old-pictures
$ namei -m public_html/gallery/old-pictures
f: public_html/gallery/old-pictures
drwxr-xr-x public_html
drwxr-xr-x gallery
lrwxrwxrwx old-pictures -> ../../Storage/Pictures
drwxr-xr-x ..
drwxr-xr-x ..
drwxrwxr-x Storage
drwxrwxr-x Pictures
$ mount
# irrelevant lines removed
aleisa:/home/triffid on /home/triffid/aleisa type fuse.sshfs (rw,noatime,allow_other)
aleisa:/mnt/storage on /home/triffid/Storage type fuse.sshfs (rw,noatime,allow_other)
# strace -s 1024 -f -o apache2.strace /etc/init.d/apache2 start
# edited for brevity
# this is the NON-WORKING symlink
3795 stat64("/home/triffid/public_html/gallery/old-pictures/000_0001.JPG", {st_mode=S_IFREG|0775, st_size=278484, ...}) = 0
3795 open("/home/triffid/.htaccess", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
3795 open("/home/triffid/public_html/.htaccess", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
3795 lstat64("/home/triffid/public_html/gallery", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
3795 open("/home/triffid/public_html/gallery/.htaccess", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
3795 lstat64("/home/triffid/public_html/gallery/old-pictures", {st_mode=S_IFLNK|0777, st_size=22, ...}) = 0
3795 stat64("/home/triffid/public_html/gallery/old-pictures", {st_mode=S_IFDIR|0775, st_size=565248, ...}) = 0
3795 gettimeofday({1351990275, 338808}, NULL) = 0
3795 write(2, "[Sun Nov 04 11:51:15 2012] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /home/triffid/public_html/gallery/old-pictures, referer: http://jinsuul/~triffid/cgi-bin/gallery/old-pictures\n", 221) = 221
# this is the WORKING symlink
3841 stat64("/home/triffid/public_html/gallery/Pictures/100_1309.JPG", {st_mode=S_IFREG|0755, st_size=280624, ...}) = 0
3841 open("/home/triffid/.htaccess", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
3841 open("/home/triffid/public_html/.htaccess", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
3841 lstat64("/home/triffid/public_html/gallery", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
3841 open("/home/triffid/public_html/gallery/.htaccess", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
3841 lstat64("/home/triffid/public_html/gallery/Pictures", {st_mode=S_IFLNK|0777, st_size=14, ...}) = 0
3841 stat64("/home/triffid/public_html/gallery/Pictures", {st_mode=S_IFDIR|0755, st_size=69632, ...}) = 0
3841 open("/home/triffid/public_html/gallery/Pictures/.htaccess", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
3841 lstat64("/home/triffid/public_html/gallery/Pictures/100_1309.JPG", {st_mode=S_IFREG|0755, st_size=280624, ...}) = 0
3841 open("/home/triffid/public_html/gallery/Pictures/100_1309.JPG", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment