Live data from Hacker News

Bug 1202858 – Restarting squid results in deleting all files in hard-drive

bugzilla.redhat.com

121–130 of 179 posts

Re: Bug 1202858 – Restarting squid results in deleting all files in hard-drive

#121
post #110
post #85

Earlier quoted context omitted.

This is simply not true. Could you provide evidence rather than making stuff up.

Ok. Fresh steaming proof as requested: https://bugzilla.redhat.com/buglist.cgi?bug_severity=urgent&... All high severity bugs against 7.1 which was relased 16 days ago. Check the dates on half of them. They're before the release date and half of them haven't even been assigned or triaged. When 7.0 came out, datetimectl and systemd didn't even work properly. Enabling ntp threw dbus errors galore. On some kit it didn't…

Redhat Linux (not RHEL) tended to have issues until the ".2" releases too, all the way back to 4.x in '96/'97.

Re: Bug 1202858 – Restarting squid results in deleting all files in hard-drive

#122
post #88

Earlier quoted context omitted.

Similar things have happened on OS X: http://apple.slashdot.org/story/01/11/04/0412209/itunes-20-i...

Parent said "This is why as a user I like Apple's OS X sandbox.". This is a bug from 15 years ago, much much before the sandbox feature was introduced. A sandboxed iTunes would have prevented that.

A sandboxed iTunes would also prevent syncing your iPod and importing existing music collections, because those both require access to files outside the sandbox, which is probably why Apple hasn't done that.

Re: Bug 1202858 – Restarting squid results in deleting all files in hard-drive

#123
post #32

Earlier quoted context omitted.

And this is why it is important to write something like set -eu on top of your bash scripts -- execution will stop on errors (non-zero retvals) and on undefined variables.

or check the variable before using it, like any other programming language: [[ "$VAR" ]] && rm -rf "$VAR/*" I think most of these issues stem from the fact that most developers that write shell scripts don't actually understand what they're doing, treating the script as a necessary annoyance rather than a component of the software.

I think a better alternative is something like

    rm -r "${VAR:-var_is_not_set_so_please_fix_this_script}"
which substitutes the var_is_... if VAR is not set.

BTW, I hate hate hate -f. It has two meanings: 1. 'force' the removal 2. ignore any error

I've seen an instance of this sort of bug in my sysadmin career that I remember. It was a Solaris patch which wiped a chunk of the system.

Re: Bug 1202858 – Restarting squid results in deleting all files in hard-drive

#124

My good old trick to mitigate that is: touch /-@ I also always do it in my home directory: touch ~/-@ That's the first thing I do on a new host. When accidentally running rm -f *, the command expands to -@ first, which is not a valid option and makes the command fail before doing any harm rm: illegal option -- @ usage: rm [-f | -i] [-dPRrvW] file ...

  touch /--
  rm -rf *
(admittedly, this would be a malicious attempt rather than a careless bug)

Re: Bug 1202858 – Restarting squid results in deleting all files in hard-drive

#125
post #32

Earlier quoted context omitted.

And this is why it is important to write something like set -eu on top of your bash scripts -- execution will stop on errors (non-zero retvals) and on undefined variables.

That's not as simple or clear as you make it sound though. http://mywiki.wooledge.org/BashFAQ/105 disagrees and refers to GreyCat's preference not to use -e at the bottom of the list of 'complications'.

From the same page:"rking's personal recommendation is to go ahead and use set -e, but beware of possible gotchas. It has useful semantics, so to exclude it from the toolbox is to give into FUD."

You can use set -e, and turn it off (set +e) for code blocks and things that are problematic. He could also add '|| true', and you may be able to use colon to avoid point problems without turning everything off. These are edge cases and you can easily work around them if you an advanced user.

If you are not an advanced user then you should certainly use -e.

Re: Bug 1202858 – Restarting squid results in deleting all files in hard-drive

#126
post #6

Earlier quoted context omitted.

It already has a "fixed in version" listed. Fixing it within a day doesn't sound like no one caring :) Does it really matter if no one commented "Oops, we screwed up"? It's kinda self-evident that there was a mistake and there's not really much to say; it's clear from the description how bad it is and marking it "Fixed in version" already says it all pretty much.

> Does it really matter if no one commented "Oops, we screwed up"? To me it does. You just deleted someone's hard drive, an apology wouldn't be out of order.

If anyone is using an unreleased product on anything other than a test environment with anything other than test data, then the nicest thing anyone could do for them at this point is to simply point out the bug has been fixed.

Re: Bug 1202858 – Restarting squid results in deleting all files in hard-drive

#127
post #103

My good old trick to mitigate that is: touch /-@ I also always do it in my home directory: touch ~/-@ That's the first thing I do on a new host. When accidentally running rm -f *, the command expands to -@ first, which is not a valid option and makes the command fail before doing any harm rm: illegal option -- @ usage: rm [-f | -i] [-dPRrvW] file ...

Hm that's a cool trick. IIRC some distributions (Suse?) had a 'bash' clause where you couldn't do "rm -rf /" without 'y'. My 'zsh' has this one too, when I 'rm -rf /some/dir/' always asks if I'm "sure". Truth to be told, I'm not even expecting the text in "stdout" anymore, my finger goes to the 'y' automatically, which means that if I make something stupid it won't be able to protect me :-P The last couple of years I…

Some versions of RM (Ubuntu/Debian if I remember correctly) require --no-preserve-root.

Re: Bug 1202858 – Restarting squid results in deleting all files in hard-drive

#128
post #110
post #85

Earlier quoted context omitted.

This is simply not true. Could you provide evidence rather than making stuff up.

Ok. Fresh steaming proof as requested: https://bugzilla.redhat.com/buglist.cgi?bug_severity=urgent&... All high severity bugs against 7.1 which was relased 16 days ago. Check the dates on half of them. They're before the release date and half of them haven't even been assigned or triaged. When 7.0 came out, datetimectl and systemd didn't even work properly. Enabling ntp threw dbus errors galore. On some kit it didn't…

The priority fields are set by developers so they know which bugs they should work on first. The two bugs of mine which appear on that list are both new features for RHEL 7.2. I set the priority of those so I know to work on them first. I really think you need a better query than that one.

Update: I think if you wanted to find out which critical bugs affected RHEL 7.0 on release, you'd probably want to look at the list of z-stream packages (RHEL 7.0.z) which subscribers have access to. These are bugs which didn't affect the installer or first boot, but were important enough to need fixing in RHEL 7.0 after it went out. (If a bug was critical enough to affect installation or first boot, it would have delayed the release).

Re: Bug 1202858 – Restarting squid results in deleting all files in hard-drive

#129
post #80

Scary. Even more scary is the fact that the bug has been open for a week, one person has confirmed 100% reproducibility, and no one seems to care at Red Hat. Isn't deleting peoples hard drives a big no no ?

It's already fixed, plus there are many private comments which you cannot see (but I think you see "missing" comment numbers). Also the product in question is not released yet . It's good this was found, but no customer would have been affected unless they were using an alpha.

[deleted]

Re: Bug 1202858 – Restarting squid results in deleting all files in hard-drive

#130

Earlier quoted context omitted.

That's not as simple or clear as you make it sound though. http://mywiki.wooledge.org/BashFAQ/105 disagrees and refers to GreyCat's preference not to use -e at the bottom of the list of 'complications'.

From the same page:"rking's personal recommendation is to go ahead and use set -e, but beware of possible gotchas. It has useful semantics, so to exclude it from the toolbox is to give into FUD." You can use set -e, and turn it off (set +e) for code blocks and things that are problematic. He could also add '|| true', and you may be able to use colon to avoid point problems without turning everything off. These are ed…

  $ diff -u /tmp/a /tmp/b
  --- /tmp/a	2015-03-24 08:33:00.021919797 -0400
  +++ /tmp/b	2015-03-24 08:33:05.629963015 -0400
  @@ -1,5 +1,5 @@
   #!/usr/bin/env bash
   set -e
   i=0
  -let i++
  +let i++ || true
   echo "i is $i"
  $ /tmp/a
  $ /tmp/b
  i is 1
  $
Post reply on HN