?

Log in

fivetonsflax
13 May 2008 @ 01:23 pm
Anyone know the best way to get voice+data service on an iPhone for a month and a half in Spain?
 
 
fivetonsflax
12 May 2008 @ 12:51 am
Marc Balmer found a 25-year-old bug in the BSD *dir libraries.

Marc says that if you write a directory that spans two blocks, delete the first directory entry in the second block, then seekdir to the second entry in the second block (using a saved value from telldir), you'll be placed at the third entry instead. And he generously provides you with the magic numbers you need to make this happen.

I wasn't sure I understood this, so I wrote a
proof-of-concept program to exercise it
. It creates a directory, and 28 files therein; records a directory position for each one as returned by telldir; deletes file number 25; seeks to the position recorded for file number 26; and checks and prints the filename at the current position.

It shows the expected result on FreeBSD: 27. Delete a file other than "25", and the result is 26. You can easily see this by doing something like:

for i in {1..28}
do
./youcantelladirbutyoucanttellitmuch.pl $i
done

A long column of "26"s, with one "27" third from the end.

Now, here's where it gets odd: try it on Mac OS X.

% uname -a
Darwin misterioso.local 9.2.2 Darwin Kernel Version 9.2.2: Tue Mar 4 21:17:34 PST 2008; root:xnu-1228.4.31~1/RELEASE_I386 i386
misterioso% for i in {1..28}
do
./youcantelladirbutyoucanttellitmuch.pl $i
done
27
27
26
26
26
26
26
26
26
27
27
27
27
27
27
27
27
27
27
27
27
27
27
27
27
27
26
26

Clearly there's a similar bug at work, but it isn't the same. Someone with a knowledge of HFS+ data structures could probably explain it without difficulty, but that someone isn't me. "ls -f", despite the man page's promise of hot naked unsorted output, gives sorted output, and hence no insight into the implementation. Apple engineers or other informants may email me at hotnakeddatastructures@narcissus.net.

Update:

A commenter who prefers to remain anonymous points out that similar behavior can be observed if you modify the magic number '26'. I can reproduce that on FreeBSD. This implies that I'm not tickling the boundary condition that Marc identified. I'm no longer sure what's going on here.

Update2:

No longer doing arithmetic on values returned from telldir; thanks, jld.
 
 
Current Mood: curiouscurious
 
 
fivetonsflax
15 April 2008 @ 11:14 pm
A Slashdot "Anonymous Coward" posted about handling and mishandling sensitive information while working at a document imaging software company. He or she hates it and wishes people wouldn't send confidential information so casually.

If I ran a document imaging software company, the last thing I'd want to do is take on liability for my customers' data for free.

I wonder if there exist any data leakage products geared towards helping companies keep *out* sensitive data coming from their partners, vendors, customers, etc. Users of such products could claim it as a selling point, because it would protect their customers too.
 
 
fivetonsflax
30 January 2008 @ 03:45 pm
“Even for a statewide political campaign, you have to get to the lutefisk feed,” Mr. Jendrysik said.
 
 
fivetonsflax
29 January 2008 @ 06:00 pm
Link on the nytimes.com front page:

Obama Benefiting From Special Interest Money

Follow the link to the article, and the headline changes to:

Special Interest Money Helps Obama and Others

Read all the way to the sixth paragraph, and learn:

The Clinton campaign has been a much greater beneficiary of these groups.

WTF?!
 
 
Current Mood: distresseddistressed
 
 
 
 
fivetonsflax
06 December 2007 @ 12:42 pm
Google's choice of motto is flawed. It should be "don't do evil". That would explicitly encourage employees to examine the likely consequences of their actions.

Instead, it's "don't be evil". Who, under ordinary circumstances, ever experiences himself as evil? "Don't be evil" may appear to be a commitment to corporate ethics, but it has no content whatsoever. In a sense, it provides permission to do absolutely anything to anyone for any reason.

I'm not saying that Google is evil, mind you. Far from it. In fact, I'm glad that they began paying attention to the problem of evil in a corporate context so early in their existence. But they might have hired a philosopher or three to help.
 
 
fivetonsflax
18 October 2007 @ 10:10 am


I read a 19th-century Russian novel in which a rural landowner serves tea with honey because they can't afford sugar. Naturally ... everyone has access to agricultural products, because they live on farms; refined sugar (an industrial product) is rare, expensive, prestigious.

It tickled me because now, of course, a "nice" coffee or tea bar will have honey as an alternative, while refined white sugar is omnipresent.
 
 
fivetonsflax
23 September 2007 @ 03:17 pm
I learned today from the NY Times Magazine that Justice Stevens did cryptanalysis in WWII.


After graduating Phi Beta Kappa from the University of Chicago in 1941, Stevens enlisted in the Navy on Dec. 6, 1941, hours before the Japanese attacked Pearl Harbor. He later won a bronze star for his service as a cryptographer, after he helped break the code that informed American officials that Adm. Isoroku Yamamoto, the commander of the Japanese Navy and architect of the Pearl Harbor attack, was about to travel to the front. Based on the code-breaking of Stevens and others, U.S. pilots, on Roosevelt’s orders, shot down Yamamoto’s plane in April 1943.