diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-08-05 19:06:01 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-08-05 19:06:01 +0200 |
commit | 0acf7bbbbb822f1259cf1e3211e5e79724be6bf7 (patch) | |
tree | 8c7b08b5862642e872bf0d19ff1ba836c4761ef0 /lib/Utils | |
parent | 8336bbee624aa84b485e3f6b0984bce04b52e61d (diff) | |
download | abrt-0acf7bbbbb822f1259cf1e3211e5e79724be6bf7.tar.gz abrt-0acf7bbbbb822f1259cf1e3211e5e79724be6bf7.tar.xz abrt-0acf7bbbbb822f1259cf1e3211e5e79724be6bf7.zip |
CDebugDump::Create(pDir, pUID): make 2nd param uid_t, not string
Diffstat (limited to 'lib/Utils')
-rw-r--r-- | lib/Utils/DebugDump.cpp | 5 | ||||
-rw-r--r-- | lib/Utils/DebugDump.h | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/Utils/DebugDump.cpp b/lib/Utils/DebugDump.cpp index fe62280c..f63a8c6b 100644 --- a/lib/Utils/DebugDump.cpp +++ b/lib/Utils/DebugDump.cpp @@ -183,7 +183,7 @@ void CDebugDump::UnLock() } } -void CDebugDump::Create(const std::string& pDir, const std::string& pUID) +void CDebugDump::Create(const std::string& pDir, uid_t uid) { if (m_bOpened) { @@ -211,7 +211,6 @@ void CDebugDump::Create(const std::string& pDir, const std::string& pUID) m_bOpened = false; throw CABRTException(EXCEP_DD_OPEN, "CDebugDump::Create(): Cannot change permissions, dir: " + pDir); } - uid_t uid = atoi(pUID.c_str()); struct passwd* pw = getpwuid(uid); gid_t gid = pw ? pw->pw_gid : uid; if (chown(m_sDebugDumpDir.c_str(), uid, gid) == -1) @@ -221,7 +220,7 @@ void CDebugDump::Create(const std::string& pDir, const std::string& pUID) perror_msg("can't change '%s' ownership to %u:%u", m_sDebugDumpDir.c_str(), (int)uid, (int)gid); } - SaveText(FILENAME_UID, pUID); + SaveText(FILENAME_UID, ssprintf("%u", (int)uid)); SaveKernelArchitectureRelease(); SaveTime(); } diff --git a/lib/Utils/DebugDump.h b/lib/Utils/DebugDump.h index 65cc7609..1bd8cc7b 100644 --- a/lib/Utils/DebugDump.h +++ b/lib/Utils/DebugDump.h @@ -57,7 +57,7 @@ class CDebugDump public: CDebugDump(); void Open(const std::string& pDir); - void Create(const std::string& pDir, const std::string& pUID); + void Create(const std::string& pDir, uid_t pUID); void Delete(); void Close(); |