[Pythonmac-SIG] Shelve ... Denied!

Israel C. Evans israel at sandlotgames.com
Fri Jun 6 15:11:46 EDT 2003


Hey there.. Thanks for this bit of help..
permissions and chmod still twist my brain for some odd reason, but I 
think I do have this working.

The problem I'm having is that I need to be able to create new shelve 
db's through this web interface I'm building here.  I'm confused as to 
how I should go about setting the permissions for various users so that 
they can create, edit, save and delete files based upon their 
permissions.

Are there any tutorials or articles any of you have found particularly 
helpful in regards to this subject? Or, better yet, would any of you 
have a little knowledge pill handy that could magically endow me with 
the know how to do this?  No?  oh well.  I'll just have to do it the 
hard way...
Now in regards to articles or other help, I would be most grateful for 
said objects of desire.

Thanks much,

~Israel~


On Wednesday, May 28, 2003, at 02:00  AM, Jack Jansen wrote:

>
> On Wednesday, May 28, 2003, at 00:43 Europe/Amsterdam, Israel C. Evans 
> wrote:
>> here is the bit that python or maybe apache chokes on:
>> db = shelve.open('200305','c')
>>
>> and this gives me this error (condensed due to the size of the cgitb 
>> traceback info I get).
>> error: (13, 'Permission denied')
>>        args = (13, 'Permission denied')
>
> This sounds like a typical unix permissions problem. Check the uiserID 
> and mode on the shelve files and the userIDs that you expect to do 
> updates. If there is only one userID that does updates then any mode 
> that has rw-...... in the first column is okay. If there are multiple 
> userIDs that do updates you need at least rw-rw-... or even rw-rw-rw-.
>
> Hmm, shelve.open() has no direct way to set the mode, it uses 
> rw-rw-rw- modified by the umask. The umask is the bits that are 
> automatically taken _out_ of the modes of the files you create, and it 
> defaults to octal 022 (in other words, the bits ----w--w- are taken 
> out of your filemode). If you set the umask to 02 or even 0 before 
> creating the file that should help.
> --
> Jack Jansen, <Jack.Jansen at cwi.nl>, http://www.cwi.nl/~jack
> If I can't dance I don't want to be part of your revolution -- Emma 
> Goldman
>
>
>



~Israel~




More information about the Pythonmac-SIG mailing list