Skip to content

Commit

Permalink
Merge pull request xbmc#8408 from wsnipex/redact-smb
Browse files Browse the repository at this point in the history
redact filenames in smbfile log output
  • Loading branch information
MartijnKaijser committed Nov 20, 2015
2 parents 3460c95 + 3969c2f commit cc12679
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions xbmc/filesystem/SMBFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ bool CSMBFile::Open(const CURL& url)
// if a file matches the if below return false, it can't exist on a samba share.
if (!IsValidFile(url.GetFileName()))
{
CLog::Log(LOGNOTICE,"SMBFile->Open: Bad URL : '%s'",url.GetFileName().c_str());
CLog::Log(LOGNOTICE,"SMBFile->Open: Bad URL : '%s'",url.GetRedacted().c_str());
return false;
}
m_url = url;
Expand All @@ -344,7 +344,7 @@ bool CSMBFile::Open(const CURL& url)
std::string strFileName;
m_fd = OpenFile(url, strFileName);

CLog::Log(LOGDEBUG,"CSMBFile::Open - opened %s, fd=%d",url.GetFileName().c_str(), m_fd);
CLog::Log(LOGDEBUG,"CSMBFile::Open - opened %s, fd=%d",url.GetRedacted().c_str(), m_fd);
if (m_fd == -1)
{
// write error to logfile
Expand Down Expand Up @@ -605,7 +605,7 @@ bool CSMBFile::OpenForWrite(const CURL& url, bool bOverWrite)

if (bOverWrite)
{
CLog::Log(LOGWARNING, "SMBFile::OpenForWrite() called with overwriting enabled! - %s", strFileName.c_str());
CLog::Log(LOGWARNING, "SMBFile::OpenForWrite() called with overwriting enabled! - %s", CURL::GetRedacted(strFileName).c_str());
m_fd = smbc_creat(strFileName.c_str(), 0);
}
else
Expand All @@ -616,7 +616,7 @@ bool CSMBFile::OpenForWrite(const CURL& url, bool bOverWrite)
if (m_fd == -1)
{
// write error to logfile
CLog::Log(LOGERROR, "SMBFile->Open: Unable to open file : '%s'\nunix_err:'%x' error : '%s'", strFileName.c_str(), errno, strerror(errno));
CLog::Log(LOGERROR, "SMBFile->Open: Unable to open file : '%s'\nunix_err:'%x' error : '%s'", CURL::GetRedacted(strFileName).c_str(), errno, strerror(errno));
return false;
}

Expand Down

0 comments on commit cc12679

Please sign in to comment.