%20, the final frontier…

The university is in the process of upgrading staff email servers from Exchange 2007 to Exchange 2010, and then onwards to 2013 thereafter. This is a positive move for non-Windows users as the more recent versions of Exchange have much better support for web browsers other than Internet Explorer, and also seem to fix issues such as the ‘mail attachments not showing in Apple Mail’ bug. However, as with any update there are issues. This one I found out about a few months ago while assisting a colleague in Medicine who had an account at their former institute, where they ran Exchange 2010.

The problem, as first reported to me, was “every file has the spaces in the filename replaced with % signs” which was indeed puzzling. On closer inspection it turned out that the problem did not affect every file, just those coming from the Exchange 2010 webmail client, and that the spaces were being replaced with %20. At this point I realised what was happening.

To explain this we need to step back a moment. Once upon a time filenames were typically something.txt or image.jpg – very simple and with no fancy characters. Then deviant Mac and Unix users started using other characters in their filenames, and soon Windows followed suit (hello Windows 95). This is fine in most cases, but gives a problem for web browsers which don’t deal well with spaces in URLs. For example, this won’t work:

http://www.example.com/documents/My Lovely Horse.mp3

as the browser will ask for the file ‘My’ instead of ‘My Lovely Horse.mp3’

Rather than have people rename all their files, web servers use percent codes to encode these characters. The % symbol is used to denote the start of an escape sequence, and is followed by the ASCII or Unicode number of the escaped character. In this case, space is ASCII character 20, so the URL above becomes

http://www.example.com/documents/My%20Lovely%20Horse.mp3

which is less readable for humans, but much better for computers.

Getting back to the point, when someone sends an email with an attachment whose filename contains spaces, the Exchange webmail client will present this file with the filename percent encoded. If you try to download the file via webmail then things get ‘interesting’. Some browsers, such as Safari, will literally save the attachment with the exact name presented, %20 and all. Others, like IE, Firefox, and Chrome, will convert the percent encoded characters to their normal equivalents. Which is the ‘right’ thing to do is a matter of opinion, but the latter is clearly more convenient for users!

If you’re struck with this issue you have a few choices:

  1. Don’t use webmail
  2. Don’t use Safari
  3. Use Automator to create a droplet which does the necessary renaming

In most cases option 2 is the better one, with Chrome being my alternate browser of choice since Firefox currently chokes on QOL authentication. Option 3 is not that difficult but beyond the scope of this blog post!

I did some Googling around this problem and saw there were other possible solutions involving server-side configuration and hacking about with Safari extensions, but those all seemed too much effort for either server admins or users!

Security patches

At the end of last week a disturbing security issue was acknowledged in iOS and OS X Mavericks – the effect was that SSL certificates were not properly authenticated, so people were vulnerable to man-in-the-middle attacks. The flaw affected iOS6, iOS7, and OS X 10.9 Mavericks; third party testing suggested OS X 10.8 Mountain Lion and earlier OS X releases were fine.

Patches were released last week for iOS6 and iOS7, though the iOS6 update only worked on devices which were not capable of running iOS7 – this was enough to make me update my iPhone and iPad to iOS7, which I had resisted on grounds of taste to this point (aside – iOS7 ain’t so bad after all)

Today (Tuesday) Apple released OS X Mavericks 10.9.2, which includes fixes for the problem along with a lot of other issues – while it’s good to have the fix, it’s unfortunate that it’s rolled in with the general system update. Nonetheless Mavericks users should update as soon as possible (after making proper backups).

Interestingly Apple also released updates for Lion (10.7) and Mountain Lion (10.8) to address the SSL issue and other bugs which had already been fixed in Mavericks. The ongoing lack of fixes for these bugs is something I wrote about before and was what led me (and others) to assume that the Lions had been abandoned in favour of Mavericks. Of course, as soon as I finish rolling Mavericks out to a number of people Apple issues the long-awaited security patch… Thanks guys.

There are also updates for Safari to address various security bugs, but notably there is nothing for OS X 10.6 (Snow Leopard), apparently confirming earlier suspicions that Apple no longer supports 10.6; a definitive statement would be useful but clearly isn’t going to happen. Anyway, if you’re still using Snow Leopard on a machine which you can update to Mavericks (or Mountain Lion) you should do so; if the Mac won’t support Lion and later then I’m afraid it’s time for a new Mac, right now.

Anyway, after all this patching you might assume that you’re safe. Sorry. Now there’s evidence of a flaw in iOS7 which allows a malicious app to monitor keystrokes. So far this is a proof of concept only – there’s no evidence this is being exploited in the wild, but the PoC app did get published in the App Store, so malicious apps may already be out there. Yay. One assumes there will be another iOS patch very soon.

I’m reminded of the quip about thermodynamics – you can’t win; you can’t break even; you can’t even quit the game.

Lest Windows users start to feel smug, it turns out that the EMET hardening toolkit on Windows can be bypassed, and Microsoft also rolled out a patch for flaws in Windows Update which has to be applied outside of Windows Update, so probably most people will never even hear about it…

Finally, there are urgent updates for Flash (what else is new?) which once more illustrates the importance of limiting your Flash use as much as possible though the use of Click-to-run extensions, even if you only have Flash via Google Chrome.

Maths are munitions, you know

It’s a little known fact (amongst normal people) that encryption algorithms are considered to be munitions in law. Thus those little equations are governed by the same laws as exports of fighter jets, etc. Why should you care? Well, if you use a laptop for QUB work, you should be encrypting its storage to protect any sensitive content on it – and given that ‘sensitive’ is a loose term it’s best to encrypt under all circumstances. If, however, you go travelling then suddenly you have a dangerous item under your control.

While most jurisdictions permit the personal use of encryption, some forbid it without explicit permission. While unlikely, it’s possible that a border guard could insist on the machine being decrypted, and it could be seized. Thus the sensible approach is to *not* bring your laptop to one of these countries, but to bring a spare system which is unencrypted but contains nothing but the bare essentials for your trip.

The university is not aware of any staff being affected by this as yet, but it is best to be aware of the possibilities. I had a conversation about this last week with senior folks in IS.

You can find a list of the “difficult” destinations at http://www.cryptolaw.org/cls-sum.htm

The destinations which some of you may go to, which do require care, are:

  • China – a permit issued by the Beijing Office of State Encryption Administrative Bureau is required.
  • Hungary – an International Import Certificate is required.
  • Israel – a license from the Director-General of the Ministry of Defense is required.
  • Russia – licenses issued by both the Federal Security Service and the Ministry of Economic Development and Trade are required. License applications should be submitted by an entity officially registered in Russia.
  • Saudi Arabia  – it has been reported that the use of encryption is generally banned, but inconsistent information exists.
  • Ukraine – a license issued by the Department of Special Telecommunication Systems and Protection of Information of the Security Service of Ukraine (SBU) is required.

Especially in the case of Russia and China, given the known risks of state-sponsored (highly competent) hacking, it would be prudent to adopt maximum paranoia, use a loaner laptop which is erased on return, and change all passwords. Indeed, one might well set up a ‘burner’ email address to use for the trip, and not touch normal accounts in the meantime.

As Snowden has shown, you can’t be too paranoid these days.

 

Let’s do the Time Warp again

I know I should update this blog more often, but I keep having to deal with problems which are blog worthy. There’s an irony. I have a lovely post coming up about problems with Mail.app and adding CRLFs to text files, for example. That episode is enough to have me looking at using Outlook for work email.

Anyway, this post is about the importance of backups. Plural. One backup is never enough, as I was reminded yesterday.

Our MSci iMacs are backed up to a QNAP NAS which offers Time Machine compatibility. The only officially supported network Time Machine clients are either Apple’s Time Capsule or else storage served up by OS X Server. Neither work well for us – Time Capsule is a home technology, and I’ve had enough problems with OS X Server (post Snow Leopard) that the proverbial wild horses would not get me back to using it again. I wanted to use networked Time Machine as we had a small issue with roof leaks which meant that machines and their USB-attached backup drives were getting soaked (fair play to Apple, one iMac has been rained on twice and still works fine), and the QNAP seemed like a reasonable choice.

On a local USB disk Time Machine works by copying files direct to the drive; simple and efficient. On a network disk, no matter the source, it creates what’s called a sparse bundle disk image. This is a directory which emulates a single file, sort of like an ISO CD image. The directory contains multiple smaller files, called bands, which sort-of correspond to sectors on the virtual drive. These are 8MB each, and the idea is that only sectors which are needed are created. The problem with this approach is that for large disk images, say around the TB level, you’re looking at maybe 120,000 of them, which might be a lot of overhead for the server to deal with.

A machine had a hard drive failure, so I brought up the spare and started to restore files from the Time Machine backup using Migration Assistant. All went OK apart from a 500GB directory, which would only copy at around 1-200 kB/s, and that on a gigabit LAN capable of up to 100MB/s. I tried many different options to get at the data and no matter what I did the machine was intolerably slow, and crashed entirely twice. At this point I was most unhappy, and found myself wishing for a second backup (which I had said we’d needed and been overruled on).

In the end, I managed to get the data off the machine by turning off all Apple file sharing, mounting the TimeMachine partition via NFS on my iMac, opening the disk image and copying the files out from there. That worked OK, giving me the expected 50MB/s transfers. So clearly the disk image was OK, it’s just that the QNAP could not serve it efficiently over the AFP protocol.

Lessons from this? Firstly, always have more than one backup. I’ve already ordered some USB hard drives and set up an rsync script to a remote server as a stopgap to a better networked solution. Secondly, I don’t think that networked Time Machine is a good idea, however it’s done. On my home network I’ve had issues with disk images getting corrupted on my Time Capsule, or just failing without an error, and that’s with 100% Apple kit. Relying on an unapproved third-party work-alike for important things is not worth the risk. In the future I think I’ll be using locally attached hard drives for Time Machine, and some other network arrangements for disaster recovery – either rsync or Chronosync are top of my list. Along with some proper ‘enterprise’ grade storage…

Now, back to playing with Outlook. Sigh.

What the *beep* is *beep* you *beep*

Image

As part of the Stargazing Live event at Cultra last week I was giving my talks on sci-fi weapons. To fit in with the event schedule I had to split what is normally one talk into four, which at least let me cover more material. Turns out I could fill another few lectures quite easily.

Being guardians of public virtue, the BBC were very concerned about scaring or offending some of the audience, so I had to do some bleeping on the soundtracks of clips from Aliens amongst others. I thought this would be easy. It wasn’t, though I admit I may well have missed the obvious.

After a few false starts, I found that the open source Audacity package was the best option for me. Export the soundtrack as an m4a file, import to Audacity and use its tone generator over the offending clip, then save and remerge using Quicktime 7 Pro. Hardly the most elegant option but it did work in the end.

One good thing about these lectures is that all the rewriting gave me a good opportunity to use the new Keynote for a while. So far I have no complaints, but I didn’t use the most complex features of the old release!

Disclaimer notice

At last, a post

I sort of forgot I should be updating this thing. Whoopsie.

It appears that Snow Leopard is officially dead to Apple now. Not that there is anything like an official statement of course.

In the continued absence of updates for Mountain Lion, as mentioned previously, it’s hard to avoid the feeling that Apple is pushing us to Mavericks, like it or not.

I’m running Mavericks on my main machines now, and it seems OK, though my own needs are quite mainstream. Anyone depending on third party software which is not yet ported to Mavericks or which requires paid upgrades is in a bit of a bind.

Bad Apple.

Mac security updates

This article, while mostly click-baiting troll fodder, does raise a reasonable point.

The release notes for OS X Mavericks list a large number of security issues which are resolved in 10.9 only. A month on from the release of Mavericks no equivalent updates have been posted for Snow Leopard, Lion, or Mountain Lion. Absent official comment from Apple it seems that since the update to Mavericks is free, that’s your security patch.

Given the problems that come with any major system update this seems an utterly unreasonable approach, especially for cases where we’re dealing with complex third-party software which needs to be validated on each update. It’s bad enough that new Macs can never have older versions of the OS installed on them, but this is affecting machines which are currently running properly and now one has to choose between security and application stability. I’m at a loss to suggest the less bad option. Various applications require new versions to work on Mavericks, and not all of these updates are free.

This also absolutely reinforces my relief that I am no longer using OS X Server for anything apart from an illustration of why Linux or even Windows is a better server OS…

Kernel? Panic!!!

An interesting Mac problem today, one I’ve never seen before in all my years of messing about with Apples.

The user had applied some system updates from the App Store, and rebooted the MacBook Air as usual. Immediately on boot there was a kernel panic, with white text on a black background showing up over the grey boot screen. This happened even when trying to boot into safe mode (holding down Shift) though Recovery mode worked OK.

A quick google for the main text of the error – Unable to find driver for this platform: \”ACPI\”. – showed this was something others had seen at various times over the years when an update failed. The most common recommendation was to boot to recovery mode and reinstall OS X, though some other users suggested reapplying the most recent Combo updater to the affected machine. 

Combo updaters have all the files needed to update a machine from any point release of OS X to the latest, eg. 10.8.3 to 10.8.5 directly; the delta updaters only upgrade from one release to the next. Applying the combo updater is often a cure for small errors which seem to happen in incremental updates, as they replace a lot of files with fresh copies, eliminating small errors that can creep in over time.

I booted the afflicted Mac into Thunderbolt Target Disk mode, and plugged it into my MacBook – the disk showed up as expected. I downloaded the 10.8.5 Combo updater from Apple, and tried to run it. My grand plan fell apart at this point as my MacBook was running Mavericks, and the Combo updater plain refused to run, even to be applied to an external drive. After a quick look for a Mac running Mountain Lion which had a Thunderbolt port (my Mountain Lion iMac doesn’t sadly) I repeated the process, which took about 10 minutes to apply the full updater, and rebooted the Mac. Thankfully at that point it booted up perfectly fine, and afterwards had more updates applied from the App Store without problem.

So, lessons learned? Firstly, I need to keep some Mountain Lion machines around for the foreseeable future. Secondly, some people swear by always downloading the Combo updates from Apple and running those instead of the Delta updates from Software Update/App Store; I’m not at that point yet but I do start to see the attraction, and it does illustrate the utility of the Combo update for solving bizarre glitches.

Windows XP end-of-support

As of April 8 2014 Microsoft will terminate all support for Windows XP – this means there will be no further security updates issued regardless of the severity of the problem. In effect this means that all machines running Windows XP must be upgraded to Windows 7/8, or replaced, before this date.

If you have a Windows XP system which you currently use to your satisfaction you will likely be unhappy with this news, but there are sound reasons for taking action. Many security issues which are found in more modern variants of Windows actually affect XP too; hackers will analyse the patches for modern Windows systems to identify the issue and test it against XP – if they find an exploit it will never be fixed on XP. While running AV software may help in the short term, sooner or later it’s likely there will be issues which cannot be avoided. As JANET rules require that any machine attached to the QUB network has up to date security software and a fully patched OS, we simply cannot have XP machines attached to the campus network once support ends.

Even if your machine does not connect to the network (e.g. one used for instrument control) you will still have to upgrade sooner or later. If you use USB keys to transfer data from a standalone machine it can still be infected with viruses transferred on the stick itself, and without a network connection it can’t have up-to-date AV software which might block these.

Aside from the security issues, if you have a system which requires XP for some reason then you are already at significant risk, since modern systems may well not support running XP. As/when the machine breaks it may be impossible to repair/replace it, forcing you to update in an uncontrolled manner. If you have software which only works on XP then you need to plan to either upgrade to a more recent version or migrate to another package if there is no update available. Virtual machines may help in a pinch, but are still subject to security issues.

If you are running Windows XP at the moment you should urgently speak with your computer support officer to begin planning your migration. Within Physics we will be trying to identify XP systems by walking around offices and labs, but that is solely so we know what may need to be removed from the network come April!

In many cases the best option will be to obtain a new machine, though with more recent machines it may be possible to install Windows 7. Since direct upgrades from XP to Windows 7 are potentially problematic in most cases clean installs will be required, with subsequent reinstallation of other software, which will not be that different to migrating to a new machine.

Please do not interpret this as persecution of Windows users – the requirement for machines to have up-to-date operating systems and software applies to all platforms, from Macs to Linux to Unix. All Macs should be running at least OS X 10.6 or later, for example. Windows XP simply currently has wider use around Queen’s, and more hackers interested in exploiting those systems.

Update – those contemplating an update from XP to Win7 should probably review this guide from Microsoft.

Waiting for Mavericks.1

Things which I observed Mavericks cause problems with today:

  1. 2013 MacBook Airs discharging their batteries as they can’t maintain a sleep state.
  2. Keynote ’09 showing font problems – some fonts lose their spacing information and end up showing text bunched together. This happens on two machines. So the old Keynote is now broken (by a bug) while the new one is broken by design.
  3. Similarly Pages does not care for those fonts, but seems to overspace as opposed to squishing together.

In summary, wait for Mavericks.1 or Mavericks.2 if you possibly can…