Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 3967 - su resolves symlinks to their source
su resolves symlinks to their source
Product: Red Hat Linux
Classification: Retired
Component: sh-utils (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: David Lawrence
Depends On:
  Show dependency treegraph
Reported: 1999-07-09 13:30 EDT by Matthew Galgoci
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 1999-07-09 13:40:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Matthew Galgoci 1999-07-09 13:30:53 EDT
I don't know if this is proper behavior or not,
but su seems to follow symlinks to their source.

However, when you exit the shell that you su to, it


[mgalgoci@skuzzlebutt linux]$ pwd
[mgalgoci@skuzzlebutt linux]$ su
[root@skuzzlebutt linux-2.2.5]#
[root@skuzzlebutt linux-2.2.5]# exit
[mgalgoci@skuzzlebutt linux]$ ls -al ../linux
lrwxrwxrwx   1 root     root           11 Apr 24 14:13
../linux -> linux-2.2.5
[mgalgoci@skuzzlebutt linux]$
Comment 1 Jeff Johnson 1999-07-09 13:40:59 EDT
The function getcwd(3) recurses backward to / from the current
directory in order to discover the path. When the shell is first
invoked (by su in this case), getcwd is invoked to find the current
directory. Henceforth, the arg of each cd command is used to save the
current directory. So, in your case, to restore the prompt, you
would need to do
	cd ../linux
	cd /usr/src/linux
to restore the prompt value.

Note You need to log in before you can comment on or make changes to this bug.