Thursday, April 23, 2015

A hack to continue with Skype 6.3 on MacOS 10.5.8

Today Skype users on MacOS 10.5.8 were surprised again that Skype rejected the login and requested to upgrade to a new version. Navigating to the new version download announced once again:

This had happened in the past and the solutions then ranged from installing every old versions of Skype (2.8) to tampering with certain system settings, last year Skype released an officially supported version 6.3 for MacOS 10.5.8 but this only lasted until today.

So I tried various things and a variation of earlier solutions did it for me which I would like to share with the community. In summary: trick Skype into thinking that you are running a higher version than 6.3.

Change 3 settings in the info.plist file

  • First of all quit Skype so that no Skype process is running anymore
  • Open info.plist with the property editor (in Finder -> Applications choose Skype, right-mouse click and choose Show Package Contents, in the new window double-click on Contents and double-click on info.plist )
  • Change
    BuildMachineOSBuild 12F45
    Bundle versions string, short 6.15
    Bundle version
    The previous settings were for me and 12C3103.
  • Close the property editor and Save the file

    Change the /etc/hosts file

    This prevents that your network contacts the Skype download server.

  • Edit the /etc/hosts file (with your editor of choice)
  • Enter this line
  • Start Skype and login again

    There you go.
    Let's wait and see until this solution becomes obsolete.

  • Wednesday, August 7, 2013

    Creating a MySQL db on Ubuntu as a normal user

    Lately I tried to create a MySQL db on Ubuntu (version 11 which has MySQL 5.1 preinstalled). I was logged in under my normal username but I got a surprise when running the mysql_install_db command.
    $ /usr/bin/mysql_install_db --datadir=./mysql/data
    Installing MySQL system tables...
    130806 22:17:21 [Warning] Can't create test file /home/andreash/mysql/data/andreas-Ub-2.lower-test
    130806 22:17:21 [Warning] Can't create test file /home/andreash/mysql/data/andreas-Ub-2.lower-test
    Installation of system tables failed!  Examine the logs in
    ./mysql/data for more information.

    There were not log files though and checking directories and permissions didn't reveal any problems.
    So I started to search and found that Ubuntu uses a security mechanism called apparmor which can be used to control certain aspects of an application.
    In regards to MySQL that means that there exists a MySQL profile which defines which directories can be accessed (and how) by the MySQL programs. The profile for the daemon mysqld is defined in /etc/apparmor.d/usr.sbin.mysqld and looks like this:

    # Last Modified: Tue Jun 19 17:37:30 2007
    #include <tunables/global>
    /usr/sbin/mysqld {
      #include <abstractions/base>
      #include <abstractions/nameservice>
      #include <abstractions/user-tmp>
      #include <abstractions/mysql>
      #include <abstractions/winbind>
      capability dac_override,
      capability sys_resource,
      capability setgid,
      capability setuid,
      network tcp,
      /etc/hosts.allow r,
      /etc/hosts.deny r,
      /etc/mysql/*.pem r,
      /etc/mysql/conf.d/ r,
      /etc/mysql/conf.d/* r,
      /etc/mysql/*.cnf r,
      /usr/lib/mysql/plugin/ r,
      /usr/lib/mysql/plugin/*.so* mr,
      /usr/sbin/mysqld mr,
      /usr/share/mysql/** r,
      /var/log/mysql.log rw,
      /var/log/mysql.err rw,
      /var/lib/mysql/ r,
      /var/lib/mysql/** rwk,
      /var/log/mysql/ r,
      /var/log/mysql/* rw,
      /{,var/}run/mysqld/ w,
      /{,var/}run/mysqld/mysqld.sock w,
      /sys/devices/system/cpu/ r,
      # Site-specific additions and overrides. See local/README for details.
      #include <local/usr.sbin.mysqld>

    So in order to enable MySQL to access a subdirectory of my $HOME I had to edit the file as root (sudo vi ...) and add this line to the list (I put it right under the /sys/devices line)

      /home/andreas/mysql/** rw,

    The apparmor man page explains the syntax and attributes in detail. For my purposes it suffices to know that ** stands for the directory and all subdirectories underneath and rw is of course read/write.

    Then this new profile needs to be activated replacing the old one via

    $ sudo apparmor_parser -rv /etc/apparmor.d/usr.sbin.mysqld
    Replacement succeeded for "/usr/sbin/mysqld".

    Finally running the MySQL program again did create the databases.

    Installing MySQL system tables...
    Filling help tables...
    To start mysqld at boot time you have to copy
    support-files/mysql.server to the right place for your system
    To do so, start the server, then issue the following commands:

    Not knowing much about apparmor yet I wonder how one would go about to allow all users (on a bigger multi-user server) to use MySQL or any other application which is secured in the same way. It would be impractical to add all users home directories to the profile file so I guess there must be some shortcut. This needs more reading.