Re: What do these file permissions mean ---Sr-x--T ?
- From: Kevin Snodgrass <kdsnodgrass@xxxxxxxxx>
- Date: Sat, 26 May 2007 19:15:07 -0500
jc@xxxxxxxxxxx wrote:
I figured out the culprit: it was the open() call in the application.
I was using the open() function without the mode parameter even though I was
specifying O_CREAT flag.
Which form of open() did you use?
int open(const char *pathname, int flags);
int open(const char *pathname, int flags, mode_t mode);
According to man 2 open:
mode must be specified when O_CREAT is in the flags, and is ignored otherwise.
Since you specify above that you used O_CREAT you must use the second form of open(), including the "mode", which is what sets permissions on the filesystem level.
*IF* you used the first form of open(), e.g. with out the "mode" parameter, I would assume (ALL caveats apply!) the system is expecting the "mode" to be passed on the stack as the third parameter, which it isn't getting, so it will use whatever 32-bits happen to be in that position on the stack. Under other circumstances you will get a file with different, bizarre, permissions, based on that stack contents.
So, it seems that when one does such an atrocity, the OS (or filesystem?)
decides to use the bizarre permissions (---Sr-x--T) on newly created files.
Read the man page, check your code. I'll bet 1 glazed Krispy Kreme donut you used the first form of open(), when the second form is required because of the O_CREAT flag.
.
- References:
- Prev by Date: Re: RHEL and Virtualization ???
- Next by Date: Re: RHEL and Virtualization ???
- Previous by thread: Re: What do these file permissions mean ---Sr-x--T ?
- Next by thread: RHEL and Virtualization ???
- Index(es):
Relevant Pages
|