LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-21-2008, 09:10 AM   #1
ppr:kut
Slackware Contributor
 
Registered: Aug 2006
Location: Netherlands
Distribution: Slackware
Posts: 631

Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
root cannot cd out of already deleted directory using relative paths


Hi guys!

I'm having a really annoying problem which I can't find a cause for. My root user is unable to cd out of a already deleted directory using relative path definitions. For example, the following does work with my normal user, but not with root:

Code:
mkdir /tmp/test1
cd /tmp/test1
rmdir /tmp/test1
cd ..
Everything works fine for my normal user, but as root cd fails with

Code:
-sh: cd: ..: No such file or directory
This does work on a clean Slackware after install. I somehow manage to make it not work after some time and am now searching for the actual cause.

Anyone an idea?
 
Old 05-21-2008, 09:20 AM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
My first inclination was that it was due to the fact that root doesn't have the current working directory in it's PATH variable (for security reasons) but then you said it works in a clean install (which I can confirm) so obviously it is not a problem with the Slackware configuration itself. Have you done any shell modification that you are aware of, or are you using a different version of Bash?
 
Old 05-21-2008, 09:36 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
I can't reproduce this on my Slackware 10.0 box (the only Slackware I could get my hands on right now).

Eric
 
Old 05-21-2008, 09:40 AM   #4
ppr:kut
Slackware Contributor
 
Registered: Aug 2006
Location: Netherlands
Distribution: Slackware
Posts: 631

Original Poster
Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
I usually do not change my shell-settings. I do also have the standard bash of Slack-12.1 installed. However, I just tried something for good luck and probably found something.
It is a problem with sh, as it does work fine in bash. And using sh, it does also not work with the normal user. So, is it possible that sh is not capable of doing it?
If that would be the case, the only thing I would have to look for is why my root-user is using /bin/sh as default shell in konsole all of a sudden...
 
Old 05-21-2008, 12:13 PM   #5
zux
Member
 
Registered: Jul 2006
Location: latvia
Distribution: slackware
Posts: 140

Rep: Reputation: 26
same think here with 12.1 and sh
it doesn't happen in bash
you (or someone?) probably did it in /etc/passwd
mine looks like this:

Code:
root:x:0:0::/root:/bin/bash
you probably have /bin/sh instead of /bin/bash
use vipw to fix it
if you have no need to use /bin/sh as the shell for root the it's best to stick with the defaults
if this happens every time, but you don't do it yourself then it's probably some software you're installing. or maybe got lost somewhere in KDE's graphical configuration utility.

Last edited by zux; 05-21-2008 at 12:19 PM.
 
Old 05-21-2008, 01:51 PM   #6
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
I can confirm it happens with /bin/sh here also. /bin/bash is fine.
 
Old 05-22-2008, 02:52 AM   #7
ppr:kut
Slackware Contributor
 
Registered: Aug 2006
Location: Netherlands
Distribution: Slackware
Posts: 631

Original Poster
Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
Quote:
you probably have /bin/sh instead of /bin/bash
Yeah, I thought so too, but it's /bin/bash there. When I do a login on tty6 everything does work fine, it's bash there too. Also rxvt does start with bash. It seems just konsole is messing it up. So I compared the config files of my two users, and they are the same except for the font-settings (this can't be possible, can it?). Now, on to further investigation.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash: ln and relative paths tortle Programming 8 05-10-2010 05:50 AM
Absolute and relative paths Gins Linux - General 6 11-08-2008 08:48 PM
periods in relative paths? kuplo Linux - Newbie 2 01-10-2006 05:19 AM
relative/absolute paths in Java djgerbavore Programming 2 10-26-2004 08:01 PM
program that generates relative paths? TheMaXX Linux - Software 1 10-21-2003 02:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration