Hello, thanks for your response. I solved the problem with manually overriding the mode it gets passed to open() (it was not previously).
With regards Črnko On 20 maj, 00:38, Graham Dumpleton <[email protected]> wrote: > On 20 May 2010 00:18, jinzo <[email protected]> wrote: > > > Hello, > > > First, let me appologise for double post, but mr. Neto asked me to > > post again. > > Regarding ~/.profile - I have checked it (and every other file alike), > > and I didn't find anything that would set the umask/etc. > > > I have also tried with umask. Several times and configurations. No > > success. > > I have set the WSGIRestrictEmbedded setting now, but no changes. > > My vhost:http://dpaste.com/hold/196538/ > > Confirm at least what the umask setting is by using simple WSGI hello > world program: > > import os > > def application(environ, start_response): > status = '200 OK' > > mask = os.umask(0) > output = "%04o" % mask > os.umask(mask) > > response_headers = [('Content-type', 'text/plain'), > ('Content-Length', str(len(output)))] > start_response(status, response_headers) > > return [output] > > My guess is that it will and the real problem is the mask that is > being created when the file is created. > > The default in Python is: > > Help on built-in function open in module posix: > > open(...) > open(filename, flag [, mode=0777]) -> fd > > Open a file (for low level IO). > > If the code is explicitly passing in a mode of 0600 instead, then will > only be accessible to owner of file. > > Same deal if file being created by C in extension module. > > So, find the code where file is being created in the first place and > see if an explicitly mode argument is being provided which is > overriding which bits of umask would be used. > > Graham > > > > > Thanks for your quick responses. > > With regards, Črnko > > On 19 maj, 01:07, Graham Dumpleton <[email protected]> wrote: > >> On 19 May 2010 05:24, jinzo <[email protected]> wrote: > > >> > Hello, > > >> > I have an application that's now running with mod_wsgi 3.1 and apache > >> > 2.2.15 in daemon mode. The application (Django) allows for file > >> > uploads, and recently I started to get some errors. It turned out, > >> > that the files I upload (and are written thru the application) all > >> > have only read and write permissions for owner, and nothing else. I > >> > tried several things (from removing to changing umask, ...) and I > >> > still get this efect, but not always. > >> > Any ideas what I'm doing wrong ? > > >> Try setting 'umask' option for WSGIDaemonProcess. > > >> http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDae... > > >> Also ensure you have actually delegated it properly to run in daemon > >> mode by setting: > > >> WSGIRestrictEmbedded On > > >> outside of VirtualHost in Apache main configuration. > > >> Also post your Apache configuration snippets for mod_wsgi so can > >> verify how you have set it up and whether for example you are actually > >> setting user/group to WSGIDaemonProcess to have code run as user other > >> than Apache which perhaps restrictive permissions. > > >> Graham > > >> -- > >> You received this message because you are subscribed to the Google Groups > >> "modwsgi" group. > >> To post to this group, send email to [email protected]. > >> To unsubscribe from this group, send email to > >> [email protected]. > >> For more options, visit this group > >> athttp://groups.google.com/group/modwsgi?hl=en. > > > -- > > You received this message because you are subscribed to the Google Groups > > "modwsgi" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]. > > For more options, visit this group > > athttp://groups.google.com/group/modwsgi?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group > athttp://groups.google.com/group/modwsgi?hl=en. -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
