Remove const specifier on call-by-value params 38/60338/4
authorKyungwook Tak <k.tak@samsung.com>
Thu, 25 Feb 2016 06:46:03 +0000 (15:46 +0900)
committerKyungwook Tak <k.tak@samsung.com>
Tue, 8 Mar 2016 11:02:29 +0000 (20:02 +0900)
Change-Id: I6c803f31a134223f62b4234d6cec9375acdb8193
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
14 files changed:
src/client/client-password-admin.cpp
src/client/client-password.cpp
src/include/auth-passwd-admin.h
src/include/auth-passwd.h
src/server/service/include/password-file.h
src/server/service/include/password-manager.h
src/server/service/include/password.h
src/server/service/include/policy-file.h
src/server/service/include/policy-manager.h
src/server/service/password-file.cpp
src/server/service/password-manager.cpp
src/server/service/password.cpp
src/server/service/policy-file.cpp
src/server/service/policy-manager.cpp

index d961c82ef03a19b1c1290167441dbc647d791aea..42fe8246902da26a8fc610069a572f47d66ff088 100644 (file)
@@ -45,8 +45,8 @@ inline bool isPasswordIncorrect(const char* pwd)
 } // namespace anonymous
 
 AUTH_PASSWD_API
-int auth_passwd_reset_passwd(const password_type passwd_type,
-                             const uid_t uid,
+int auth_passwd_reset_passwd(password_type passwd_type,
+                             uid_t uid,
                              const char *new_passwd)
 {
     using namespace AuthPasswd;
@@ -98,7 +98,7 @@ int auth_passwd_new_policy(policy_h **pp_policy)
 }
 
 AUTH_PASSWD_API
-int auth_passwd_set_user(policy_h *p_policy, const uid_t uid)
+int auth_passwd_set_user(policy_h *p_policy, uid_t uid)
 {
     if (!p_policy)
         return AUTH_PASSWD_API_ERROR_INPUT_PARAM;
@@ -109,7 +109,7 @@ int auth_passwd_set_user(policy_h *p_policy, const uid_t uid)
 }
 
 AUTH_PASSWD_API
-int auth_passwd_set_max_attempts(policy_h *p_policy, const unsigned int max_attempts)
+int auth_passwd_set_max_attempts(policy_h *p_policy, unsigned int max_attempts)
 {
     if (!p_policy)
         return AUTH_PASSWD_API_ERROR_INPUT_PARAM;
@@ -120,7 +120,7 @@ int auth_passwd_set_max_attempts(policy_h *p_policy, const unsigned int max_atte
 }
 
 AUTH_PASSWD_API
-int auth_passwd_set_validity(policy_h *p_policy, const unsigned int valid_days)
+int auth_passwd_set_validity(policy_h *p_policy, unsigned int valid_days)
 {
     if (!p_policy)
         return AUTH_PASSWD_API_ERROR_INPUT_PARAM;
@@ -131,7 +131,7 @@ int auth_passwd_set_validity(policy_h *p_policy, const unsigned int valid_days)
 }
 
 AUTH_PASSWD_API
-int auth_passwd_set_history_size(policy_h *p_policy, const unsigned int history_size)
+int auth_passwd_set_history_size(policy_h *p_policy, unsigned int history_size)
 {
     if (!p_policy)
         return AUTH_PASSWD_API_ERROR_INPUT_PARAM;
@@ -142,7 +142,7 @@ int auth_passwd_set_history_size(policy_h *p_policy, const unsigned int history_
 }
 
 AUTH_PASSWD_API
-int auth_passwd_set_min_length(policy_h *p_policy, const unsigned int min_length)
+int auth_passwd_set_min_length(policy_h *p_policy, unsigned int min_length)
 {
     if (!p_policy)
         return AUTH_PASSWD_API_ERROR_INPUT_PARAM;
@@ -153,8 +153,7 @@ int auth_passwd_set_min_length(policy_h *p_policy, const unsigned int min_length
 }
 
 AUTH_PASSWD_API
-int auth_passwd_set_minComplexCharNumber(policy_h *p_policy,
-                                         const unsigned int minComplexCharNumber)
+int auth_passwd_set_minComplexCharNumber(policy_h *p_policy, unsigned int minComplexCharNumber)
 {
     if (!p_policy)
         return AUTH_PASSWD_API_ERROR_INPUT_PARAM;
@@ -165,7 +164,7 @@ int auth_passwd_set_minComplexCharNumber(policy_h *p_policy,
 }
 
 AUTH_PASSWD_API
-int auth_passwd_set_maxCharOccurrences(policy_h *p_policy, const unsigned int maxCharOccurrences)
+int auth_passwd_set_maxCharOccurrences(policy_h *p_policy, unsigned int maxCharOccurrences)
 {
     if (!p_policy)
         return AUTH_PASSWD_API_ERROR_INPUT_PARAM;
@@ -176,7 +175,7 @@ int auth_passwd_set_maxCharOccurrences(policy_h *p_policy, const unsigned int ma
 }
 
 AUTH_PASSWD_API
-int auth_passwd_set_maxNumSeqLength(policy_h *p_policy, const unsigned int maxNumSeqLength)
+int auth_passwd_set_maxNumSeqLength(policy_h *p_policy, unsigned int maxNumSeqLength)
 {
     if (!p_policy)
         return AUTH_PASSWD_API_ERROR_INPUT_PARAM;
@@ -275,7 +274,7 @@ void auth_passwd_free_policy(policy_h *p_policy)
 }
 
 AUTH_PASSWD_API
-int auth_passwd_disable_policy(const uid_t uid)
+int auth_passwd_disable_policy(uid_t uid)
 {
     using namespace AuthPasswd;
 
index f49a5ac366bef0f2ac3fab0926d86ea200705866..3f85185ebf8b2558cb5975cf9ff4e2e30f0aa795 100644 (file)
@@ -48,7 +48,7 @@ inline bool isPasswordIncorrect(const char* passwd)
 } // namespace anonymous
 
 AUTH_PASSWD_API
-int auth_passwd_check_passwd(const password_type passwd_type,
+int auth_passwd_check_passwd(password_type passwd_type,
                              const char *passwd,
                              unsigned int *current_attempts,
                              unsigned int *max_attempts,
@@ -107,7 +107,7 @@ int auth_passwd_check_passwd(const password_type passwd_type,
 }
 
 AUTH_PASSWD_API
-int auth_passwd_check_passwd_state(const password_type passwd_type,
+int auth_passwd_check_passwd_state(password_type passwd_type,
                                    unsigned int *current_attempts,
                                    unsigned int *max_attempts,
                                    unsigned int *valid_secs)
@@ -150,7 +150,7 @@ int auth_passwd_check_passwd_state(const password_type passwd_type,
 }
 
 AUTH_PASSWD_API
-int auth_passwd_check_passwd_reused(const password_type passwd_type, 
+int auth_passwd_check_passwd_reused(password_type passwd_type, 
                                     const char *passwd,
                                     int *is_reused)
 {
@@ -185,7 +185,7 @@ int auth_passwd_check_passwd_reused(const password_type passwd_type,
 }
 
 AUTH_PASSWD_API
-int auth_passwd_set_passwd(const password_type passwd_type,
+int auth_passwd_set_passwd(password_type passwd_type,
                            const char *cur_passwd,
                            const char *new_passwd)
 {
index e2f9f6c14092b5ce60ad463f8a816a17f657cd0b..13c6931568d14aaa3c327ca0ff9345e9b2b30a24 100644 (file)
 extern "C" {
 #endif
 
-int auth_passwd_reset_passwd(const password_type passwd_type,
-                             const uid_t uid,
+int auth_passwd_reset_passwd(password_type passwd_type,
+                             uid_t uid,
                              const char *new_passwd);
 
 int auth_passwd_new_policy(policy_h **pp_policy);
 
-int auth_passwd_set_user(policy_h *p_policy, const uid_t uid);
+int auth_passwd_set_user(policy_h *p_policy, uid_t uid);
 
-int auth_passwd_set_max_attempts(policy_h *p_policy, const unsigned int max_attempts);
+int auth_passwd_set_max_attempts(policy_h *p_policy, unsigned int max_attempts);
 
-int auth_passwd_set_validity(policy_h *p_policy, const unsigned int valid_days);
+int auth_passwd_set_validity(policy_h *p_policy, unsigned int valid_days);
 
-int auth_passwd_set_history_size(policy_h *p_policy, const unsigned int history_size);
+int auth_passwd_set_history_size(policy_h *p_policy, unsigned int history_size);
 
-int auth_passwd_set_min_length(policy_h *p_policy, const unsigned int min_length);
+int auth_passwd_set_min_length(policy_h *p_policy, unsigned int min_length);
 
-int auth_passwd_set_minComplexCharNumber(policy_h *p_policy,
-                                         const unsigned int minComplexCharNumber);
+int auth_passwd_set_minComplexCharNumber(policy_h *p_policy, unsigned int minComplexCharNumber);
 
-int auth_passwd_set_maxCharOccurrences(policy_h *p_policy, const unsigned int maxCharOccurrences);
+int auth_passwd_set_maxCharOccurrences(policy_h *p_policy, unsigned int maxCharOccurrences);
 
-int auth_passwd_set_maxNumSeqLength(policy_h *p_policy, const unsigned int maxNumSeqLength);
+int auth_passwd_set_maxNumSeqLength(policy_h *p_policy, unsigned int maxNumSeqLength);
 
 int auth_passwd_set_quality(policy_h *p_policy, password_quality_type quality_type);
 
@@ -84,7 +83,7 @@ int auth_passwd_set_policy(policy_h *p_policy);
 
 void auth_passwd_free_policy(policy_h *p_policy);
 
-int auth_passwd_disable_policy(const uid_t uid);
+int auth_passwd_disable_policy(uid_t uid);
 
 #ifdef __cplusplus
 }
index 9ea70f9a14947962661075bd37df65807d6195e1..e9a520782decab903137edab806ea8f8d8f58d19 100644 (file)
 extern "C" {
 #endif
 
-int auth_passwd_check_passwd(const password_type passwd_type,
-                             const char *passwd, 
+int auth_passwd_check_passwd(password_type passwd_type,
+                             const char *passwd,
                              unsigned int *current_attempts,
                              unsigned int *max_attempts,
                              unsigned int *valid_secs);
 
-int auth_passwd_check_passwd_state(const password_type passwd_type, 
-                                   unsigned int *current_attempts, 
-                                   unsigned int *max_attempts, 
+int auth_passwd_check_passwd_state(password_type passwd_type,
+                                   unsigned int *current_attempts,
+                                   unsigned int *max_attempts,
                                    unsigned int *valid_secs);
 
-int auth_passwd_check_passwd_reused(const password_type passwd_type, 
-                                    const char *passwd, 
+int auth_passwd_check_passwd_reused(password_type passwd_type,
+                                    const char *passwd,
                                     int *is_reused);
 
-int auth_passwd_set_passwd(const password_type passwd_type,
+int auth_passwd_set_passwd(password_type passwd_type,
                            const char *cur_passwd,
                            const char *new_passwd);
 
-int auth_passwd_set_passwd_recovery(const char *cur_recovery_passwd, 
+int auth_passwd_set_passwd_recovery(const char *cur_recovery_passwd,
                                     const char *new_normal_passwd);
+
 #ifdef __cplusplus
 }
 #endif
index 1ab4fcb90af6b5378ad56be060488fce0ed6cc19..992e500626e6ea236d007275f93278079fd4eea9 100644 (file)
@@ -60,15 +60,15 @@ namespace AuthPasswd
     class PasswordFile
     {
     public:
-        PasswordFile(const unsigned int user);
+        PasswordFile(unsigned int user);
 
         void writeMemoryToFile() const;
         void writeAttemptToFile() const;
 
-        void setPassword(const unsigned int passwdType, const std::string &password);
-        bool checkPassword(const unsigned int passwdType, const std::string &password) const;
+        void setPassword(unsigned int passwdType, const std::string &password);
+        bool checkPassword(unsigned int passwdType, const std::string &password) const;
 
-        bool isPasswordActive(const unsigned int passwdType) const;
+        bool isPasswordActive(unsigned int passwdType) const;
 
         void setMaxHistorySize(unsigned int history);
         unsigned int getMaxHistorySize() const;
@@ -112,7 +112,7 @@ namespace AuthPasswd
         void resetState();
         bool fileExists(const std::string &filename) const;
         bool dirExists(const std::string &dirpath) const;
-        std::string createDir(const std::string &dir, const unsigned int user) const;
+        std::string createDir(const std::string &dir, unsigned int user) const;
 
         mutable TimePoint m_retryTimerStart;
 
index be1075d472cfda4a32b711c4b527f5aaa3288495..36dfc84d38afbe6c715b2f022ac7f45cd85499e5 100644 (file)
@@ -41,36 +41,36 @@ namespace AuthPasswd
 
         //checking functions
         //no const in checkPassword, attempts are update
-        int checkPassword(const unsigned int passwdType, const std::string &challenge,
-                          const unsigned int currentUser, unsigned int &currentAttempt,
+        int checkPassword(unsigned int passwdType, const std::string &challenge,
+                          unsigned int currentUser, unsigned int &currentAttempt,
                           unsigned int &maxAttempt, unsigned int &expirationTime);
-        int isPwdValid(const unsigned int passwdType, const unsigned int currentUser,
+        int isPwdValid(unsigned int passwdType, unsigned int currentUser,
                        unsigned int &currentAttempt, unsigned int &maxAttempt,
                        unsigned int &expirationTime);
-        int isPwdReused(const unsigned int passwdType, const std::string &passwd, 
-                        const unsigned int currentUser, bool &isReused);
+        int isPwdReused(unsigned int passwdType, const std::string &passwd,
+                        unsigned int currentUser, bool &isReused);
 
         //setting functions
-        int setPassword(const unsigned int passwdType, const std::string &currentPassword,
-                        const std::string &newPassword, const unsigned int currentUser);
+        int setPassword(unsigned int passwdType, const std::string &currentPassword,
+                        const std::string &newPassword, unsigned int currentUser);
         int setPasswordRecovery(const std::string &curRcvPassword, const std::string &newPassword,
-                        const unsigned int currentUser);
+                        unsigned int currentUser);
 
         //resetting functions
-        int resetPassword(const unsigned int passwdType, const std::string &newPassword,
-                          const unsigned int receivedUser);
+        int resetPassword(unsigned int passwdType, const std::string &newPassword,
+                          unsigned int receivedUser);
 
         //setting policy on the current passwd
-        void setPasswordMaxAttempts(const unsigned int receivedUser,
-                                   const unsigned int receivedAttempts);
-        void setPasswordValidity(const unsigned int receivedUser, const unsigned int receivedDays);
-        void setPasswordHistory(const unsigned int receivedUser, const unsigned int receivedHistory);
+        void setPasswordMaxAttempts(unsigned int receivedUser,
+                                   unsigned int receivedAttempts);
+        void setPasswordValidity(unsigned int receivedUser, unsigned int receivedDays);
+        void setPasswordHistory(unsigned int receivedUser, unsigned int receivedHistory);
 
     private:
         //managing functions
-        void addPassword(const unsigned int user);
-        void removePassword(const unsigned int user);
-        void existPassword(const unsigned int user);
+        void addPassword(unsigned int user);
+        void removePassword(unsigned int user);
+        void existPassword(unsigned int user);
 
         PasswordFileMap m_pwdFile;
     };
index 9063e078954ba742b6d9d04fa1f7e4ce25fbdcb2..1abccb9f7ac1becd3b30735a14c4cb803fef482a 100644 (file)
@@ -72,10 +72,10 @@ namespace AuthPasswd
         //internal service functions
         bool processOne(const ConnectionID &conn, MessageBuffer &buffer, InterfaceID interfaceID);
         int processCheckFunctions(PasswordHdrs hdr, MessageBuffer& buffer,
-                                  const unsigned int cur_user, unsigned int &cur_att,
+                                  unsigned int cur_user, unsigned int &cur_att,
                                   unsigned int &max_att, unsigned int &exp_time);
         int processSetFunctions(PasswordHdrs hdr, MessageBuffer& buffer,
-                                const unsigned int cur_user, bool &isPwdReused);
+                                unsigned int cur_user, bool &isPwdReused);
         int processResetFunctions(PasswordHdrs hdr, MessageBuffer& buffer);
         int processPolicyFunctions(PasswordHdrs hdr, MessageBuffer& buffer);
 
index f258f47b7b2df69ca6d65710968d1838fdecab14..bb1834d33673366232429224f924d7bb9513ba94 100644 (file)
@@ -36,7 +36,7 @@ namespace AuthPasswd
     class PolicyFile
     {
     public:
-        PolicyFile(const unsigned int user);
+        PolicyFile(unsigned int user);
 
         void enable();
         void disable();
@@ -73,7 +73,7 @@ namespace AuthPasswd
         void resetState();
         bool fileExists(const std::string &filename) const;
         bool dirExists(const std::string &dirpath) const;
-        std::string createDir(const std::string &dir, const unsigned int user) const;
+        std::string createDir(const std::string &dir, unsigned int user) const;
 
         //user name
         unsigned int m_user;
index c83b811b7992247c4747493f0e59e1e0c904eb6d..c2e0a7525b9fb9b72fed7918c6565dc6a47cbadb 100644 (file)
@@ -40,22 +40,22 @@ namespace AuthPasswd
         typedef std::map<unsigned int, PolicyFile> PolicyFileMap;
 
         // policy checking functions
-        int checkPolicy(const unsigned int passwdType,
+        int checkPolicy(unsigned int passwdType,
                         const std::string &currentPassword,
                         const std::string &newPassword,
-                        const unsigned int user);
+                        unsigned int user);
 
         // policy setting functions
-        int setPolicy(const auth_password_policy policy);
+        int setPolicy(auth_password_policy policy);
 
         // policy disabling functions
-        int disablePolicy(const unsigned int user);
+        int disablePolicy(unsigned int user);
 
     private:
         // managing functions
-        void addPolicy(const unsigned int user);
-        void removePolicy(const unsigned int user);
-        void existPolicy(const unsigned int user);
+        void addPolicy(unsigned int user);
+        void removePolicy(unsigned int user);
+        void existPolicy(unsigned int user);
 
         PolicyFileMap m_policyFile;
     };
index a493d54cafa59e38755ab9d38f275450d8ef78c4..359f3c9670dc27af57c54cf7c489505e887c2323 100644 (file)
@@ -137,7 +137,7 @@ namespace AuthPasswd
         }
     }
 
-    PasswordFile::PasswordFile(const unsigned int user): m_user(user),
+    PasswordFile::PasswordFile(unsigned int user): m_user(user),
                                   m_passwordCurrent(new NoPassword()),
                                   m_passwordRecovery(new NoPassword()),
                                   m_maxAttempt(PASSWORD_INFINITE_ATTEMPT_COUNT),
@@ -265,7 +265,7 @@ namespace AuthPasswd
         return ((stat(dirpath.c_str(), &buf) == 0) && (((buf.st_mode) & S_IFMT) == S_IFDIR));
     }
 
-    std::string PasswordFile::createDir(const std::string &dir, const unsigned int user) const
+    std::string PasswordFile::createDir(const std::string &dir, unsigned int user) const
     {
         std::string User = std::to_string(user);
         return dir + "/" + User;
@@ -424,7 +424,7 @@ namespace AuthPasswd
         AttemptFile.close();
     }
 
-    bool PasswordFile::isPasswordActive(const unsigned int passwdType) const
+    bool PasswordFile::isPasswordActive(unsigned int passwdType) const
     {
         bool ret = false;
 
@@ -495,7 +495,7 @@ namespace AuthPasswd
         return false;
     }
 
-    void PasswordFile::setPassword(const unsigned int passwdType, const std::string &password)
+    void PasswordFile::setPassword(unsigned int passwdType, const std::string &password)
     {
         if (passwdType == AUTH_PWD_NORMAL) {
             //replace current password with new one
@@ -525,7 +525,7 @@ namespace AuthPasswd
         }
     }
 
-    bool PasswordFile::checkPassword(const unsigned int passwdType, const std::string &password) const
+    bool PasswordFile::checkPassword(unsigned int passwdType, const std::string &password) const
     {
         bool ret = false;
         if (passwdType == AUTH_PWD_NORMAL)
index 8c1bd91d0d13ca5f03f58e3245b0874a9ad651f1..9d528dc07d9e8cddddd3036359098944fd9b91df 100644 (file)
@@ -56,17 +56,17 @@ namespace {
 
 namespace AuthPasswd
 {
-    void PasswordManager::addPassword(const unsigned int user)
+    void PasswordManager::addPassword(unsigned int user)
     {
         m_pwdFile.insert(PasswordFileMap::value_type(user, PasswordFile(user)));
     }
 
-    void PasswordManager::removePassword(const unsigned int user)
+    void PasswordManager::removePassword(unsigned int user)
     {
         m_pwdFile.erase(user);
     }
 
-    void PasswordManager::existPassword(const unsigned int user)
+    void PasswordManager::existPassword(unsigned int user)
     {
         PasswordFileMap::iterator itPwd = m_pwdFile.find(user);
         if (itPwd != m_pwdFile.end())
@@ -76,9 +76,9 @@ namespace AuthPasswd
         return;
     }
 
-    int PasswordManager::checkPassword(const unsigned int passwdType,
+    int PasswordManager::checkPassword(unsigned int passwdType,
                                        const std::string &challenge,
-                                       const unsigned int currentUser,
+                                       unsigned int currentUser,
                                        unsigned int &currentAttempt,
                                        unsigned int &maxAttempt,
                                        unsigned int &expirationTime)
@@ -141,7 +141,7 @@ namespace AuthPasswd
         return AUTH_PASSWD_API_SUCCESS;
     }
 
-    int PasswordManager::isPwdValid(const unsigned int passwdType, const unsigned int currentUser,
+    int PasswordManager::isPwdValid(unsigned int passwdType, unsigned int currentUser,
                                     unsigned int &currentAttempt, unsigned int &maxAttempt,
                                     unsigned int &expirationTime)
     {
@@ -174,8 +174,8 @@ namespace AuthPasswd
         return AUTH_PASSWD_API_SUCCESS;
     }
 
-    int PasswordManager::isPwdReused(const unsigned int passwdType, const std::string &passwd,
-                                     const unsigned int currentUser, bool &isReused)
+    int PasswordManager::isPwdReused(unsigned int passwdType, const std::string &passwd,
+                                     unsigned int currentUser, bool &isReused)
     {
         existPassword(currentUser);
         PasswordFileMap::iterator itPwd = m_pwdFile.find(currentUser);
@@ -195,14 +195,14 @@ namespace AuthPasswd
             default:
                 LogError("Not supported password type.");
                 return AUTH_PASSWD_API_ERROR_INPUT_PARAM;
-        } 
+        }
         return AUTH_PASSWD_API_SUCCESS;
     }
 
-    int PasswordManager::setPassword(const unsigned int passwdType,
+    int PasswordManager::setPassword(unsigned int passwdType,
                                      const std::string &currentPassword,
                                      const std::string &newPassword,
-                                     const unsigned int currentUser)
+                                     unsigned int currentUser)
     {
         LogSecureDebug("curUser = " << currentUser << ", pwdType = " << passwdType <<
                        ", curPwd = " << currentPassword << ", newPwd = " << newPassword);
@@ -283,7 +283,7 @@ namespace AuthPasswd
 
     int PasswordManager::setPasswordRecovery(const std::string &curRcvPassword,
                                              const std::string &newPassword,
-                                             const unsigned int currentUser)
+                                             unsigned int currentUser)
     {
         LogSecureDebug("curUser = " << currentUser << ", curPwd = " << curRcvPassword <<
                        ", newPwd = " << newPassword);
@@ -343,9 +343,9 @@ namespace AuthPasswd
         return AUTH_PASSWD_API_SUCCESS;
     }
 
-    int PasswordManager::resetPassword(const unsigned int passwdType,
+    int PasswordManager::resetPassword(unsigned int passwdType,
                                        const std::string &newPassword,
-                                       const unsigned int receivedUser)
+                                       unsigned int receivedUser)
     {
         unsigned int receivedDays = PASSWORD_INFINITE_EXPIRATION_DAYS;
         time_t valid_secs = 0;
@@ -381,8 +381,8 @@ namespace AuthPasswd
         return AUTH_PASSWD_API_SUCCESS;
     }
 
-    void PasswordManager::setPasswordMaxAttempts(const unsigned int receivedUser,
-                                                const unsigned int receivedAttempts)
+    void PasswordManager::setPasswordMaxAttempts(unsigned int receivedUser,
+                                                unsigned int receivedAttempts)
     {
         LogSecureDebug("received_attempts: " << receivedAttempts);
 
@@ -396,8 +396,8 @@ namespace AuthPasswd
         itPwd->second.writeAttemptToFile();
     }
 
-    void PasswordManager::setPasswordValidity(const unsigned int receivedUser,
-                                             const unsigned int receivedDays)
+    void PasswordManager::setPasswordValidity(unsigned int receivedUser,
+                                             unsigned int receivedDays)
     {
         LogSecureDebug("received_days: " << receivedDays);
 
@@ -415,8 +415,8 @@ namespace AuthPasswd
         itPwd->second.writeMemoryToFile();
     }
 
-    void PasswordManager::setPasswordHistory(const unsigned int receivedUser,
-                                            const unsigned int receivedHistory)
+    void PasswordManager::setPasswordHistory(unsigned int receivedUser,
+                                            unsigned int receivedHistory)
     {
         LogSecureDebug("received_historySize: " << receivedHistory);
 
index 2c0ebdec9fd329afea3f2589c95ab182c261fde4..493d266b898ee27af489b5f3727a807bb2cb386e 100644 (file)
@@ -115,7 +115,7 @@ void PasswordService::close(const CloseEvent &event)
 }
 
 int PasswordService::processCheckFunctions(PasswordHdrs hdr, MessageBuffer& buffer,
-                                           const unsigned int cur_user, unsigned int &cur_att,
+                                           unsigned int cur_user, unsigned int &cur_att,
                                            unsigned int &max_att, unsigned int &exp_time)
 {
     int result = AUTH_PASSWD_API_ERROR_SERVER_ERROR;
@@ -146,7 +146,7 @@ int PasswordService::processCheckFunctions(PasswordHdrs hdr, MessageBuffer& buff
 }
 
 int PasswordService::processSetFunctions(PasswordHdrs hdr, MessageBuffer& buffer,
-                                         const unsigned int cur_user, bool &isPwdReused)
+                                         unsigned int cur_user, bool &isPwdReused)
 {
     int result = AUTH_PASSWD_API_ERROR_SERVER_ERROR;
 
index 9e2bfd14ad3c6e8c422f79bc06471478de27a2df..b02ee5a8b47d30b3bdbfce3975264a6a90d7068a 100644 (file)
@@ -51,7 +51,7 @@ namespace {
 
 namespace AuthPasswd
 {
-    PolicyFile::PolicyFile(const unsigned int user): m_user(user),
+    PolicyFile::PolicyFile(unsigned int user): m_user(user),
                                 m_enable(false),
                                 m_minLength(0),
                                 m_minComplexCharNumber(0),
@@ -129,7 +129,7 @@ namespace AuthPasswd
         return ((stat(dirpath.c_str(), &buf) == 0) && (((buf.st_mode) & S_IFMT) == S_IFDIR));
     }
 
-    std::string PolicyFile::createDir(const std::string &dir, const unsigned int user) const
+    std::string PolicyFile::createDir(const std::string &dir, unsigned int user) const
     {
         std::string User = std::to_string(user);
         return dir + "/" + User;
index e206b1406149b14917edaaae639a2bd4804062f3..f3a7ca0e5632760f6672a1e7c34b1601de5b42b9 100644 (file)
 
 namespace AuthPasswd
 {
-
-    void PolicyManager::addPolicy(const unsigned int user)
+    void PolicyManager::addPolicy(unsigned int user)
     {
         m_policyFile.insert(PolicyFileMap::value_type(user, PolicyFile(user)));
     }
 
-    void PolicyManager::removePolicy(const unsigned int user)
+    void PolicyManager::removePolicy(unsigned int user)
     {
         m_policyFile.erase(user);
     }
 
-    void PolicyManager::existPolicy(const unsigned int user)
+    void PolicyManager::existPolicy(unsigned int user)
     {
         PolicyFileMap::iterator itPwd = m_policyFile.find(user);
         if (itPwd != m_policyFile.end())
@@ -58,10 +57,10 @@ namespace AuthPasswd
         return;
     }
 
-    int PolicyManager::checkPolicy(const unsigned int passwdType,
+    int PolicyManager::checkPolicy(unsigned int passwdType,
                                    const std::string &currentPassword,
                                    const std::string &newPassword,
-                                   const unsigned int user)
+                                   unsigned int user)
     {
         LogSecureDebug("Inside checkPolicy function.");
 
@@ -113,7 +112,7 @@ namespace AuthPasswd
         return AUTH_PASSWD_API_SUCCESS;
     }
 
-    int PolicyManager::setPolicy(const auth_password_policy policy)
+    int PolicyManager::setPolicy(auth_password_policy policy)
     {
         LogSecureDebug("Inside setPolicy function.");
 
@@ -258,7 +257,7 @@ namespace AuthPasswd
         return AUTH_PASSWD_API_SUCCESS;
     }
 
-    int PolicyManager::disablePolicy(const unsigned int user)
+    int PolicyManager::disablePolicy(unsigned int user)
     {
         LogSecureDebug("Inside disablePolicy function.");