* Use O_CLOEXEC when open directories, attribute directories, indexes, and
queries. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34291 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
d82802841c
commit
f31ffa6b8a
@ -5133,8 +5133,8 @@ open_dir_vnode(struct vnode* vnode, bool kernel)
|
|||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
// file is opened, create a fd
|
// directory is opened, create a fd
|
||||||
status = get_new_fd(FDTYPE_DIR, NULL, vnode, cookie, 0, kernel);
|
status = get_new_fd(FDTYPE_DIR, NULL, vnode, cookie, O_CLOEXEC, kernel);
|
||||||
if (status >= 0)
|
if (status >= 0)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
@ -5159,11 +5159,11 @@ open_attr_dir_vnode(struct vnode* vnode, bool kernel)
|
|||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
|
|
||||||
status = FS_CALL(vnode, open_attr_dir, &cookie);
|
status = FS_CALL(vnode, open_attr_dir, &cookie);
|
||||||
if (status < 0)
|
if (status != B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
// file is opened, create a fd
|
// directory is opened, create a fd
|
||||||
status = get_new_fd(FDTYPE_ATTR_DIR, NULL, vnode, cookie, 0, kernel);
|
status = get_new_fd(FDTYPE_ATTR_DIR, NULL, vnode, cookie, O_CLOEXEC, kernel);
|
||||||
if (status >= 0)
|
if (status >= 0)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
@ -6610,7 +6610,7 @@ index_dir_open(dev_t mountID, bool kernel)
|
|||||||
|
|
||||||
// get fd for the index directory
|
// get fd for the index directory
|
||||||
int fd;
|
int fd;
|
||||||
fd = get_new_fd(FDTYPE_INDEX_DIR, mount, NULL, cookie, 0, kernel);
|
fd = get_new_fd(FDTYPE_INDEX_DIR, mount, NULL, cookie, O_CLOEXEC, kernel);
|
||||||
if (fd >= 0)
|
if (fd >= 0)
|
||||||
return fd;
|
return fd;
|
||||||
|
|
||||||
@ -6813,7 +6813,7 @@ query_open(dev_t device, const char* query, uint32 flags, port_id port,
|
|||||||
|
|
||||||
// get fd for the index directory
|
// get fd for the index directory
|
||||||
int fd;
|
int fd;
|
||||||
fd = get_new_fd(FDTYPE_QUERY, mount, NULL, cookie, 0, kernel);
|
fd = get_new_fd(FDTYPE_QUERY, mount, NULL, cookie, O_CLOEXEC, kernel);
|
||||||
if (fd >= 0)
|
if (fd >= 0)
|
||||||
return fd;
|
return fd;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user