473,326 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Become another user


Hello,

[Disclaimer: This might really be a Unix question ?!]

I have written a cgi-script in python - it works reasonably well. The
script is invoked by the apache web server and runs as user
'wwwrun'.

During the execution of the script I want to save some files, as the
script is run bu user 'wwwrun' that is also the resulting ownership of
the files created. Since I don't have root access on the server these
files create some hassle.

Hence my question is whether it is possible (from the the python
script) to change identity 'wwwrun' -> 'myuser' during execution?

Best Regards

Joakim Hove

--
Joakim Hove
hove AT ntnu.no /
Tlf: +47 (55 5)8 27 13 / Stabburveien 18
Fax: +47 (55 5)8 94 40 / N-5231 Paradis
http://www.ift.uib.no/~hove/ / 55 91 28 18 / 92 68 57 04
Mar 21 '06 #1
2 1030
Ant
Look at the os module: http://docs.python.org/lib/os-file-dir.html

This has various functions you may find useful depending on how you
want to go about it, such as chmod and chown.

Cheers,

--
Ant...

Mar 21 '06 #2
> Look at the os module: http://docs.python.org/lib/os-file-dir.html

This has various functions you may find useful depending on how you
want to go about it, such as chmod and chown.


Correct me if I'm wrong, but doesn't this also require having a little chat
with the admin to set things up so the server has permission to give away files
to Joakim? Say, putting them in a common group or something?

Just making the files world readable may not be the best option (which I
believe is the only option otherwise).

Cheers!
/Joel Hedlund
Mar 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Randall Smith | last post by:
I've been programming in Python for about 2 years. I think it offers the best combination of simplicity and power of any language I have explored. As I write more and larger and complex programs,...
2
by: allenj | last post by:
DB2 UDB 7.2 WSE Fixpak 9 Linux Red Hat 7.3 A very strange thing just happened w/ my DB2 server. I am on Linux and using NIS - the instance owner is in the servers /etc/passwd file. Suddenly,...
5
by: NTE | last post by:
Access 2000, My application has a main form that the users interact with. There are 2 hidden fields. When they select "filter by form" from the menu, the hidden fields become visble. Is...
1
by: Migrators | last post by:
I want to become an expert in C programming. Where can I find free electronic versions (.pdf or .doc) of C materials so that I can download it and study. Please specify the links.
0
by: Mariame | last post by:
Hello Everyone i have a session for username & i check every page that : if session("username")="' then response.redirect("Login.aspx") the problem is everytime the user refresh the page the...
1
by: RC | last post by:
Hi, How to make a Page Become time expired when user press back button? Any Sample Code or reference provided? Thanks RC
7
by: funfair | last post by:
hi,every one im facing a problem in running access it's about 25 tables 80 forms 46 query (5 append query ,1 update query ,2 delete query ) 60 reports 4 modules after 7 months of perfect...
1
by: lyealain | last post by:
hi ... i manage to export my data into excel .. if i wan to allow excel user to access the the link i put .. how can i do that ..? <% Function Export() Dim strOutput Set...
11
by: plumba | last post by:
Hi I have a user enolment form which is users fill out to let IT know that they need setting up on 'x' systems. When the user put a cross in the 'I would like Email' checkbox I would like the...
5
by: =?Utf-8?B?bXBhaW5l?= | last post by:
Hello, I am completely lost as to why I can't update a DropDownList inside a DetailsView after I perform an insert into an object datasource. I tried to simply it down to the core demostration:...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.