Issue 8589 - sal/osl/unx/file.c permissions issue ...
Summary: sal/osl/unx/file.c permissions issue ...
Status: CONFIRMED
Alias: None
Product: porting
Classification: Code
Component: code (show other issues)
Version: OOo 1.0.1
Hardware: PC Linux, all
: P3 Trivial (vote)
Target Milestone: AOO Later
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-22 15:01 UTC by mmeeks
Modified: 2017-05-20 11:29 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description mmeeks 2002-10-22 15:01:54 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;
Comment 1 Martin Hollmichel 2003-02-04 10:27:56 UTC
mh->hro: please review.
Comment 2 hennes.rohling 2003-02-04 15:38:08 UTC
@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.
Comment 3 tino.rachui 2003-02-04 16:20:49 UTC
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?
Comment 4 mmeeks 2003-02-05 10:36:55 UTC
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.
Comment 5 tino.rachui 2003-02-05 11:00:48 UTC
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
Comment 6 tino.rachui 2003-04-03 06:09:50 UTC
Probably we will deprecate queries for access rights in the future.

Kind Regards,
Tino
Comment 7 Martin Hollmichel 2004-05-18 15:41:52 UTC
set issue type to PATCH
Comment 8 tino.rachui 2005-06-13 12:24:24 UTC
Reassigned for change of responsibilities sake.
Comment 9 stx123 2006-03-02 22:10:39 UTC
So is the patch still applicable?
You may want to reconsider the target...
Comment 10 kai.sommerfeld 2006-11-01 16:17:12 UTC
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).
Comment 11 kai.sommerfeld 2006-11-01 16:18:08 UTC
.
Comment 12 kai.sommerfeld 2009-08-11 12:39:53 UTC
mav: Please take over.
Comment 13 Marcus 2017-05-20 11:29:39 UTC
Reset assigne to the default "issues@openoffice.apache.org".