diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2009-09-27 19:58:24 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2009-09-27 19:58:24 +0200 |
commit | b40ba0cf91603b695f1f2380cbd39966a458f22f (patch) | |
tree | 1fec48ddc59eb1392fac38495b230e4b2cbf7528 /src/modules/UserConfigBackendKrb5 | |
parent | e1d8490f0654a3da0b900407d80d91d8d0da68c8 (diff) | |
download | mad-b40ba0cf91603b695f1f2380cbd39966a458f22f.tar mad-b40ba0cf91603b695f1f2380cbd39966a458f22f.zip |
Use Unicode-aware String class instead of std::string
Diffstat (limited to 'src/modules/UserConfigBackendKrb5')
-rw-r--r-- | src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.cpp b/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.cpp index 475a689..7d53e55 100644 --- a/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.cpp +++ b/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.cpp @@ -133,7 +133,9 @@ void UserConfigBackendKrb5::configFinished() { void UserConfigBackendKrb5::checkUserInfo(const Common::UserInfo &userInfo) throw(Core::Exception) { - if(std::strcspn(userInfo.getUsername().c_str(), "/@") != userInfo.getUsername().length()) + std::string username = userInfo.getUsername().extract(); + + if(std::strcspn(username.c_str(), "/@") != username.length()) throw Core::Exception(Core::Exception::INVALID_INPUT); } @@ -145,7 +147,7 @@ void UserConfigBackendKrb5::addUser(const Common::UserInfo &userInfo) throw(Core if(!context || !handle) throw Core::Exception(Core::Exception::NOT_AVAILABLE); - std::string princStr = userInfo.getUsername() + "@" + realm; + std::string princStr = userInfo.getUsername().extract() + "@" + realm; kadm5_principal_ent_rec princ; @@ -228,7 +230,7 @@ void UserConfigBackendKrb5::deleteUser(const Common::UserInfo &userInfo) throw(C if(!context || !handle) throw Core::Exception(Core::Exception::NOT_AVAILABLE); - std::string princStr = userInfo.getUsername() + "@" + realm; + std::string princStr = userInfo.getUsername().extract() + "@" + realm; krb5_principal princ; krb5_error_code err = krb5_parse_name(context, princStr.c_str(), &princ); @@ -261,7 +263,7 @@ void UserConfigBackendKrb5::setPassword(const Common::UserInfo &userInfo, const if(!context || !handle) throw Core::Exception(Core::Exception::NOT_AVAILABLE); - std::string princStr = userInfo.getUsername() + "@" + realm; + std::string princStr = userInfo.getUsername().extract() + "@" + realm; krb5_principal princ; krb5_error_code err = krb5_parse_name(context, princStr.c_str(), &princ); |