Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_syscalls.c
Show First 20 Lines • Show All 1,006 Lines • ▼ Show 20 Lines | if (error != 0) { | ||||
/* | /* | ||||
* Handle special fdopen() case. bleh. | * Handle special fdopen() case. bleh. | ||||
* | * | ||||
* Don't do this for relative (capability) lookups; we don't | * Don't do this for relative (capability) lookups; we don't | ||||
* understand exactly what would happen, and we don't think | * understand exactly what would happen, and we don't think | ||||
* that it ever should. | * that it ever should. | ||||
*/ | */ | ||||
if (nd.ni_strictrelative == 0 && | if ((nd.ni_lcf & NI_LCF_STRICTRELATIVE) == 0 && | ||||
(error == ENODEV || error == ENXIO) && | (error == ENODEV || error == ENXIO) && | ||||
td->td_dupfd >= 0) { | td->td_dupfd >= 0) { | ||||
error = dupfdopen(td, fdp, td->td_dupfd, flags, error, | error = dupfdopen(td, fdp, td->td_dupfd, flags, error, | ||||
&indx); | &indx); | ||||
if (error == 0) | if (error == 0) | ||||
goto success; | goto success; | ||||
} | } | ||||
Show All 29 Lines | |||||
success: | success: | ||||
/* | /* | ||||
* If we haven't already installed the FD (for dupfdopen), do so now. | * If we haven't already installed the FD (for dupfdopen), do so now. | ||||
*/ | */ | ||||
if (indx == -1) { | if (indx == -1) { | ||||
struct filecaps *fcaps; | struct filecaps *fcaps; | ||||
#ifdef CAPABILITIES | #ifdef CAPABILITIES | ||||
if (nd.ni_strictrelative == 1) | if ((nd.ni_lcf & NI_LCF_STRICTRELATIVE) != 0) | ||||
fcaps = &nd.ni_filecaps; | fcaps = &nd.ni_filecaps; | ||||
else | else | ||||
#endif | #endif | ||||
fcaps = NULL; | fcaps = NULL; | ||||
error = finstall(td, fp, &indx, flags, fcaps); | error = finstall(td, fp, &indx, flags, fcaps); | ||||
/* On success finstall() consumes fcaps. */ | /* On success finstall() consumes fcaps. */ | ||||
if (error != 0) { | if (error != 0) { | ||||
filecaps_free(&nd.ni_filecaps); | filecaps_free(&nd.ni_filecaps); | ||||
▲ Show 20 Lines • Show All 3,611 Lines • Show Last 20 Lines |