- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- SHLIB_PATH not getting inherited after su <usernam...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2002 06:39 AM
тАО07-02-2002 06:39 AM
SHLIB_PATH not getting inherited after su <username>
I have the SHLIB_PATH environment variable exported in the current shell. When I do an su
#
# export SHLIB_PATH=/usr/lib
# export MYPATH=/usr/lib
#
# echo $SHLIB_PATH
/usr/lib
# echo $MYPATH
/usr/lib
#
# su cics
$
$ echo $SHLIB_PATH
$ echo $MYPATH
/usr/lib
$
Could someone let me know if its a known bug in HP-UX 11i?
Thanks,
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2002 06:47 AM
тАО07-02-2002 06:47 AM
Re: SHLIB_PATH not getting inherited after su <username>
HTH
Marty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2002 06:49 AM
тАО07-02-2002 06:49 AM
Re: SHLIB_PATH not getting inherited after su <username>
Sandip
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2002 06:58 AM
тАО07-02-2002 06:58 AM
Re: SHLIB_PATH not getting inherited after su <username>
Thanks for your responses.
However I wouldn't like to issue su -
Any idea, why the SHLIB_PATH is not getting inherited with su
Thanks,
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2002 07:01 AM
тАО07-02-2002 07:01 AM
Re: SHLIB_PATH not getting inherited after su <username>
Do both users have the SAME shell?
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2002 07:04 AM
тАО07-02-2002 07:04 AM
Re: SHLIB_PATH not getting inherited after su <username>
if the user is having the default shell as c Shell it will not work , all you can do is either do a su -c
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2002 07:14 AM
тАО07-02-2002 07:14 AM
Re: SHLIB_PATH not getting inherited after su <username>
Jeff,
>> Do both users have the SAME shell?
Yes, both the users have the same shell. I tried with both Korn and Bourne shell.
Manoj,
>> default shell as c Shell it will not work
No, I am not using C shell.
>> su -c
-c option is not being recognized. What is this -c option for ??
thanks for your responses,
-Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2002 07:21 AM
тАО07-02-2002 07:21 AM
Re: SHLIB_PATH not getting inherited after su <username>
Try them both as POSIX shell - /usr/bin/sh.
See the following in the man pgs.
\Quote
If the - option is omitted, the new shell starts as if a subshell was invoked. Exceptions are as follows:
If the new user name is root, the path and prompt variables are reset:
PATH=/usr/bin:/usr/sbin:/sbin
PS1=#
The previously defined HOME and ENV environment variables are removed.
The rest of the environment is retained.
If the shell specified in /etc/passwd is /usr/bin/sh, su sets the value of parameter 0 in the new shell (referenced as $0) to su. If the - option of the su command is specified, su sets parameter 0 to -su.
If the shell specified in /etc/passwd is not /usr/bin/sh, su sets the value of parameter 0 in the new shell to shellname. If the - option of the su command is specified, su sets parameter 0 to -shellname. For example, if the Korn shell is invoked, the value of shellname will be either ksh or -ksh.
By comparison, the login command always sets parameter 0 to -shellname.
\Endquote
HTH,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2002 07:22 AM
тАО07-02-2002 07:22 AM
Re: SHLIB_PATH not getting inherited after su <username>
FYI!
Similar to SHLIB_PATH, the LD_PRELOAD and LD_LIBRARY_PATH does not get inherited. Though the latter two environment variable might not disturb HP-UX OS, however I got these two mentions from the 'strings -a /bin/su' command!
Thanks,
hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2002 07:52 AM
тАО07-02-2002 07:52 AM
Re: SHLIB_PATH not getting inherited after su <username>
I edited a copy of /bin/su binary file, and replaced
SHLIB_PATH occurence with XXLIB_PATH. After this change,
when I executed the copy mysu
the SHLIB_PATH inherited into the user
This indicates that su is intentionally avoiding the
SHLIB_PATH to the new shell. Any reason ? Does this throw
some light to anyone ?
There should be some obvious HP-UX restriction on the
usage of SHLIB_PATH/LD_PRELOAD/LD_LIBRARY_PATH environment
variables not getting inherited through su ...
Thanks again,
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2002 07:56 AM
тАО07-02-2002 07:56 AM
Re: SHLIB_PATH not getting inherited after su <username>
Jeff,
I tried /usr/bin/sh too, but no luck!
Please see my previous update.
Thanks again,
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-04-2002 05:49 AM
тАО07-04-2002 05:49 AM
Re: SHLIB_PATH not getting inherited after su <username>
Thanks for your time.
The following is the text I found:
"As for security reasons,
Variables that control how dynamic loading and binding is done can be used to subvert the program that su runs. To combat this the LD_*, SHLIB_PATH (HP-UX only), LIBPATH (AIX only), and _RLD_* environmental variables are removed from the environment passed on to all commands executed."
Hence SHLIB_PATH wasn't getting inherited into the su'ed shell.
Thanks and Regards,
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-04-2002 05:56 AM
тАО07-04-2002 05:56 AM
Re: SHLIB_PATH not getting inherited after su <username>
the su(1) man page 11.i should be updated to state that SHLIB_PATH,LD_PRELOAD,LD_LIBRARY_PATH are not retained when using su :
So it's expected if not documented behaviour.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-04-2002 06:04 AM
тАО07-04-2002 06:04 AM
Re: SHLIB_PATH not getting inherited after su <username>
-Hari