Permissions of /var/run/mysqld too strict with Dapper

Bug #28351 reported by Daniel Hahler
6
Affects Status Importance Assigned to Milestone
Ubuntu
New
Medium
Unassigned
mysql-dfsg-4.1 (Ubuntu)
New
Medium
Unassigned

Bug Description

The permissions on /var/run/mysqld directory are too strict, after dist-upgrading from breezy to dapper:

$ sudo ls -ld /var/run/mysqld
drwxrwx--- 2 mysql root 80 2006-01-10 18:11 /var/run/mysqld

This causes only the "mysql" user (and root) to be able to connect to MySQL through the socket in there
(/var/run/mysqld/mysqld.sock), causing the following error with a "normal" user (like the "Apache2 user"
also):

$ mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13)

I could not find a place where it might have happened. Perhaps it's even unrelated to the mysql-server
package.

I'd be interested in what caused this.

This fixed it:
$ sudo chmod a+x /var/run/mysqld

Revision history for this message
Daniel Hahler (blueyed) wrote :

The perms on /var/run/mysqld get reset here to rwxrwx--- here on every reboot, but I could not find anything
in /etc/init.d/ that would cause this..?!

Revision history for this message
Jim Tarvid (tarvid) wrote :

The original my.cnf includes the line

user = mysql

/usr/share/doc/mysql-server-5.0/examples/my-medium.cnf

does not.

Replacing my.cnf with my-medium.cnf permits mysqld to start.

Someone needs to arbitrate the security tradeoffs.

Revision history for this message
Daniel Hahler (blueyed) wrote :

Do you mean the "user=mysql"-line in /etc/mysql/my.cnf causes mysqld to chmod the /var/run/mysqld directory to 770?

Revision history for this message
Daniel Hahler (blueyed) wrote :

This seems to be related to the move of /var/run to tmpfs: http://lists.ubuntu.com/archives/ubuntu-devel-announce/2006-January/000048.html

Then, it has to be a wrong setting in the mysql-server part that creates this directory on startup.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.