diff --git a/src/launcher/booster.cpp b/src/launcher/booster.cpp index 3d00ff3..723c23f 100644 --- a/src/launcher/booster.cpp +++ b/src/launcher/booster.cpp @@ -32,7 +32,7 @@ #ifdef HAVE_CREDS #include - QVector Booster::m_extraCreds; + CredsList Booster::m_extraCreds; const char * const Booster::m_strCreds[] = { "applauncherd-launcher::access", @@ -52,11 +52,8 @@ Booster::Booster() : Booster::~Booster() { - if (m_conn != NULL) - { - delete m_conn; - m_conn = NULL; - } + delete m_conn; + m_conn = NULL; } bool Booster::preload() @@ -381,22 +378,23 @@ int Booster::pipeFd(bool whichEnd) const void Booster::initExtraCreds() { - for (unsigned int i = 0; i < sizeof(m_strCreds)/sizeof(char*); i++) + // Convert string-formatted credentials into + // "binary"-formatted credentials + + unsigned int numCreds = sizeof(m_strCreds) / sizeof(char*); + for (unsigned int i = 0; i < numCreds; i++) { creds_value_t value; creds_value_t ret = creds_str2creds(m_strCreds[i], &value); if (ret != CREDS_BAD) - { - BinCreds pair(ret, value); - m_extraCreds.append(pair); - } + m_extraCreds.push_back(BinCredsPair(ret, value)); } } void Booster::filterOutCreds(creds_t creds) { - for(int i = 0; i < m_extraCreds.size(); i++) + for(unsigned int i = 0; i < m_extraCreds.size(); i++) { creds_sub(creds, m_extraCreds[i].first, m_extraCreds[i].second); } diff --git a/src/launcher/booster.h b/src/launcher/booster.h index d8266c7..149f62d 100644 --- a/src/launcher/booster.h +++ b/src/launcher/booster.h @@ -31,10 +31,12 @@ class Connection; #ifdef HAVE_CREDS #include - #include - #include + #include + #include - typedef QPair BinCreds; + // Storage types for "binary"-formatted credentials + typedef std::pair BinCredsPair; + typedef std::vector CredsList; #endif @@ -173,7 +175,6 @@ private: //! Helper method: load the library and find out address for "main". void* loadMain(); - //! Size (length) of the argument vector int m_argvArraySize; @@ -193,7 +194,7 @@ private: //! set of credentials to be filtered out of credentials //! inhereted from invoker process - static QVector m_extraCreds; + static CredsList m_extraCreds; //! str array of creds to filter out static const char * const m_strCreds[];