Sponsored Content
Full Discussion: Cd
Top Forums UNIX for Dummies Questions & Answers Cd Post 7977 by Perderabo on Thursday 4th of October 2001 09:37:55 AM
Old 10-04-2001
Quote:
Originally posted by Neo

/usr/bin/cd /tmp; rm -rf *

This would appear, if I'm not mistaken, to spawn a child process that would remove all the files in the /tmp directory.
Sorry, that won't work. I sure hope nobody tried that. Try this instead:
/usr/bin/cd /tmp; /usr/bin/pwd

Even when commands are stacked with semicolons, we still have a shell processing the command line. And it still must spawn a child, let the child run /usr/bin/cd, wait for the child to die, spawn a second child, which will run /usr/bin/pwd.

Quote:
Originally posted by devnul
Well, I just wanted to add that on Solaris /usr/bin/cd is a two-line shell script....

cmd=`basename $0`
$cmd "$@"
That's it.. Nothing more...
Actually there are some comments as well which date it Feb 6, 1995 and it has a 1995 copyright. This gives us some idea of when it appeared. 1995 does sound about right.

HP's version is also a simple script:
cd $@
exit $?

HP doesn't show a date, but it does have a comment showing that it is revision 72.2. It's hard to imagine 72 revisions on a script like this, but I guess it's not a job you assign to your best programmer.

The format of Sun's script shows that it's using its name to find the command. I got a list of all the files in /usr/bin linked to the same file. The list is alias, bg, cd, command, fc, fg, getopts, hash, jobs, kill, read, test, type, ulimit, umask, unalias, and wait. Only kill and test really make any sense. Oh well.
 
sestatus.conf(5)					    sestatus configuration file 					  sestatus.conf(5)

NAME
sestatus.conf - The sestatus(8) configuration file. DESCRIPTION
The sestatus.conf file is used by the sestatus(8) command with the -v option to determine what file and process security contexts should be displayed. The fully qualified path name of the configuration file is: /etc/sestatus.conf The file consists of two optional sections as described in the FILE FORMAT section. Whether these exist or not, the following will always be displayed: The current process context The init process context The controlling terminal file context FILE FORMAT
The format consists of two optional sections as follows: [files] file_name [file_name] ... [process] executable_file_name [executable_file_name] ... Where: [files] The start of the file list block. file_name One or more fully qualified file names, each on a new line will that will have its context displayed. If the file does not exist, then it is ignored. If the file is a symbolic link, then sestatus -v will also display the target file context. [process] The start of the process list block. executable_file_name One or more fully qualified executable file names that should it be an active process, have its context displayed. Each entry is on a new line. EXAMPLE
# /etc/sestatus.conf [files] /etc/passwd /etc/shadow /bin/bash /bin/login /lib/libc.so.6 /lib/ld-linux.so.2 /lib/ld.so.1 [process] /sbin/mingetty /sbin/agetty /usr/sbin/sshd SEE ALSO
selinux(8), sestatus(8) Security Enhanced Linux 26-Nov-2011 sestatus.conf(5)
All times are GMT -4. The time now is 08:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy