G
G
Gorelov2018-12-09 16:36:33
linux
Gorelov, 2018-12-09 16:36:33

Why does the group change when the contents of the file change?

I set a group for the file that does not include the owner of the file, but after changing the data, the group changed to the owner.
Example:
after creating a file - -rwxr-x--- user user some_file
after changing a group - -rwxr-x--- user another_group some_file
after changing a file --rwxr-x--- user user some_file

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
jcmvbkbc, 2018-12-09
@Askme23

Why does the group change when the contents of the file change?

Because the data change is done in a way that changes the group. The file may have been deleted and recreated. Running a data change process under strace might answer that question.
Simply opening a file and writing data to it does not change the group.

D
Dmitry, 2018-12-09
@q2digger

Show the rights to the folder. There probably is sgid

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question