1
0
Fork 0
This commit is contained in:
jsteemann 2017-04-27 12:26:13 +02:00
parent cd377b0e0b
commit f94ef035cb
2 changed files with 9 additions and 4 deletions

View File

@ -345,7 +345,7 @@ HexHashResult AuthInfo::hexHashFromData(std::string const& hashMethod, char cons
}
if (crypted == nullptr ||
cryptedLength <= 0) {
cryptedLength == 0) {
delete[] crypted;
return HexHashResult(TRI_ERROR_OUT_OF_MEMORY);
}

View File

@ -54,8 +54,8 @@ enum class AuthSource {
class HexHashResult : public arangodb::Result {
public:
HexHashResult(int errorNumber) : Result(errorNumber) {}
HexHashResult(std::string const& hexHash) : Result(0), _hexHash(hexHash) {}
explicit HexHashResult(int errorNumber) : Result(errorNumber) {}
explicit HexHashResult(std::string const& hexHash) : Result(0), _hexHash(hexHash) {}
std::string const& hexHash() { return _hexHash; }
protected:
@ -64,7 +64,12 @@ class HexHashResult : public arangodb::Result {
class AuthEntry {
public:
AuthEntry() : _active(false), _mustChange(false), _allDatabases(AuthLevel::NONE) {}
AuthEntry()
: _active(false),
_mustChange(false),
_created(TRI_microtime()),
_source(AuthSource::COLLECTION),
_allDatabases(AuthLevel::NONE) {}
AuthEntry(std::string&& username, std::string&& passwordMethod,
std::string&& passwordSalt, std::string&& passwordHash,