gnc-backend-file.c: ERR_BACKEND_PERM too unspecific

Tim Wunder tim at thewunders.org
Mon Dec 5 19:57:29 EST 2005


On Monday 05 December 2005 5:11 pm, someone claiming to be Derek Atkins wrote:
> Quoting Tim Wunder <tim at thewunders.org>:
> > OK, I know I'm not qualified to have a legitimate opinion on this,
> > but can you
> > answer a stupid question for me?
> > As I understand the process, gnucash renames the existing file, then
> > creates a
> > new file of the same name, then chowns it to whatever the permissions of
> > the original file was. This seems really odd to me.
>
> It's not odd at all.  LOTS of programs do this.  emacs does this,
> for example.  It will rename() the old file to the tilde-file,
> and then create the new file and write your new data to it.  Then
> it reverts the file permissions to the original version.
>

OK. But does it try to chown the new file? This still seems to be a function 
for the O/S, and the permissions on the directory. It seems to me that an app 
shouldn't be concerned with file ownership when creating a file. 

> > Why is a new data file created at all? Why isn't the original data
> > file simply
> > copied (like a cp -a) to the backup file.
>
> "cp" is a command-line utility.  There is no "cp" API function.
>

Well, that's a good reason not to copy the file, I guess.

> >    Let the O/S deal with permissions.
> > Derek's suggestion to not chown at all and "forego the group setting
> > completely and assume the user has a proper setgid setting on the
> > directory" seems reasonable to me.
>
> You're confusing chown() and chmod().
> chown() changes ownership.  chmod changes the mode permissions.
>

Well, it might seem so by what I typed (I did type "permissions" when I 
shoulda typed "ownership"), but rest assured, I know the difference between 
chown and chmod.

Regards, 
Tim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20051205/65466610/attachment-0001.bin


More information about the gnucash-devel mailing list