Solaris / OpenSolarisThis forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: RedHat 9.0 / Slackware 9.0/ FreeBSD 4.8 / Solaris 8 x86 / Mandrake 9.0
Posts: 90
Rep:
Superfluous links in /etc ?
Hi everybody,
I was just having a look at the files in the /etc/ directory and I noticed something unusual. Why is it that there are so many links from /etc/ directory to binaries in /usr/bin and /usr/sbin yet the /etc/ directory is not in the path? I counted them and there are 52 out of 166 commands. This seems a great deal of redundancy to me. Surely it isn't more convenient typing /etc/binaryname than /usr/binaryname and if you did have "." in your path it would(hopefully) be last and the command would not be executed. I haven't seen this on Linux or BSD before, is there are reason why sun has done this??
Distribution: RedHat 9.0 / Slackware 9.0/ FreeBSD 4.8 / Solaris 8 x86 / Mandrake 9.0
Posts: 90
Original Poster
Rep:
Could it just be that Sun hasn't really given much effort into Solaris x86? I mean, I was checking /usr/sbin/ufsdump permissions and I get: lrwxrwxrwx. I mean, on Linux I get for /sbin/dumpe2fs: -rwxr-xr-x. Is it just me or is:
a) giving execute permssions bad
and
b) giving the world write permissions to something like ufsdump just going to invite trojans?
Is this standard for commercial Unices that they give such *cough* liberal *cough* permissions? bigearsbilly is this the same on the SPARCs? I mean don't they know (and linux is included - see $badblocks -wf /dev/hdX ) that giving the world these sorts of permsissions are just inviting trouble? I mean, Solaris/Linux give permissions of 0400 to /etc/shadow why don't they give a more secure default for other commands? I mean, I'd be much more concerned about somebody backing up the fs and then remounting where they have adequate permissions to read everyone's files or completely destroying the system. To make an analogy it seems as if you put a bowl of candy in front of kids and saying, now I'll be back in 20 minutes, don't eat the candy. I realize ultimately that this is a SysAdmin problem but you have to admit that 777 is rich... hey rootshell here I come...
Distribution: RedHat 9.0 / Slackware 9.0/ FreeBSD 4.8 / Solaris 8 x86 / Mandrake 9.0
Posts: 90
Original Poster
Rep:
how about just: $mv trojan.sh usr/sbin/ufsdump ? What if I don't follow the link and just overwrite it? Same effect?
Oh, can I ask one more question? With this "ok prompt" does this exist on x86 or is it like eeprom for SPARC only? I mean I'm reading a few books obviously for SPARC and either they didn't have Solaris x86 back then or for the newer one (2000) it just doesn't mention anything about x86. Is something like
ok>scsi-probe
available for x86 (I know I don't have SCSI but regardless..)? All I seem to get is: select boot partition...boot....choose parameters or just enter to boot with defaults....startup..
It seems to me that this is a sparc thing as my keyboard doesn't have a STOP key on it, it does have an any key though!
if you write to a link you write to the file.
Ignore the "permissions" on the link. The permissions
are what the file has.
and in this case it won't let ya!
You won't even be allowed to create a file in that
directory as a normal user. Just try to ls > newfile there.
Distribution: RedHat 9.0 / Slackware 9.0/ FreeBSD 4.8 / Solaris 8 x86 / Mandrake 9.0
Posts: 90
Original Poster
Rep:
Yeah, I see that /usr/sbin doesn't have write permissions (I tried and failed to create a file there) but I thought that if you knew the location and it had the write permission then you could overwrite, this wouldn't even be a possibility if you knew the inode number? Anyway, I'm new at the fancy-schmancy Solaris stuff, loving learning on it, but you come to appreciate how linux distro's make it easier, or of course I'm biased as someone coming from Solaris might say, boy, these linux distros aren't as easy as solaris. Speaking of linux and solaris...So I'm searching for something like iptables/ipfw for solaris and I find out it doesn't have one builtin(Sunscreen..) and I'm like thinking:
Sun=$$$$ (I knew that you'd burn a hole somewhere with solaris)
Linux=
Anyway, I'll trudge ahead, the highlight of my day:
#mkdir /home/<localuser>
mkdir: Failed to make directory "localuser"; Operation not applicable
I'm like wtf? I'm root! So I put it in /export/home/ but I thought exports were for NFS? Oh, well I'm learning, that's the main thing but this different flavors of Unix thing, difficult sometimes...I just think nowadays, that these "distro-wars" are absolutely stupid, Linux distro's have more in common than they are different...
So bigears do you have experience in other bigiron Unices other than Solaris? If so, what do you think about them (sorry, I'm a student so I mean, I ask dumb questions, lol!)
So does anyone know about these /etc/ links in the first post?
Or the ok prompt??
Distribution: RedHat 9.0 / Slackware 9.0/ FreeBSD 4.8 / Solaris 8 x86 / Mandrake 9.0
Posts: 90
Original Poster
Rep:
thanks for the link!
bigearsbilly, can I ask one really stupid thing:<don't flame> I've always noticed that when I do a ps -e or -aux (solaris/linux) the PIDs seem to miss a bunch of numbers is this because init doesn't reuse PIDs? This seems especially noticable when I get some crazy process number like 5541 which I couldn't possibly be running consecutively. </don't flame> Goodnight anyway..
If anybody reads this, any ideas about the original purpose of the thread? or the "ok prompt"
Distribution: RedHat 9.0 / Slackware 9.0/ FreeBSD 4.8 / Solaris 8 x86 / Mandrake 9.0
Posts: 90
Original Poster
Rep:
thanks bigears,
I ask some funny questions, eh? You mean I don't ask questions like "My new WOPR machine's hardware isn't compatible on this l337 *nix and now is threatening Thermonuclear Global Warfare, joshua says that Mr Falcon is missing, and I really need to impress this girl that totally wants to lay me..(Sorry to War Games!), oh on another note WINE won't install on it...please advise me of how to compile WINE so I can use cmd.exe, --thanks s.kiddie". I figure I can eventually work out my problems, I just ask questions about stuff that don't make sense to me - like the lofs a week ago, or that init question - I mean I would figure that it went around the clock because of the discrepancy in numbers, but I mean I've never read it anywhere, or these goddamn files in /etc/!!!
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Quote:
I was just having a look at the files in the /etc/ directory and I noticed something unusual. Why is it that there are so many links from /etc/ directory to binaries in /usr/bin and /usr/sbin yet the /etc/ directory is not in the path? I counted them and there are 52 out of 166 commands.
I see no links to binaries /usr/bin on my Solaris 9, but:
38 to /usr/sbin
15 to /sbin
I suspect these links are part of the live-upgrade functionality, which is a Solaris specific feature.
Quote:
With this "ok prompt" does this exist on x86 or is it like eeprom for SPARC only?
Sparc only, sorry (there is no openboot prom with intel architecture).
Quote:
I've always noticed that when I do a ps -e or -aux (solaris/linux) the PIDs seem to miss a bunch of numbers is this because init doesn't reuse PIDs? This seems especially noticable when I get some crazy process number like 5541 which I couldn't possibly be running consecutively.
Are you really sure you didn't really launch the 5541 processes, even indirectly ?
Dont forget that one pid is created for every fork.
That means that a loop in a shell script can quickly consume hundreds of pids.
With Solaris 10 dtrace, you'll be able to trace each of these forks and execs.
Distribution: RedHat 9.0 / Slackware 9.0/ FreeBSD 4.8 / Solaris 8 x86 / Mandrake 9.0
Posts: 90
Original Poster
Rep:
Hi jlliagre,
Thanks for the info about the live-upgrade and the links in /etc/.
Thanks for the "ok prompt" info too.
In regards to the proceses, I'm not disputing that I haven't started that many processes accumulatively, I was just asking to confirm if others believed that init kept incrementing until it ran out of numbers. And then searched for "free" pids by "reaping" the numbers from the dead pids. It seems that at bootup the system must go through a fair number of pids as that is the only reason I can think of why the number is so high. Hey, I'll have to check out that dtrace in Solaris10!
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
KDE4me, pid numbering is to the best of my knowledge happening just like you describe in your last posting.
The number rolls at 29999 with Solaris, but you can change that by setting the pidmax variable in /etc/system, which can be up to 999999 I think.
5541 is not that crazy number ...
Did you mean you saw consecutive processes given distant pids ?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.