Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 918511 Details for
Bug 662726
nfs4-acl-tools: FD leak in edit_ACL()
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
nfs4_setfacl.c: Fix fd leak in edit_ACL()
TMP (text/plain), 1.62 KB, created by
J. Bruce Fields
on 2014-07-16 20:07:07 UTC
(
hide
)
Description:
nfs4_setfacl.c: Fix fd leak in edit_ACL()
Filename:
MIME Type:
Creator:
J. Bruce Fields
Created:
2014-07-16 20:07:07 UTC
Size:
1.62 KB
patch
obsolete
>commit ba94f4b4d4bc >Author: Daniel Kobras <d.kobras@science-computing.de> >Date: Mon Jun 16 14:23:22 2014 -0400 > > nfs4_setfacl.c: Fix fd leak in edit_ACL() > > nfs4_editfacl (aka. nfs4_setfacl -e) creates temporary files for ACL > editing, but doesn't close the associated file descriptors at runtime. > Therefore, the amount of files that can be adjusted with a single > invocation of nfs4_editfacl (nfs4_setfacl -e) is limited by the > process's RLIMIT_NOFILE setting. > > This becomes a problem when you try to -R/--recursive on a tree with > more than RLIMIT_NOFILE objects; for example: > > $ mkdir TMP; cd TMP > $ for i in $(seq 1 100); do mkdir $i; done > $ ulimit -n 99 > $ EDITOR=/bin/true nfs4_editfacl -R -P . > Unable to make tempfile "/tmp/.nfs4_setfacl-tmp-R2jd85" for editing. > An error occurred during recursive file tree walk. > > Signed-off-by: J. Bruce Fields <bfields@redhat.com> > >diff --git a/nfs4_setfacl/nfs4_setfacl.c b/nfs4_setfacl/nfs4_setfacl.c >index b4cb9f5e5910..a958ac15303b 100644 >--- a/nfs4_setfacl/nfs4_setfacl.c >+++ b/nfs4_setfacl/nfs4_setfacl.c >@@ -457,7 +457,8 @@ static struct nfs4_acl* edit_ACL(struct nfs4_acl *acl, const char *path, const s > } > if ((tmp_fp = fdopen(tmp_fd, "w+")) == NULL) { > fprintf(stderr, "Unable to fdopen tempfile \"%s\" for editing.\n", tmp_name); >- goto out; >+ close(tmp_fd); >+ goto out_unlink; > } > > if (stat->st_mode & S_IFDIR) >@@ -478,6 +479,8 @@ static struct nfs4_acl* edit_ACL(struct nfs4_acl *acl, const char *path, const s > goto failed; > } > out: >+ fclose(tmp_fp); >+out_unlink: > unlink(tmp_name); > return newacl; > failed:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 662726
:
468436
|
909209
|
909435
| 918511