I have a program that is doing some stuff. It is running under user A.
A very little part of it is to transfer a file to a directory in the home of user B. The transfer is done by a API-call of the language it is written and not by a system-call of a shell-command.
Now I see multiple ways to do that transfer.
- Run the program as root.
- Put A and B into the same group and adjust the directory-ownership
- sudo the program
- make the move with a system-call and sudo that
- put the file locally in A and make the transfer externally (outsource the problem)
- ACL the directory of B
I think the requirement is common since running a program via root is bad taste. What would be the most common way to handle it?
Program of A generates the file. B should be able to read and delete it.