mysql_setpermission broken

Bug #33940 reported by hackel
2
Affects Status Importance Assigned to Milestone
mysql-dfsg-5.0 (Debian)
Fix Released
Unknown
mysql-dfsg-5.0 (Ubuntu)
Fix Released
Low
Henri Cook

Bug Description

Package: mysql-server-5.0
Version: 5.0.18-8.1

mysql_setpermission dies with the following error:

Incorrect usage of DB GRANT and GLOBAL PRIVILEGES at /usr/bin/mysql_setpermission line 260, <STDIN> line 8.

When trying to set any permissions for an existing db/user combination.

This was reported here and here:
http://bugs.debian.org/328287
http://bugs.mysql.com/bug.php?id=14618

Revision history for this message
In , Christian Hammers (ch) wrote : Re: Bug#328287: mysql-server-4.1

retitle 328287 mysql-server-4.1: mysql_setpermission is broken
thanks

Revision history for this message
In , Christian Hammers (ch) wrote : Re: mysql_setpermission is broken

notfound 328287 mysql-server-5.0 5.0.18
thanks

I've just tried it, this is really only for Sarge's 4.1.

bye,

-christian-

Revision history for this message
hackel (hackel) wrote :

Package: mysql-server-5.0
Version: 5.0.18-8.1

mysql_setpermission dies with the following error:

Incorrect usage of DB GRANT and GLOBAL PRIVILEGES at /usr/bin/mysql_setpermission line 260, <STDIN> line 8.

When trying to set any permissions for an existing db/user combination.

This was reported here and here:
http://bugs.debian.org/328287
http://bugs.mysql.com/bug.php?id=14618

Revision history for this message
Matt Zimmerman (mdz) wrote :

The Debian bug report says it only affects mysql 4.1, and the upstream bug report has been closed due to a lack of response from the reporter

Revision history for this message
Matt Zimmerman (mdz) wrote :

       $sth = $dbh->do("GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES,SHOW DATABASES,PROCESS ON $db.* TO $user@\"$host\" IDENTIFIED BY \'$pass\'") || die $dbh->errstr;

Changed in mysql-dfsg-5.0:
assignee: nobody → adconrad
Revision history for this message
Martin Pitt (pitti) wrote :

Does not affect 5.0 according to Debian bug.

Changed in mysql-dfsg-5.0:
status: Unconfirmed → Rejected
Revision history for this message
Martin Pitt (pitti) wrote :

Whoops, upstream seems to disagree. Reopening.

Changed in mysql-dfsg-5.0:
status: Rejected → Unconfirmed
Mathias Gug (mathiaz)
Changed in mysql-dfsg-5.0:
assignee: adconrad → ubuntu-server
Revision history for this message
Henri Cook (henricook) wrote :

Problem confirmed, fix on the way

Changed in mysql-dfsg-5.0:
assignee: ubuntu-server → ph8
status: New → Confirmed
Revision history for this message
Henri Cook (henricook) wrote :

Attached - I have only just joined the team so have no idea how to get this into the distribution - anyone who has more info on how i'm meant to do this would be most welcome to contact me.

To apply this patch for now:

cd /usr/bin
sudo patch -p0 < /path/to/mysql_setpermission.patch

Let me know if there's any problems,

ph8

Revision history for this message
Mathias Gug (mathiaz) wrote :

Thanks for your patch.

Can you provide a simple test case to reproduce the problem ?

Changed in mysql-dfsg-5.0:
importance: Medium → Low
Revision history for this message
Henri Cook (henricook) wrote :

The test case I used is visible at the mysql bug page http://bugs.mysql.com/bug.php?id=14618

There's a lot of text but it's relatively simple step (the offending one is towards the end so you might want to just skip straight there) (Option Six)

The patch does involve changing the next of the option 6 command, which may mean it does something other than what was originally intended, I believe i've captured the original intentions but if you disagree let me know

Revision history for this message
Mathias Gug (mathiaz) wrote :

Thanks for you patch.

Upstream has committed another patch which remove the option:
  Remove option 6 - trying to grant global privileges at the database
    level does not work. The spirit of the program appears to be aimed
    at database privileges, so do not give the option of granting global
    privileges as it may be unexpected.

 I think that what should be done is to grant privileges at the database level, and don't grant any privilege at the global level.

Changed in mysql-dfsg-5.0:
status: Confirmed → In Progress
Revision history for this message
Henri Cook (henricook) wrote :

Sounds sensible

Revision history for this message
Mathias Gug (mathiaz) wrote :

Upstream has committed a patch that fixes this bug into their trees (4.1 and 5.0).

Could you have a look at integrating their patch ?

Changed in mysql-dfsg-5.0:
status: In Progress → Triaged
Revision history for this message
Chuck Short (zulcss) wrote :

Looking at backporting the patch for hardy.

Changed in mysql-dfsg-5.0:
status: Triaged → In Progress
Revision history for this message
Mathias Gug (mathiaz) wrote : Re: [Bug 33940] Re: mysql_setpermission broken

On Mon, Feb 04, 2008 at 01:39:04PM -0000, Chuck Short wrote:
> Looking at backporting the patch for hardy.
>

I think MySQL has committed a patch in their tree. Thus it should be
fixed in 5.0.51 (which should be uploaded soon).

--
Mathias Gug
Ubuntu Developer http://www.ubuntu.com

Revision history for this message
Chuck Short (zulcss) wrote :

It has been included.

Thanks
chuck

Changed in mysql-dfsg-5.0:
status: In Progress → Fix Released
Changed in mysql-dfsg-5.0 (Debian):
status: New → Fix Released
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.