How make RW access file in /tmp for two users

I have program, ported from linux, and share data between some users in system. Program executed under two different users, who enter one group, and periodical created files in /tmp. In normal case progs may read and write file created another user.

But under FreeBSD files created with directory group, in my case 'wheel' group. I not understand different behaviour FreeBSD and Linux (Ubuntu).

In Linux touch /tmp/testfile:
Code:
-rw-rw-r-- 1 aircrazy aircrazy       0 Apr  4 12:57 testfile

In FreeBSD:
Code:
-rw-rw-r-- 1 aircrazy wheel       0 Apr  4 12:00 testfile

Please, explain this or give link for documentation.
 
Please provide the output of id aircrazy and ls -ld /tmp.
 
Code:
id aircrazy
uid=1001(aircrazy) gid=1001(aircrazy) groups=1001(aircrazy)

ls -ld /tmp
drwxrwxrwt+ 8 root wheel 512 apr  3 23:05 /tmp
 
It looks like you have an ACL on /tmp. Why?

getfacl /tmp
 
Code:
#file: /tmp
#owner: root
#group: wheel
user::rwx
group::rwx
group:aircrazy:rwx
mask::rwx
other::rwx
Try override permission, but it not works. I removed ACLs.
 
I actually think the Linux behaviour is wrong. As far as I know POSIX defines the sticky bit on a directory as writeable by the owner, the group of the directory or the superuser (root). However, in Linux's case everybody in the aircrazy group would also be able to edit the file. This is not what is defined in POSIX.
 
Оkay.
For write access for this file to another user I must change group who included me and another user?
 
aircrazy said:
For write access for this file to another user I must change group who included me and another user?
Yes, and of course set the correct permissions so the group can write.
 
Back
Top