Wow - Super Bug in OSX

Posted by: garyi on 12 November 2004

Yup, I finally found something really bad.

Was trying to help someone on line with an issue where they had ditched their system folder into the trash.

I exclaimed, 'not possible!'

And tried it myself....

Well basically once it hit the trash the finder crashed so I couldn't retrive it, and so here I am on a likkle imac 233 (I have it here ready to go to a friend) and waiting patiently whilst the system is reinstalled.

I would call this a major bug, OK it did ask me for password, but why the hell did it let me distch the very system that was running, can you imagine the feedback loop it got from that LOL!

So basically OSX users do not put your system folder in the trash for a larf, because it ain't.

[This message was edited by Adam Meredith on Sat 13 November 2004 at 11:15.]
Posted on: 12 November 2004 by Roy T
quote:
OK it did ask me for password, but why the hell did it let me distch the very system that was running


Did you give it the password and so give it permission to trash the system folder or did it do the trashing without you giving it the password?

One might be a bug and one might be user error.
Posted on: 12 November 2004 by garyi
Well Roy it is user error and no messing I put the password in.

Of course I did not expect the finder to crash but yes I fucked up, but surely the software should not allow this to happen!

Anyway I have managed to restore the lot now, thank god.
Posted on: 12 November 2004 by Jay
Thanks G

I must remember not to do that Winker

Glad you got the system back up and going. How did you do that btw? Just reload the setup/startup cd?

Jay
Posted on: 12 November 2004 by Dan M
quote:
Originally posted by garyi:
an issue where they had ditched their system folder into the trash.

I exclaimed, 'not possible!'

And tried it myself....

Gary, sometimes you really worry me. You would not be able to do this unless you have superuser privileges. If you make youself administrator for the machine then Apple figures you're smart enough not to trash the OS. You could create an "admin" account for system maintenance, and an "igary" account (without su privilege) for everyday work -- that would ensure you can't bugger up the system doing something silly.

cheers,

Dan
Posted on: 13 November 2004 by garyi
Ha ha, yea I suppose, but it never used to be this way.

I have had macs for many many years and always mistakes like that would be dealt with by a warning from the finder telling me I couldn't do that.

INfact it still applies today and running programmes can't be put in the trash.

I think the system crashed because by putting the system folder in the trash you are trashing the finder, which wants to tell you you can't do that.

This is a bug right and proper, the finder should not have crashed (This is wholy repeatable three people have done it on the apple discussions with the same outcome) BAsically you could make the mistake, but there is no way back from it, I should have been able to open the trash retrieve it and all would be good, but alas no!

Jay, it was not great shakes, I bunged the install disk back in and did archieve and install, all my data remains, I just have to sift through the crap now.
Posted on: 13 November 2004 by Dan M
Gary,

Try 'Carbon Copy Cloner' -- it's free and makes an exact bootable image of your HD. I have an external disk that is an exact copy of my iBooks HD which is updated once per day via cron. I have verified I can in fact boot off the external disc.

HTH,

Dan
Posted on: 13 November 2004 by matthewr
iGary, you are in danger of confirming everyone's worst suspicions about Mac users.

"but it never used to be this way"

But with OSX you now have, beneath all the eye candy, a proper operating system. Which, as Dan has pointed out, it would help greatly if you learnt how to use properly.

"This is a bug right and proper, the finder should not have crashed"

If you can explain how a computer program can continue without crashing after you get it to delete crucial parts of itself the UNIX bugs might look into providing a fix for this "gug".

Matthew
Posted on: 13 November 2004 by garyi
Bring it on girls, I know you love it when you have *something* to go on Winker
Posted on: 13 November 2004 by Roy T
Others have also been exploring the outer reaches of operating systems and have been by looking at what happens you the user instructs the operating system to self destruct via the 'format c:' (Windows) or 'rm -Rf /' (Linux) commands. The big picture plus excited geek talk can be viewed at SlashDot.

And for your next trick. . . . ?
Posted on: 14 November 2004 by DLF
From macosx.org

quote:
I broke something and I can't fix it. What's next?
If you've tried a reboot with no success, try creating a new user and logging in. If the problem is gone, delete files from the /Users/<username>/Library until the problem goes away. If this doesn't work or the new users profile is also broken, try removing the /System directory and reinstalling MacOSX. This will install only missing files and folders and return the system to its default state. All user level preferences will be saved.


So, clearly it may be necessary to remove the system folder but obviously any tom dick or garyi shouldn't be able to do it. But wait, what's this from the same website...

quote:
superuser- A special administrative account that provides the ultimate in terms of access to data and services, as it can override any file permissions on the system.


I really don't know what to say garyi, words fail me. Put the nice Mac back in the box and send it to me, I'll give it a good home Winker.
Posted on: 14 November 2004 by garyi
I guess administrator is a super user then?
Posted on: 14 November 2004 by DLF
quote:
Originally posted by garyi:
I guess administrator is a super user then?


Indeed, the superuser, also known as root. Even someone with the root password has an ordinary account for normal use.
Posted on: 14 November 2004 by Dan M
I guess administrator is a super user then?

Actually no - but it is close - they are allowed to install and delete software but I don't think they can trash the OS. When logged in as 'root' or if you 'su' a command (which requires a root password) you have ultimate power and resposibility. But don't let that go to your head Winker. I remenber when I got my ibook I googled to find out how to give my account root privilege, but have forgotten how I did it. You may want to switch it off on your personal account. If you're really interested in this stuff, you can check out books from O'Reilly on system administration.

cheers,

Dan

DLF - I just noticed your post - I could be wrong but I think there are some safeguards on administrator accounts.
Posted on: 14 November 2004 by garyi
I find the accounts thing all a bit messy though, so I only have the one.

My opinion of computers has always been that they are something that works for me, this is why I have always owned macs and have never had a PC in the house, I have never bothered to learn all this stuff and become a computer programmer, because I am just not interested.

However in my ever growing knowledge I now know it is possible to trash a system folder that is currently the running system. I won't do it again.
Posted on: 14 November 2004 by Dan M
Gary - a word of warning - stay away from the 'terminal' application Smile
Posted on: 14 November 2004 by garyi
he he I only delved in there a few times back in OSX early days, when there was a threat of free open source stuff.

It took about 2 days to download, X11, Gimp and Fink to install it all.

My 'o' my what a confusion that was, and now they are all self opening and still crap!

LoL
Posted on: 14 November 2004 by DLF
quote:

DLF - I just noticed your post - I could be wrong but I think there are some safeguards on administrator accounts.


I admit I have never used a Mac, I just know Apple basically took BSD UNIX, changed the name to OSX and started charging people for it Winker. In UNIX all files have read, write and execute permission. These permissions are for users and groups (users may be members of groups). On my Linux system only the 'root' user can delete system files. It could be on a Mac there is an 'admin' group which has write access to certain files and directories but not everything. Of course only the superuser should be able to add users to groups.
Posted on: 14 November 2004 by Dan M
DLF: basically took BSD UNIX, changed the name to OSX and started charging people for it

Yep, but things get a little screwy when Mac adds their GUI on top - for example it's not clear to me what happens to the 'keychain' wotsit when one uses passwd from a terminal, etc. Most of my experience is with Unix/Linux, and so I tend to do most things from the command prompt.

iGary,

My 'o' my what a confusion that was

Yeah, I gave up on Fink - pain in the arse. I do have X11 though, with LaTeX, ghostview, and all the image magic stuff.

cheers,

Dan

[This message was edited by Dan M on Sun 14 November 2004 at 20:22.]
Posted on: 15 November 2004 by Top Cat
I dunno, the Terminal application (a window onto the 'Shell') is where you can do the most damage!

I'm re-learning unix and shell-programming after a ten year gap, and it's liberating. Still can't get my head round Perl though, it's a mindf**k.

DLF: OSX is not just the BSD core, it's also the various layers that sit on top of it. It's also free when one buys an Apple computer, unlike Windoze. You only have to pay when upgrading to a newer version (such as OSX Tiger (10.4), due spring 2005).

Doing the swap from PC to Mac was one of my best decisions ever. My only dilemma is whether to buy a dual 1.8 and a seperate monitor or the new iMac next summer...

John
Posted on: 15 November 2004 by matthewr
"I find the accounts thing all a bit messy though, so I only have the one"

Arrrggghghhh!

"My opinion of computers has always been that they are something that works for me, this is why I have always owned macs and have never had a PC in the house, I have never bothered to learn all this stuff and become a computer programmer, because I am just not interested"

Aaaaaarrrrrrggggggghhhhhhh!

Please tell me, gary, that you don't drive or operate any dangerous machinery?

Matthew
Posted on: 15 November 2004 by MarkEJ
Part of me agrees with Gary that this is a bug. Certainly in pre-X incarnations of the MacOS, putting the System Folder in the Trash (or "Wastebasket" -- we had proper localisation then -- sigh...) would generate a rather Blairite "Don't be so silly" message, often with some Californian grammar. Now, as reported, it only asks for an admin password (NOT root, which is actually disabled by default, and cannot be permanently enabled without much fiddling).

The Trash is really only a folder whose content is "deleted" when the "Empty Trash..." command is invoked. Even then, not much actual deletion takes place -- the space occupied by the contents of the Trash is only marked as "available", unless you do a "secure delete".

I once attended to a Mac Plus which had stopped working -- the (20MB) hard disk was full, because the System Folder had been in the Wastebasket for months (the user thought it "looked tidier"), and it was never rebooted because they liked it on all the time. Since it contained a running application (the Finder), the Wastebasket couldn't be emptied, and the disk had therefore filled up. This was, however, the only thing stopping it working. Once everything was back where it should be and the Wastebasket emptied, all was fine -- didn't even need to reinstall anything.

Of course, you couldn't do that with a "proper operating system" Smile
Posted on: 15 November 2004 by garyi
It turned out I could have rescued the OS after all, but you had to boot into super user and press some key sequence continually until it worked again.

As we have established I am not root (I am not, I havn't fiddled with anything other than to make me admin) I still find it startling that it was so easy to trash the system.

More importantly is the fact it all crashed immediatly afterwards, which is what happened to the guy I was trying to prove you couldn't do that too!
Posted on: 15 November 2004 by DLF
quote:

As we have established I am not root (I am not, I havn't fiddled with anything other than to make me admin) I still find it startling that it was so easy to trash the system.


If admin doesn't have write premission to /System, how could you install new software?
quote:

More importantly is the fact it all crashed immediatly afterwards, which is what happened to the guy I was trying to prove you couldn't do that too!

Of couse it crashed, you just deleted it!

I think you are going to have to accept it isn't MacOS. MacOS went the same way as your System folder.
Posted on: 15 November 2004 by garyi
I agree that i am a muppet DLF
Posted on: 15 November 2004 by DLF
quote:
Originally posted by garyi:
I agree that i am a muppet DLF


I have a friend in the software industry, erm, Mr DEF, who also does muppety things every now and then.