This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Tjeerd.Pinkert
Recipients Tjeerd.Pinkert, ned.deily, r.david.murray
Date 2010-10-06.08:10:22
SpamBayes Score 2.531808e-07
Marked as misclassified No
Message-id <1286352624.15.0.73250512839.issue10032@psf.upfronthosting.co.za>
In-reply-to
Content
Indeed I use Linux, sorry for the inconvenience of not mentioning.

Thanks Ned, I think this is indeed the case. Using os.setgroups with a list of group ids (one for the file access, one for the serial port) before switching user with os.setgid, os.setuid solved the problem.
I think os.initgroups(username, gid) does just this, only is not yet available in my distro.

It could be a feature of os that the groups of the user are set on a os.setuid call? Or would this break compatibility with the standard unix library behaviour?

To David: Yes you are right, only it would have cost me quite a bit of time to strip the code, and I tried this code to see if the behaviour was consistent when using other daemon code. Next time I will post my own code.
History
Date User Action Args
2010-10-06 08:10:24Tjeerd.Pinkertsetrecipients: + Tjeerd.Pinkert, ned.deily, r.david.murray
2010-10-06 08:10:24Tjeerd.Pinkertsetmessageid: <1286352624.15.0.73250512839.issue10032@psf.upfronthosting.co.za>
2010-10-06 08:10:23Tjeerd.Pinkertlinkissue10032 messages
2010-10-06 08:10:22Tjeerd.Pinkertcreate