[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    Re: [Kde-pim] Strange Korganizer behavior...
From:       Josh Pollak <pardsbane () offthehill ! org>
Date:       2001-09-24 4:56:43
[Download RAW message or body]

On Monday 24 September 2001 12:49, you wrote:
> linux documentation is usually scant and useless, but in this case,
> the manpage does say the the mode is masked against your umask.
> man umask for more information on how to change your umask.

> from open (2):
>
>        mode specifies the permissions to use if  a  new  file  is
>        created. 

You are correct, however, my problem is that the permissions are getting 
modified on a file that _already_exists_, not a new file. As the quote from 
the man page above says, mode specifies the permissions to use if a new file 
is created...

For example, I have a calendar I want both myself and my friend to edit. So I 
create a group called "calendar", and add users "me" and "friend" to that 
group. I create a calendar.ics file, and set its permissions to 664, 
me.calendar.

Then "friend" opens the calendar in KOrganizer, modifies it and saves it... 
Now the file has permissions 664, and friend.friend....

As far as I can tell, the open() function should be changing the permissions, 
because the file already exists.

Could the fact that the file is on an NFS share be the problem? I can't see 
how that would affect the situation.

-Josh


> a better solution is to call fchmod() after open(), so that you
> will not have to change the umask. this will change the permissions
> on an open file.
>
>
> from open (2):
>
>        mode specifies the permissions to use if  a  new  file  is
>        created.  It  is  modified  by  the process's umask in the
>        usual way: the permissions of the created file are (mode &
>        ~umask).
>
>
>  Ali.
>
> >     impl->fd = open(impl->path,flags, mode);
> >
> > The calling function (icalfileset_new, line 72), passes in flags =
> > O_RDWR|O_CREAT, and mode = 0664.
> >
> > I checked the man page for open(), and while it says that it will set the
> > permissions for a created file if O_CREAT is specified, it says that the
> > permissions will not be adjusted if the file already exists.
> >
> > I could not find any other place in the code where the permissions of the
> > file would be modified....
> >
> > Any ideas?
> >
> > -Josh
> > _______________________________________________
> > Kde-pim mailing list
> > Kde-pim@mail.kde.org
> > http://mail.kde.org/mailman/listinfo/kde-pim
_______________________________________________
Kde-pim mailing list
Kde-pim@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-pim

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic