Open with O_APPEND fails



Hi!

I discovered that open syscall with only O_APPEND fails with
"permission denied" if an user does not have rights to write to a file
(what is normal) even if it is root (what is a surprise). For example,
if I have a file owned by www:www and with 644 permissions root cannot
do open("testfile", O_APPEND) call. If I change ownership of I change
permission to for example 666, call succeedes.

This works on Linux (Debian). So this is a feature? Or a bug?

(I discovered that because htpasswd failed to add new
username/password pair (ran as root) to a file owner by www.)

Checked on FreeBSD 7.0-STABLE.


Mitar
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • RE: Does Scandisk MSG indicate Hardware, Application, or OS Issue? - R
    ... it is hard to find the root cause since the problem disappeared ... Based on my research, there are several reasons why the tab is missing, ... permission on the registry key ...
    (microsoft.public.windows.file_system)
  • Re: What are these for?
    ... can change it and root *is* a user. ... Since neither ls nor emacs is written to use polkit, ... Then polkit doesn't do me any good. ... the request and whether the user is allowed to give it that permission ...
    (Fedora)
  • Re: Of mice and men
    ... However, being able to change the permission of a file does depend on who owns the file, and what permissions they have given to others over that file. ... You may have installed something as "root" that enables the program to "execute" as root. ... A server is part of the OS, not an standard application run by a user. ... admin account....but this could also be done in Windows etc etc....people just view windows as a "home" OS and most "home" users just don't want to deal with the fact that there are more than one way to protect yourself. ...
    (comp.lang.cobol)
  • Re: user permission problems
    ... Subject: user permission problems ... set them up in the tcb and copied the kill command to their home dir. ... Here's my handy dandy asroot cookbook - see if you missed some steps: ... If you have special purpose logins to do things requiring root ...
    (comp.unix.sco.misc)
  • Re: user permission problems
    ... Subject: user permission problems ... Note you should put any commands in a shell script so asroot can execute it with root perms, and you can add sanity tests to prevent things like ... add root and the special scripts like "kill_it' to the users that will use the scripts. ... I would assume the symlink is done from another restricted dir, such as a support dir owned by the support login, and only RW perms for the owner. ...
    (comp.unix.sco.misc)