[libvirt] [PATCH 2/2] maint: prohibit access(,X_OK)

Laine Stump laine at laine.org
Mon Mar 21 17:26:05 UTC 2011


On 03/18/2011 09:43 PM, Eric Blake wrote:
> On 03/18/2011 02:46 PM, Eric Blake wrote:
>> This simplifies several callers that were repeating checks already
>> guaranteed by util.c, and makes other callers more robust to now
>> reject directories.  remote_driver.c was over-strict - access(,X_OK)
>> is not strictly needed to execute a file (although its unusual to see
>> a file with X_OK but not R_OK).
> I meant to say that access(,R_OK) is not strictly necessary.  But I
> stand a bit corrected - binaries can be executed without read
> permission, but scripts require both execute permission (to do the #!
> search) and read permission (for the interpreter to process the script).
>
> Maybe virFileIsExecutable should add a check for readability?

I guess yes, but if there's any case where libvirt will want to have X 
but not R on a file, it should be optional.




More information about the libvir-list mailing list