Re: [PATCH] srp_daemon: Avoid extra permissions for the lock file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-09-15 01:10, Sergey Gorenko wrote:
> I tested the patch for the following scenarios:
> * Start the srp_daemon service when srp_daemon is not running and the lock file does not exist.
> * Start the srp_daemon service when srp_daemon is not running and the lock file exists.
> * Start the srp_daemon service when srp_daemon is running and the lock file exists.
> * Start the srp_daemon service when srp_daemon is running and the lock file exists and the file owner is not root. (Such scenario can happen if someone tries to run srp_daemon manually as not root. The srp_daemon fails in this case, but the lock file is created). This case is handled successfully even without the fchmod() call because the srp_daemon service starts srp_daemon as root.
>  
> I do not know any case when fchmod() is needed. And it does not look like a good idea to create a word-writable file owned by root. That's why I want to remove the fchmod() call.
>  
> Do you have an idea when the fchmod() call can be needed?
>  
> If you have no other objections, I will add the fixes line and send V1.

Thanks Sergey for having shared all this information. I think this testing
is sufficient. Hence:

Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx>



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux