Apache OpenOffice (AOO) Bugzilla – Issue 8589
sal/osl/unx/file.c permissions issue ...
Last modified: 2017-05-20 11:29:39 UTC
The code in getFileStatus, looks like it would incorrectly flag a file with your group, of permissions ---rw---- as not writable - which it would be. Havn't verified, but it looks that way, if ( getuid() == aFileStat.st_uid ) { if ( 0 == (S_IRUSR & aFileStat.st_mode) ) pStat->uValidFields &= ~osl_FileStatus_Mask_Attributes; if ( 0 == (S_IWUSR & aFileStat.st_mode) ) pStat->uAttributes|=osl_File_Attribute_ReadOnly; if ( S_IXUSR & aFileStat.st_mode ) pStat->uAttributes|=osl_File_Attribute_Executable; } else if ( getgid() == aFileStat.st_gid ) { if ( 0 == (S_IRGRP & aFileStat.st_mode) ) pStat->uValidFields &= ~osl_FileStatus_Mask_Attributes;
mh->hro: please review.
@Michael: You're right but anyhow the flags are windows like so only w access rights will result in no rights f.e. @tra: We already talked about that.
As far as I know currently nobody relies on the "permission" information and in my opinion it doesn't belong to osl_getFileStatus, but it is there and we cannot remove it anymore. A new osl whatever API should not provide such kind of information. BTW, isn't the described case a little bit petty, who creates a file with no access rights for himself but for a group he belongs to?
Yes - it is somewhat petty :-) especially if - as you say - no-one uses the result. However it is a bug I noticed reading the code, so presumably it's worth filing. It is fixed in my re-write of the vfs backend, to be submitted soon.
Hi Michael, yes it is a bug and please don't get me wrong I don't want to discorage you to read the code and find errors, especially the sal/osl code. I'm glad there are people doing this one of the benefits of Open Source. And because the Unix file implementation of osl is in an extra bad I like it all the more. BTW I recently inherited the responsibility for the osl file implementation and already refactored some parts which are now hopefully in a better form with fewer bugs. Best Regards, Tino
Probably we will deprecate queries for access rights in the future. Kind Regards, Tino
set issue type to PATCH
Reassigned for change of responsibilities sake.
So is the patch still applicable? You may want to reconsider the target...
kso: There is no patch attached to this issue. The code snippet by mmeeks justs points to the problematic existing peace of code, but is not a fix. Setting issue back to DEFECT, changing target to 'Later' (Because all agreed that this is not a high priority issue).
.
mav: Please take over.
Reset assigne to the default "issues@openoffice.apache.org".