Thursday, 21 March 2013

Disabling XML Validation in Eclipse 4 Juno

It seems that every time I set up a project in Eclipse PDT I run up against the problem of a bunch XML errors being generated from deep inside some third party library somewhere.

Searching Google shows lots of advice  saying you need to go to Preferences>Validators and clicking "Suspend all validators".

The trouble is that there is no 'Validators' option in that location.

It seems that to turn off this unwanted validation you need to first install
"Eclipse XML Editors and Tools".

Why Eclipse will try and do the validation in the first place without this module installed is a question for another day.

Once you have installed that you can follow the normal steps to  "Suspend all Validators" (either globally or for individual projects) as described everywhere on the Intertubes.

One final thing though, be aware that after suspending the validators, you must right-click the project and click "Validate" to remove all the nasty red marks.

Monday, 18 March 2013

SOLVED: "Permission denied" when mounting sshfs

I've just come across an annoying bug while attempting to mount a directory using sshfs.

sshfs /home/brettg/test
fuse: failed to open /dev/fuse: Permission denied

The normal google search resulted in many, many hits explaining that this is due to the user account not being a member of the 'fuse' group.

Trouble is, my user account is a member of the fuse group:

$ groups
brettg adm cdrom sudo dip plugdev fuse lpadmin sambashare libvirtd

Note: To add your user to the fuse group use this command:

sudo usermod -a -G fuse brettg

The problem is that Mint 14 sets the user permissions on the fuse device incorrectly which results in only the root user being able to mount it.

You can confirm this is the case like this:

$ ls -al /dev/fuse
crw------T 1 root root 10, 229 Mar  9 10:15 /dev/fuse

There are two problems here. The first is that the fuse device is not owned by the fuse group. Fix it like this:

$ sudo chgrp fuse /dev/fuse

The next problem is that the group permissions for the fuse device are set to deny access to everyone. Fix that with:

sudo chmod 660 /dev/fuse

The fuse permissions should now look like this:

$ ls -al /dev/fuse
crw-rw---- 1 root fuse 10, 229 Mar  9 10:15 /dev/fuse

Having done this you should now be able to mount a fuse device (such as sshfs) as a normal user (who belongs to the fuse group of course).

Upon reboot, I noticed that the permissions on the fuse device were partly reset;

$ ls -al /dev/fuse
crw-rw-rwT 1 root root 10, 229 Mar 18 12:03 /dev/fuse

However, this does not appear to have had an adverse effect on my ability to mount. I find this to be somewhat confusing.