Bug 3967 - su resolves symlinks to their source
Summary: su resolves symlinks to their source
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: sh-utils
Version: 6.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: David Lawrence
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-07-09 17:30 UTC by Matthew Galgoci
Modified: 2008-05-01 15:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 1999-07-09 17:40:32 UTC


Attachments (Terms of Use)

Description Matthew Galgoci 1999-07-09 17:30:53 UTC
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

eg:

[mgalgoci@skuzzlebutt linux]$ pwd
/usr/src/linux
[mgalgoci@skuzzlebutt linux]$ su
Password:
[root@skuzzlebutt linux-2.2.5]#
[root@skuzzlebutt linux-2.2.5]# exit
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 17:40:59 UTC
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
or
	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.