@@ -131,7 +131,7 @@ bool PasswdFile::check_at_least_one_user_with_host_and_port(const std::string& h
131131
132132std::string PasswdFile::get_passwd (const std::string& user, const std::string& host, const std::string& port) {
133133#ifdef DEBUG_ME
134- cout << " PasswdFile::get_passwd user(" << user << " ) host(" << host << " ) port(" << port << " )\n " ;
134+ std:: cout << " PasswdFile::get_passwd user(" << user << " ) host(" << host << " ) port(" << port << " )\n " ;
135135#endif
136136 size_t vec_size = vec_.size ();
137137 for (size_t i = 0 ; i < vec_size; i++) {
@@ -144,22 +144,22 @@ std::string PasswdFile::get_passwd(const std::string& user, const std::string& h
144144
145145bool PasswdFile::authenticate (const std::string& user, const std::string& passwd) const {
146146#ifdef DEBUG_ME
147- cout << " PasswdFile::authenticate user:" << user << " passwd:" << passwd << " file:" << passwd_file_
148- << " vec_.size(): " << vec_.size () << " \n " ;
149- cout << dump () << " \n " ;
147+ std:: cout << " PasswdFile::authenticate user:" << user << " passwd: <omitted> file:" << passwd_file_
148+ << " vec_.size(): " << vec_.size () << " \n " ;
149+ std:: cout << dump () << " \n " ;
150150#endif
151151
152152 if (user.empty ()) {
153153#ifdef DEBUG_ME
154- cout << " PasswdFile::authenticate: user empty: FAIL\n " ;
154+ std:: cout << " PasswdFile::authenticate: user empty: FAIL\n " ;
155155#endif
156156 return false ;
157157 }
158158
159159 // no password specified, and password file is empty
160160 if (passwd.empty () && vec_.empty ()) {
161161#ifdef DEBUG_ME
162- cout << " PasswdFile::authenticate no password and password file empty: PASS\n " ;
162+ std:: cout << " PasswdFile::authenticate no password and password file empty: PASS\n " ;
163163#endif
164164 return true ;
165165 }
@@ -170,13 +170,13 @@ bool PasswdFile::authenticate(const std::string& user, const std::string& passwd
170170 if (vec_[i].user () == user) {
171171 if (vec_[i].passwd () == passwd) {
172172#ifdef DEBUG_ME
173- cout << " PasswdFile::authenticate user and password match: PASS\n " ;
173+ std:: cout << " PasswdFile::authenticate user and password match: PASS\n " ;
174174#endif
175175 return true ;
176176 }
177177 else {
178178#ifdef DEBUG_ME
179- cout << " PasswdFile::authenticate: user found but passwd did not match: FAIL\n " ;
179+ std:: cout << " PasswdFile::authenticate: user found but passwd did not match: FAIL\n " ;
180180#endif
181181 return false ;
182182 }
@@ -188,21 +188,22 @@ bool PasswdFile::authenticate(const std::string& user, const std::string& passwd
188188 // User not found, but if passwd is not empty, then fail.
189189 if (!passwd.empty ()) {
190190#ifdef DEBUG_ME
191- cout << " PasswdFile::authenticate: user NOT found, passwd is NOT EMPTY: FAIL\n " ;
191+ std:: cout << " PasswdFile::authenticate: user NOT found, passwd is NOT EMPTY: FAIL\n " ;
192192#endif
193193 return false ;
194194 }
195195
196196 // Server has a password file, but user not found and passwd is empty.
197197 if (vec_.empty ()) {
198198#ifdef DEBUG_ME
199- cout << " PasswdFile::authenticate: true, user NOT found, and passwd EMPTY, and password file EMPTY\n " ;
199+ std::cout
200+ << " PasswdFile::authenticate: true, user NOT found, and passwd EMPTY, and password file EMPTY\n " ;
200201#endif
201202 return true ;
202203 }
203204
204205#ifdef DEBUG_ME
205- cout << " PasswdFile::authenticate false, user NOT found, and passwd EMPTY\n " ;
206+ std:: cout << " PasswdFile::authenticate false, user NOT found, and passwd EMPTY\n " ;
206207#endif
207208 return false ;
208209}
0 commit comments