Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Jun 1995 00:20:02 -0700
From:      darrylo@sr.hp.com
To:        freebsd-bugs
Subject:   bin/534: chmod doesn't work through symlinks
Message-ID:  <199506190720.AAA00742@freefall.cdrom.com>
In-Reply-To: Your message of Mon, 19 Jun 1995 00:11:06 -0700 <199506190711.AA199165866@hpnmhjw.sr.hp.com>

next in thread | previous in thread | raw e-mail | index | archive | help

>Number:         534
>Category:       bin
>Synopsis:       chmod doesn't work through symlinks
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs (FreeBSD bugs mailing list)
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 19 00:20:01 1995
>Originator:     Darryl Okahata
>Organization:
At Home
>Release:        FreeBSD 2.0-BUILT-19950603 i386
>Environment:

	2.0.5R, default installed kernel

>Description:

	File permissions cannot be changed if a file is referenced via a
	symlink.

>How-To-Repeat:

	Script started on Sun Jun 18 23:28:04 1995
	bash$ mkdir t
	bash$ cd t
	bash$ ls -la
	total 4
	drwxr-xr-x  2 darrylo  xxx  512 Jun 18 23:28 .
	drwxr-xr-x  3 darrylo  xxx  512 Jun 18 23:28 ..
	bash$ touch .x
	bash$ ls -la
	total 4
	drwxr-xr-x  2 darrylo  xxx  512 Jun 18 23:28 .
	drwxr-xr-x  3 darrylo  xxx  512 Jun 18 23:28 ..
	-rw-r--r--  1 darrylo  xxx    0 Jun 18 23:28 .x
	bash$ ln -s .x .y
	bash$ ls -la
	total 4
	drwxr-xr-x  2 darrylo  xxx  512 Jun 18 23:28 .
	drwxr-xr-x  3 darrylo  xxx  512 Jun 18 23:28 ..
	-rw-r--r--  1 darrylo  xxx    0 Jun 18 23:28 .x
	lrwxr-xr-x  1 darrylo  xxx    2 Jun 18 23:28 .y -> .x
	bash$ chmod 755 .y
	bash$ ls -la
	total 4
	drwxr-xr-x  2 darrylo  xxx  512 Jun 18 23:28 .
	drwxr-xr-x  3 darrylo  xxx  512 Jun 18 23:28 ..
	-rw-r--r--  1 darrylo  xxx    0 Jun 18 23:28 .x
	^^^^^^^^^^ Permissions did not change

	lrwxr-xr-x  1 darrylo  xxx    2 Jun 18 23:28 .y -> .x
	bash$ chmod 755 .x
	bash$ ls -la
	total 4
	drwxr-xr-x  2 darrylo  xxx  512 Jun 18 23:28 .
	drwxr-xr-x  3 darrylo  xxx  512 Jun 18 23:28 ..
	-rwxr-xr-x  1 darrylo  xxx    0 Jun 18 23:28 .x
	^^^^^^^^^^ This changed.

	lrwxr-xr-x  1 darrylo  xxx    2 Jun 18 23:28 .y -> .x
	bash$ chmod 644 .y
	bash$ ls -la
	total 4
	drwxr-xr-x  2 darrylo  xxx  512 Jun 18 23:28 .
	drwxr-xr-x  3 darrylo  xxx  512 Jun 18 23:28 ..
	-rwxr-xr-x  1 darrylo  xxx    0 Jun 18 23:28 .x
	^^^^^^^^^^ No change.

	lrwxr-xr-x  1 darrylo  xxx    2 Jun 18 23:28 .y -> .x
	bash$ touch foo
	bash$ ls -la
	total 4
	drwxr-xr-x  2 darrylo  xxx  512 Jun 18 23:29 .
	drwxr-xr-x  3 darrylo  xxx  512 Jun 18 23:28 ..
	-rwxr-xr-x  1 darrylo  xxx    0 Jun 18 23:28 .x
	lrwxr-xr-x  1 darrylo  xxx    2 Jun 18 23:29 .y -> .x
	-rw-r--r--  1 darrylo  xxx    0 Jun 18 23:29 foo
	bash$ ln -s foo yuk
	bash$ ls -la
	total 4
	drwxr-xr-x  2 darrylo  xxx  512 Jun 18 23:29 .
	drwxr-xr-x  3 darrylo  xxx  512 Jun 18 23:28 ..
	-rwxr-xr-x  1 darrylo  xxx    0 Jun 18 23:28 .x
	lrwxr-xr-x  1 darrylo  xxx    2 Jun 18 23:29 .y -> .x
	-rw-r--r--  1 darrylo  xxx    0 Jun 18 23:29 foo
	lrwxr-xr-x  1 darrylo  xxx    3 Jun 18 23:29 yuk -> foo
	bash$ chmod 755 yuk
	bash$ ls -la
	total 4
	drwxr-xr-x  2 darrylo  xxx  512 Jun 18 23:29 .
	drwxr-xr-x  3 darrylo  xxx  512 Jun 18 23:28 ..
	-rwxr-xr-x  1 darrylo  xxx    0 Jun 18 23:28 .x
	lrwxr-xr-x  1 darrylo  xxx    2 Jun 18 23:29 .y -> .x
	-rw-r--r--  1 darrylo  xxx    0 Jun 18 23:29 foo
	lrwxr-xr-x  1 darrylo  xxx    3 Jun 18 23:29 yuk -> foo
	bash$ chmod 755 foo
	bash$ ls -la
	total 4
	drwxr-xr-x  2 darrylo  xxx  512 Jun 18 23:29 .
	drwxr-xr-x  3 darrylo  xxx  512 Jun 18 23:28 ..
	-rwxr-xr-x  1 darrylo  xxx    0 Jun 18 23:28 .x
	lrwxr-xr-x  1 darrylo  xxx    2 Jun 18 23:29 .y -> .x
	-rwxr-xr-x  1 darrylo  xxx    0 Jun 18 23:29 foo
	lrwxr-xr-x  1 darrylo  xxx    3 Jun 18 23:29 yuk -> foo
	bash$ chmod 644 yuk
	bash$ ls -la
	total 4
	drwxr-xr-x  2 darrylo  xxx  512 Jun 18 23:29 .
	drwxr-xr-x  3 darrylo  xxx  512 Jun 18 23:28 ..
	-rwxr-xr-x  1 darrylo  xxx    0 Jun 18 23:28 .x
	lrwxr-xr-x  1 darrylo  xxx    2 Jun 18 23:29 .y -> .x
	-rwxr-xr-x  1 darrylo  xxx    0 Jun 18 23:29 foo
	lrwxr-xr-x  1 darrylo  xxx    3 Jun 18 23:29 yuk -> foo
	bash$ ls -laL
	total 4
	drwxr-xr-x  2 darrylo  xxx  512 Jun 18 23:29 .
	drwxr-xr-x  3 darrylo  xxx  512 Jun 18 23:28 ..
	-rwxr-xr-x  1 darrylo  xxx    0 Jun 18 23:28 .x
	-rwxr-xr-x  1 darrylo  xxx    0 Jun 18 23:28 .y
	-rwxr-xr-x  1 darrylo  xxx    0 Jun 18 23:29 foo
	-rwxr-xr-x  1 darrylo  xxx    0 Jun 18 23:29 yuk
	bash$ exit
	
	Script done on Sun Jun 18 23:30:08 1995

>Fix:
	
	None

>Audit-Trail:
>Unformatted:





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