"Cannot find or run the base session script. Running Gnome in failsafe session instead."

After logging into my Ubuntu 9.04 machine I'm greeted with the following message "Cannot find or run the base session script. Running Gnome in failsafe session instead". The reason for this was I had messed up my permissions and the following fixed it:

After logging in and receiving the error message press Ctrl-Alt-F1 to drop back into the command line. Then run the following:

Sudo chmod 755 /etc/gdm/Xsession