Alastair’s Place

Software development, Cocoa, Objective-C, life. Stuff like that.

Shocking

Jeff Atwood on the shocking behaviour of G-Archiver.

When I first read this, I was angry. Really angry.

We developers already get all sorts of crazy and unfounded accusations about “violating privacy”, without some jerk writing software that really does steal your data.

For the record, I am an ACM member, so I have to comply with the ACM Code of Ethics that Jeff mentions at the top of his blog post, not to mention the various laws we have here in the U.K. on the matter (e.g. the Data Protection Act, which is overseen by the Information Commissioner’s Office).

Unbelievable

Some people are just unbelievable.

We definitely do not want this country’s legal system going the way things have in the United States. That this chap slipped on a grape is unfortunate and the fact that he was injured doubly so. But it is hardly the fault of Marks & Spencer. For one thing, he should have been watching where he put his feet; for another, I don’t see how M&S could possibly be expected to be responsible for a single grape ending up on the floor, whether in their store or in their car park.

Hopefully our judiciary has the sense to reject this nonsense.

I Hate Routers

I hate DSL routers. I don’t know why, but router manufacturers seem incapable of designing one that works properly. They’re usually let down by their software, and sometimes they’re also let down by their hardware too.

The most recent routers I’ve used are:

  • Alcatel SpeedTouch 780WL (Be branded)

    This one seems to be generally OK, although the web interface is pretty awful. I think the problem there is that Alcatel can’t make up its mind whether it wants the router to be easy-to-configure or full of features, so the web interface is an uneasy half-way house. The worst problem with it is that it’s badly organised and hard to navigate; there are pages that look just like the settings screens, but where you can’t change anything, and it often takes me a couple of minutes to find the right part of the interface. It seems to be fairly decent from the command line, though the docs for that are somewhat lacking. WLAN works OK on this router, which is a refreshing change.
  • ZyXEL Prestige 662HW

    The main problems with this router aren’t to do with the software, which is OK (not brilliant, but OK). It has a good range of features and a reasonable web interface, which is at least easy to navigate, unlike the Alcatel. No, the main problems are hardware ones. Firstly, this router’s input seems to be too heavily attenuated, as a result of which it has trouble sustaining a DSL connection at high data rates. I’m quite close to the local exchange, so there’s no good excuse for this, especially as other vendors’ products don’t suffer from this problem. Second, the WLAN is unreliable. When I bought this, I was hoping that I could replace an earlier ZyXEL Prestige (a 243, I think) and my Apple AirPort with just the one box. No such luck.
  • Netgear DG834N

    I bought this to replace the ZyXEL when it became apparent that I was going to have regular connectivity problems with the latter. It was easy to set up, with a simple web interface and the DSL connection has been very reliable with this unit. Unfortunately there are some serious deficiencies with the DG634N, which Netgear doesn’t seem to be in a great hurry to address:
    • It has a very small feature set compared to other manufacturers’ routers. On the plus side, that makes it easy to configure for end users.
    • It only supports 802.11n draft 1. Draft 2 has been “forthcoming” for some time now.
    • Its UPnP support is badly broken.1 As a result, it is impossible to use software that requires special support for NAT, unless the authors have taken account of the device’s eccentricities.
    • There is no command line.2
    Oh, and this is another router with unreliable WLAN. Maybe that’s because it’s trying to support 802.11n draft 1, but since I’m using 802.11g devices primarily, that doesn’t seem to be a good excuse. Nor does it matter how I configure the WLAN support. All of this might be OK if, as with other Linux-based routers, the firmware could be replaced with something a bit better. There are a couple of custom firmware packages out there, but because the drivers for the Broadcom chipset that is used by this router aren’t Open Source, they are basically the same firmware with rebuilt applications and/or modified web interface. </ul> Anyway, in a fit of irritation, I bought myself a new Airport Extreme and a Netgear DM111P DSL modem. The Airport in particular was spectacularly easy to set up, though I would have liked to have been able to choose a subnet of 10.32.x.x which is what I had been using previously (10.0.x.x is no good because if I do that then I can’t connect to the VPN between my home and my office). As a result, I now have reliable WLAN (with a better signal than I got from my previous Airport), a reliable DSL connection, and reliable NAT traversal courtesy presumably of NAT-PMP. I can finally screen share between work and home! Yay! OK, so the AirPort Extreme isn’t terribly configurable and doesn’t support UPnP. It does work however, which seems to be something of a unique selling point in the home router market.
    1 It uses the wrong namespace for responses ({urn:upnp-org:serviceId:WANIPConnection} rather than {urn:schemas-upnp-org:service:WANIPConnection}), and unhelpfully returns the wrong error code (402 Invalid Args rather than 713 SpecifiedArrayIndexInvalid) when you pass an out-of-range index to GetGenericPortMappingEntry(), which is irritating because the error is the only way to tell when you’ve finished enumerating mappings. 2 Yes, I know about debug mode and that you can get a Linux prompt, with all that that implies. That’s not the same thing, and as a result of the lack of a command line interface, the features in the web interface are basically all you get (unlike some other manufacturers’ equipment).

OS X 10.5 and VPNs

I was getting a weird problem where one machine could connect to an IPsec/L2TP VPN where another one was giving messages like

MPPE required but kernel has no support

on its console at the same time as the server was issuing messages such as

LCP terminated by peer (MPPE required but not available)

There wasn’t any obvious reason for the machines to behave differently (though one was Intel, one PowerPC, and the PowerPC one—which was where the VPN didn’t work—had been upgraded to Leopard with a VPN connection already set-up, though not the connection I was having this problem with).

Anyway, the solution is simple; edit the file /Library/Preferences/SystemConfiguration/preferences.plist. You need to look through the NetworkServices dictionary until you find the VPN connection you want to fix, then go into the PPP dictionary and change the CCPMPPEnnEnabled keys to 0.

This fixed it for me.

“affect”, “effect”, “infer” and “imply”

Over the past few months I’ve noticed a number of people misusing all four of these words. Since the dictionary definition is unlikely to be helpful in such cases, I thought I’d give some examples of correct usage in the hope that anyone who is confused will find this post and get it right.

Let’s deal with affect versus effect first:

Wrong: The position of the switch effects the light output of the lamp.
Right: The position of the switch affects the light output of the lamp.

Wrong: The lamp is effected by the position of the switch.
Right: The lamp is affected by the position of the switch.

Wrong: To effect the lamp, one can push the switch.
Right: To affect the lamp, one can push the switch.

Wrong: To affect a change in the lamp, one can push the switch.
Right: To effect a change in the lamp, one can push the switch.

Wrong: The affect of the switch is to change the light output of the lamp.
Right: The effect of the switch is to change the light output of the lamp.

Wrong: A change in the lamp may be affected by pushing the switch.
Right: A change in the lamp may be effected by pushing the switch.

Now infer versus imply (this is a little more complicated :-)):

Wrong: Mr. Smith implied from the e-mail that Mr. Jones did not like cats.
Right: Mr. Smith inferred from the e-mail that Mr. Jones did not like cats.

Wrong: “From the e-mail,” said Mr. Smith, “we must imply that Mr. Jones does not like cats.”
Right: “From the e-mail,” said Mr. Smith, “we must infer that Mr. Jones does not like cats.”

Wrong: The e-mail inferred that Mr. Jones did not like cats.
Right: The e-mail implied that Mr. Jones did not like cats.

Wrong: The inference of the e-mail was that Mr. Jones did not like cats.
Right: The implication of the e-mail was that Mr. Jones did not like cats.

Wrong: In the e-mail, Mr. Jones inferred that he did not like cats.1
Right: In the e-mail, Mr. Jones implied that he did not like cats.

Wrong: From the e-mail, Mr. Smith implied that Mr. Jones did not like cats.
Right: From the e-mail, Mr. Smith inferred that Mr. Jones did not like cats.

Right: “Are you inferring that I don’t like cats?” said Mr. Jones.2
But more likely: “Are you implying that I don’t like cats?” said Mr. Jones.

In case it’s still not clear:

  • You can effect a change on something. In which case you have affected it.
  • You can have an effect on something. In which case it is affected by you.
  • You can imply something. In which case others can infer something from your remark.
  • You can infer something from someone else’s remarks. In which case they may have implied it. (Note the word “may” here; inference is the act of reading between the lines, so it is possible to read something the author did not intend.)

Finally, you can read dictionary definitions of affect, effect, infer3 and imply.

Why does all this matter? Well, for one thing, if your English is sloppy and you are arguing a case for something, your argument may look less persuasive—indeed, less rational—than the counter argument. There is no reason to suppose that those arguing the opposite position will be sloppy in their use of English.

Poor use of English shows a lack of care and a lack of pride in your writing, not to mention a lack of respect for the reader—if you don’t care sufficiently about your writing, why should the reader bother reading it? Why did you bother to write it in the first place?

When written well, English is a wonderful, expressive language; irregular and awkward it may be, but it has a beauty both of sound and of meaning. Careless mistakes mar that beauty and reduce the enjoyment of the reader.

1 Unless you mean that Mr. Jones is being written about in an e-mail and in that e-mail he inferred that some other person—Mr. Smith, perhaps—did not like cats, in which case it would be right. Isn’t English wonderful? :-)

2 In the first case, Mr. Jones is asking if the other party has come to the conclusion that he—Mr. Jones—does not like cats. In the second, Mr. Jones is asking if the other party is stating indirectly that Mr. Jones does not like cat. The two have different meanings, but they are both correct. You are more likely to want the second meaning.

3 The author of the Usage Note from the Random House Unabridged Dictionary in my view misunderstands the sentence it quotes, “The next speaker criticized the proposal, inferring that it was made solely to embarrass the government.”

There is nothing wrong with the sentence at all; it is the speaker who infers that the proposal was made to embarrass the government. It is not the proposal that does the inferring here, and so their claim that this sentence lends credence to the misuse of the word “infer” is incorrect.

Anonymity Versus Privacy (Again)

This c|net News article is titled “To be anonymous or not to be, that is the privacy question”.

As I’ve said before, anonymity and privacy are two very different things. Unless you habitually wander about in a Burqa, speaking only through a voice changer and wearing platform shoes, that is. But nobody does that, right?

MacForensicsLab on Malware

Disclosure: I run Coriolis Systems Limited, one of SubRosaSoft's competitors (in the field of disk utility software, not security software, I might add). I will nevertheless endeavour to avoid any bias due to that fact.

MacForensicsLab, part of SubRosaSoft, has published a white paper on Mac malware (which it has the cheek to describe as an “academic white paper”; for the record it is clearly a commercial document not an academic one). The web version is uncredited, but the PDF (a whopping 50.2 MB!) appears to have been written by Marko Kostyrko, SubRosaSoft’s CEO.

The paper, broadly speaking, makes four key points, which you can find summarised at the bottom under the heading “For Apple, Inc.”. Of those four, controlling access to the address book is not a bad idea, nor is extending the sandbox system introduced in Mac OS X 10.5 (though it isn’t clear what the author means by including “code that is created locally”).

The other two points, arguably the most important, unfortunately don’t hold up to scrutiny:

1. Control the Bundle Architecture

Kostyrko says:
“Apple might consider implementing a mechanism whereby a bundle cannot contain more than one executable for any given “Contents” subfolder. This would reduce the ability of malware authors to piggyback their code inside an otherwise legitimate bundle.”
This idea is just plain ridiculous, especially for someone whose company sells utility software since utilities rely on the use of helper tools, which are auxiliary executables embedded in the application bundle that permit privileged operation. Furthermore, this restriction wouldn’t achieve anything (besides breaking a number of existing applications, that is). There’s nothing stopping a malware author from e.g. moving iTunes.app into /Library/Application Support and replacing it entirely, leaving only a single executable inside each bundle. Apple has already partially addressed the problem of maliciously altered applications by implementing support for code signing. If you attempt to modify a signed application as described earlier in the article, its signature will no longer match. It is true that Leopard presently does not inform the user if a signature is no longer valid. But it does restrict applications with invalid signatures in various ways, and, depending on the settings in the application’s Info.plist file, it can be configured to terminate applications that have been tampered with. If there is anything Apple needs to do here, it is to add a warning before launching a signed application with an invalid signature. Even then, it would only protect against modified apps, not against malicious apps dressed up as legitimate ones. The second part of this section says:
“Apple may also wish to discuss disallowing multiple extensions inside a .app bundle. This would reduce the ability of malware authors to disguise executable bundles as data files for their pro tools.”
I assume Kostyrko means that Apple should disallow application bundles with multiple extensions, since he believes that Mac OS X will hide the “.app” extension. (For reference, when writing an academic paper, it is a good idea to get your terminology right, which would have avoided any doubt here.) Well guess what? Apple has already addressed this. If, on OS X 10.5, you take an application and try to rename it to have two extensions, Finder will display both extensions, even if the bundle has its “hide extension” property set.</li>

2. Control Write Access to the Applications Folder and Subfolders Found Therein

Apparently
“The programs (commonly known as Applications) that a user relies upon… are stored unprotected inside a folder called ‘/Applications’. Any program running on a Mac OS X system can write to this folder and to most of the contents therein”
and
“Apple may think about making it the default behavior for the system to require admin access to write to this very important folder. Furthermore Apple should make an interface that is easy, obvious, and non-technical to turn this access control on or off.”
Sorry Marko, yet again I have news for you. OS X already does this too, and the Applications folder is not as you erroneously claim “unprotected”. If you use a non-administrator user, you can’t modify the Applications folder, and furthermore, if you try, Finder will offer an authentication dialog so that you can make changes if you know an administrative username/password. A lot of users of existing OS X use administrative users day-to-day, certainly, because that’s what the OS X installer creates for you automatically. But there’s nothing stopping you from going to System Preferences and making an additional, non-administrative user for day-to-day use. Indeed, if you’re reading this and you haven’t already done so, I encourage you to do just this. Helpfully, most OS X software works just fine from a normal user account, unlike the situation on Windows where there was and probably still is plenty that requires you to be logged-in as an admin user just to run it. Update (2008-03-07): Stéphane Sudre just pointed out that a lot of apps install into /Applications with the wrong permissions, either because of broken installers or because they’ve been installed using drag & drop. This is a fair point, though looking on my system I can only see a small number with suspect permission settings. I’d be interested to know what the exact deal is with drag & drop install and permissions; I’m not sure I know OTOH exactly how that works and I probably should :-)

Not only is the paper inaccurate, it is full of needless scaremongering, with sections titled “Macs Are Vulnerable” and “Complacency” as if to emphasise the author’s opinions and quotes from analysts about how “most Mac users take security too lightly”. Some of these sections are even written in the present tense, as if there is a significant amount of malware already in the wild. Thankfully there is not.

I find the entire thing particularly irritating, to be frank. The methods of product promotion used by the security software industry have often been criticised in the past, but dressing this lightweight marketing exercise up as an “academic” paper? Even without the inaccuracies and the needless scaremongering, this wouldn’t be published by any reputable academic journal.

Anyway, the best thing you can do for now as an end-user is to make yourself a non-admin account to use day-to-day, and to ensure that you keep regular back-ups of data you care about. Using a non-admin user will make it difficult for malware to affect applications installed on your machine, and keeping backups of critical data means that if the worst ever did happen, you could wipe the system and start again without worrying about losing data.

Responsible Journalism From the BBC

Journalists the world over should read this BBC blog about the fact that they decided to keep secret Prince Harry’s deployment to protect his fellow soldiers. The BBC, along with the other organisations involved in keeping this quiet, should be congratulated on their common sense and their concern for the lives of the soldiers serving with the prince.

Unfortunately, some unpleasant little hack by the name of Matt Drudge decided that he knew best and that it would be a good idea to run a story on it. As a result, Harry now has to come home.

Matt Drudge probably should be ashamed, but I doubt he’s even capable.