Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Mar 1995 16:39:15 -0800 (PST)
From:      Steven G Kargl  <kargl@troutmask.apl.washington.edu>
To:        freebsd-hackers@freefall.cdrom.com (FreeBSD)
Subject:   symlink mode_t question
Message-ID:  <199503310039.QAA07349@troutmask.apl.washington.edu>

next in thread | raw e-mail | index | archive | help
Hackers,

I have a simply question about the mode given to a symlink when I
use `ls -l'.  Why is it alway lrwxrwxr-x, and not resolved to the true
access permission of the file?

%ls -l *.txt
lrwxrwxr-x  1 kargl  wheel    5 Mar 30 16:16 a.txt@ -> b.txt
--w--w--w-  1 kargl  wheel  356 Mar 30 14:11 b.txt
%chmod a-r a.txt
lrwxrwxr-x  1 kargl  wheel    5 Mar 30 16:16 a.txt@ -> b.txt
--w--w--w-  1 kargl  wheel  356 Mar 30 14:11 b.txt
%cat a.txt
cat: a.txt: Permission denied


I'm adding a symlink option to install(1), and I would like the 
symlink access permissions to reflect those of the original file.

While I'm here.  What happens to the setting of immutable/append bits
on a file?  Does a symlink correctly handle these flags?


BTW, I'm adding 2 gzip option, a preserve timestamp option, and I
hope better error handling to install(1); e.g.,

%install -S -z -t file1 file2

Create a symlink file2 to a gzipped file1 and give the last access/modify
times of file1 to file2.

-- 
Steven G. Kargl     | Phone: 206-685-4677 |
Applied Physics Lab | Fax:   206-543-6785 |
Univ. of Washington |---------------------|
1013 NE 40th St     | FreeBSD 2.1-current |
Seattle, WA 98105   |---------------------|



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199503310039.QAA07349>