Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
- index dca468c..b5da4bf 100644
- --- a/apt-pkg/contrib/fileutl.cc
- +++ b/apt-pkg/contrib/fileutl.cc
- @@ -947,7 +947,11 @@ bool FileFd::Open(string FileName,unsigned int const Mode,APT::Configuration::Co
- {
- Flags |= Replace;
- char *name = strdup((FileName + ".XXXXXX").c_str());
- - TemporaryFileName = string(mktemp(name));
- + if((iFd = mkstemp(name)) == -1)
- + {
- + return FileFdError("Could not create temporary file %s", name);
- + }
- + TemporaryFileName = string(mktemp(name)); // Remove this and use file descriptor instead of filename
- free(name);
- }
- else if ((Mode & (Exclusive | Create)) == (Exclusive | Create))
Advertisement
Add Comment
Please, Sign In to add comment