Fix a bug that text log in userspace can't contain blanks 14/156714/1
authorSungbae <sungbae.yoo@samsung.com>
Thu, 19 Oct 2017 14:24:12 +0000 (23:24 +0900)
committerSungbae <sungbae.yoo@samsung.com>
Thu, 19 Oct 2017 14:24:34 +0000 (23:24 +0900)
Signed-off-by: Sungbae <sungbae.yoo@samsung.com>
Change-Id: Ic7eb5f16cbc07c2fc34aa0f6c6620636e6728baa

server/user.cpp

index f74786f75b7064ad5200d6daeea39cbdb5dca867..405e3d18224081417622fc19d1514101e3c2b34e 100644 (file)
@@ -45,8 +45,13 @@ User::AuditTrail convertLog(int type, const std::string &log)
                std::string item = word.substr(0, equal);
                std::string value = word.substr(equal + 1);
 
-               if (item == "msg")
+               if (item == "msg") {
+                       if (value[value.size() - 1] != '\'') {
+                               getline(tok, word, '\'');
+                               value += " " + word + '\'';
+                       }
                        msg = value.substr(1, value.size() - 2);
+               }
        }
 
        // TODO : If the format given by user access control is specified,