FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 05-17-2008, 05:11 PM
Peter Kuma
 
Default realpath in PS1 bash

Hi folks

I'm wondering if it'd be a good idea to have PS1 set to

'${debian_chroot:+($debian_chroot)}u@h:$(realpath "$(pwd)")$ '

instead of the default

'${debian_chroot:+($debian_chroot)}u@h:w$ '

and make it a suggestion in /etc/skel/.bashrc for those users who want
to see the actual current working directory.

From a security standpoint you could enter e.g.
/home/someoneelse/somedir/ and see me@debian:/home/someoneelse/somedir/$
in the prompt, but really be in /etc/ if somedir is a (potentially
malicious) symlink to /etc created by a different user. It could get
quite disastrous if you decide to run something like rm -r * in such a
directory.

It won't be very helpful with more sophisticated symlink race
conditions, but it is better than nothing.

Perhaps I should post it to bash package wishlist, what do you think?

Peter Kuma





--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 09:03 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org