From e3ec59bc982ca9dfb6bf6a322ec4abac907eb152 Mon Sep 17 00:00:00 2001 From: наб Date: Thu, 23 Jan 2025 20:55:28 +0100 Subject: Take const& in GetLock() --- apt-pkg/contrib/fileutl.cc | 2 +- apt-pkg/contrib/fileutl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg/contrib') diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 4f6eecf8b..76435bec8 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -247,7 +247,7 @@ static std::string GetProcessName(int pid) } return ""; } -int GetLock(string File,bool Errors) +int GetLock(string const &File,bool Errors) { // GetLock() is used in aptitude on directories with public-write access // Use O_NOFOLLOW here to prevent symlink traversal attacks diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index 9306842d1..1f31447dc 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -181,7 +181,7 @@ APT_PUBLIC bool RunScripts(const char *Cnf); APT_PUBLIC bool CopyFile(FileFd &From,FileFd &To); APT_PUBLIC bool RemoveFile(char const * const Function, std::string const &FileName); APT_PUBLIC bool RemoveFileAt(char const * const Function, int const dirfd, std::string const &FileName); -APT_PUBLIC int GetLock(std::string File,bool Errors = true); +APT_PUBLIC int GetLock(std::string const &File,bool Errors = true); APT_PUBLIC bool FileExists(std::string const &File); APT_PUBLIC bool RealFileExists(std::string const &File); APT_PUBLIC bool DirectoryExists(std::string const &Path); -- cgit v1.2.3-70-g09d2