>-----Original Message-----
>From: Joerg Bruehe [mailto:joerg.bru...@oracle.com]
>Sent: Thursday, January 20, 2011 6:54 AM
>To: Jerry Schwartz
>Cc: mysql@lists.mysql.com
>Subject: Re: Can't read dir of '.' (errno: 13)
>
>Hi!
>
>
>Jerry Schwartz wrote:
>> [[...]]
>>
>>> [[...]]
>>>
>> [JS] Sorry, that still doesn't make sense to em. To authenticate the user,
>> mysqld needs to read the mysql database. That is also where the databases 
>> are
>> listed (in `mysql`.`db`). If the daemon can read `mysql`.`user`, why can't 
>> it
>> read `mysql`.`db`? It's a MyISAM database, so everything is in the same 
>> file.
>
>Now I understand how your question was meant - sorry to explain a
>completely different issue first.
>
[JS] No problem. To me, knowledge is never useless.

>About reading files: MyISAM is stored file-per-table, so the table
>"mysql.user" is stored in the three files "mysql/user.{frm,MYD,MYI}";
>table "mysql.db" is stored in other files which might have got different
>permissions. (This would be a handling error, obviously.)
>
[JS] Stranger things have happened. I could tell tales that would turn your 
hair white (mine already is).
>>
>> What am I missing? Does SHOW DATABASES do something other than pull the
>> database names out of `mysql`.`db`?
>
>AIUI, there are operations for which the server wants to read the
>directory, and "show databases" seems to be one of them.
>For examples, see these bug reports:
>  http://bugs.mysql.com/bug.php?id=22615
>  http://bugs.mysql.com/bug.php?id=42676
>  http://bugs.mysql.com/bug.php?id=51399
>Sorry - I would tell you more details, if I knew them for sure.
>
[JS] It never occurred to me that SHOW DATABASE would scan the file directory. 
Johan De Meersman came up with the same explanation.

>Now, consider a case like this:
>  drwx--x--x   user-A group-B   .
>  -rw-rw-rw-   user-A group-B   file
>
>In this case, "file" would be readable (and even writable) for everybody
>knowing the name, but a "ls ." would fail for everybody but "user-A":
>There is no "read" permission on the directory for anybody but the owner.
>
[JS] Got it.
>
>Regards,
>Jörg
>
>--
>Joerg Bruehe,  MySQL Build Team,  joerg.bru...@oracle.com
>ORACLE Deutschland B.V. & Co. KG,   Komturstrasse 18a,   D-12099 Berlin
>Geschaeftsfuehrer: Juergen Kunz, Marcel v.d. Molen, Alexander v.d. Ven
>Amtsgericht Muenchen: HRA 95603





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to