[JDEV] Problems with open() calls?
Thomas D. Charron
tcharron at my-deja.com
Fri Aug 6 13:52:10 CDT 1999
Answering my own question.. ;-P
Currently, the open calls are:
mod_basic.c: fd = open(file, O_WRONLY | O_CREAT, S_IRWXU);
mod_basic.c: fd = open(file, O_RDWR | O_CREAT, S_IRWXU);
utils.c: log = open(jpair_getval(etc.vars, "errorlog"), O_WRONLY | O_CREAT | O_APPEND);
log.c: log = open(jpair_getval(etc.vars, "log"), O_WRONLY | O_CREAT | O_APPEND);
The open calls that use either open or create still need to be passed S_IRWXU, in case they need to create the file.. That's why the roster files get created fine and dandy, but the LOG files are funny looking.. ;-P
On Fri, 06 Aug 1999 11:44:01 Thomas D. Charron wrote:
> Perhaps it's just me, but I've notices that repeatedly, jabbertransport and etherx do funny things with file permisions on logfiles and username.offline.xml files.. Out of curiousity, could this be something funny with using the open function call vs fopen? Here is an example:
>-rw---Sr-- 1 tcha tcha 742 Aug 6 12:18 error.log
>-rw---Sr-- 1 tcha tcha 198 Aug 6 12:18 etherx.log
> Now, it shouldn't be looking like that, but it does.. Is it possible that O_CREAT, etc, flags passed are being trounced by another include file somewhere?
> For that matter what file DEFINES O_CREAT.. I just tried to grep for it, but to no avail..
> Any ideas?
>--== Sent via Deja.com http://www.deja.com/ ==--
>Share what you know. Learn what you don't.
>jdev mailing list
>jdev at jabber.org
--== Sent via Deja.com http://www.deja.com/ ==--
Share what you know. Learn what you don't.
More information about the JDev