I am going to read a file which needs root privilege and I have to save it somewhere with another user or group, for example reading dmesg which needs root and save it some other place with permission 770 for user/group: test/test. the problem here that I can not save it as root, is SElinux policy which gives me error.So I need to change the process privilage while I am saving the file.
any suggestion?