It suffices to open a node read-only to write its attributes. In fact
open() is supposed to fail for directories when write access is requested. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22168 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1107,7 +1107,7 @@ static int set_file_attrs( const char *name,
|
|||||||
ptr = (unsigned char *)attr_buff;
|
ptr = (unsigned char *)attr_buff;
|
||||||
guard = ptr + attr_size;
|
guard = ptr + attr_size;
|
||||||
|
|
||||||
fd = open( name, O_RDWR | O_NOTRAVERSE );
|
fd = open( name, O_RDONLY | O_NOTRAVERSE );
|
||||||
if( fd < 0 ) {
|
if( fd < 0 ) {
|
||||||
return errno; /* should it be -fd ? */
|
return errno; /* should it be -fd ? */
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user