Cygwin: fix an ugly cast
fhandler_base::fchown casts any fhandler landing here to a fhandler_disk_file. That's ugly and dangerous. Duplicate the path_conv info into an explicitly create fhandler_disk_file instead and call fchmod on that. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
bedefff9e2
commit
c5913771a6
|
@ -1725,7 +1725,10 @@ int
|
|||
fhandler_base::fchown (uid_t uid, gid_t gid)
|
||||
{
|
||||
if (pc.is_fs_special ())
|
||||
return ((fhandler_disk_file *) this)->fhandler_disk_file::fchown (uid, gid);
|
||||
{
|
||||
fhandler_disk_file fh (pc);
|
||||
return fh.fchown (uid, gid);
|
||||
}
|
||||
/* By default, just succeeds. */
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue