Trunk DELETED my Blog folder

Hi ~
I backed everything up, svn upped (little past the 5.0 release),
migrated,
and things were working. Tried to login to admin, and THE ENTIRE
DIRECTORY
MY BLOG WAS IN WAS DELETED. I think the cache code has a serious bug.
My
history shows NO commands that would have altered the files.

~ Ben

It also DELETES /tmp if you are running as a privileged user (I was
testing
something)… This is a confirmed bug via #typo added ticket to trac.

I was running Postgres when it happened to me.

Hello

We’ve noticed this bug and temporarily removed Typo 5.0.x from
Rubyforge until we find out what really happens. We’re actively
working on that particular point to deliver a fix as soon as possible.

As far as I’m concerned, I’ve only been able to reproduce this with
sqlite, at very ramdom moments, and I’m not sure yet if it’s a Typo or
Rails issue. Ben, what database were you running when this happened ?

Best regards,
Frédéric

Le 31 déc. 07 à 21:03, Ben R. a écrit :

On 12/31/07, Ben R. [email protected] wrote:

It also DELETES /tmp if you are running as a privileged user (I was testing
something)… This is a confirmed bug via #typo added ticket to trac.

Ah… I know what’s causing that. For some reason, I thought
FileUtil::tmpdir made a unique temporary directory (it certainly does
under OS X). That part, at least, should be quick to fix. What OS are
you on?

I am running Debian Lenny and MySQL DB. More notes here:
http://trac.typosphere.org/ticket/1179

My server is Fedora 8.

Okay, I’m going to explain why Dir::tmpdir is different on Linux and
OS X.

this is fairly easy, if you grok the tmpdir.rb you can see why.

we take this bit of code

for dir in [ENV[‘TMPDIR’], ENV[‘TMP’], ENV[‘TEMP’],
ENV[‘USERPROFILE’], @@systmpdir, ‘/tmp’]
if dir and File.directory?(dir) and File.writable?(dir)

So we have it clearly looking at TEMP TMP and TMPDIR and USERPROFILE
(nfi what that is).

On OS X, it sets your TMPDIR such as (for me)

TMPDIR=/var/folders/o4/o4PgUarhGOqv22kCO8qczE+++TI/-Tmp-/

now I can say on my Linux server none of those variables are set, and
then it checks /tmp and is happy.

It really doesn’t fix the problem, it just explains why TMPDIR is
different on OS X.

Doesn’t it always do that when you update your wife’s stuff? I mean,
somehow that must be an absolute law in systems administration:

"When updating software, everything will go as planned*.

*except anything you’re upgrading for your wife"

– Mitch, leaving his wife’s stuff alone for now

Piers C. wrote:

On 12/31/07, Ben R. [email protected] wrote:

It also DELETES /tmp if you are running as a privileged user (I was testing
something)… This is a confirmed bug via #typo added ticket to trac.

Ah… I know what’s causing that. For some reason, I thought
FileUtil::tmpdir made a unique temporary directory (it certainly does
under OS X). That part, at least, should be quick to fix. What OS are
you on?

Happened to me, too. Upgrade of my own blog from 4.x went fine, then
tried to upgrade my wife’s and… kablooey. Whole blog dir gone, and
system /tmp also. Got a serious case of hacker paranoia before I
convinced myself it had to be some weird typo bug. Good to hear it
confirmed, in a way – and good that I had backups.

I’m running (Gentoo) Linux and mySQL.

//Petri

On 1/2/08, Scott L. [email protected] wrote:

So we have it clearly looking at TEMP TMP and TMPDIR and USERPROFILE (nfi
on OS X.
Ah… Well, the latest code in trunk adds its own subdirectory to the
TMPDIR path, which should at least fix the problem of it zapping /tmp.
I’ve also just checked in something with extended logging. This won’t
actually help too much as it stands because, obviously, you lose the
logfiles at the same time as the rest of the blog directory, but if
you edit app/models/page_cache.rb and change the line

FileUtils.rm_rf(trash)

to

FileUtils.rm_rf(trash)

the directory won’t actually be deleted, just moved to
$TMPDIR/typodel. so you’ll be able to recover it and post any
log entries here (or in a pastie).

Thanks for your help.

I’m afraid I don’t know when I’ll get to this properly though, I’m
currently laid up with a very nasty cold and a bad back. Lousy timing,
I know.