alt.cpp (Firebird-3.0.2.32703-0.tar.bz2) | : | alt.cpp (Firebird-3.0.4.33054-0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 862 | skipping to change at line 862 | |||
* Functional description | * Functional description | |||
* Adds a user to the server's security | * Adds a user to the server's security | |||
* database. | * database. | |||
* Return 0 if the user was added | * Return 0 if the user was added | |||
* | * | |||
* Return > 0 if any error occurs. | * Return > 0 if any error occurs. | |||
* | * | |||
**************************************/ | **************************************/ | |||
Auth::StackUserData userInfo; | Auth::StackUserData userInfo; | |||
userInfo.op = Auth::ADD_OPER; | userInfo.op = Auth::ADD_OPER; | |||
Firebird::string work; | ||||
Firebird::LocalStatus s; | Firebird::LocalStatus s; | |||
Firebird::CheckStatusWrapper statusWrapper(&s); | Firebird::CheckStatusWrapper statusWrapper(&s); | |||
if (input_user_data->user_name) | if (input_user_data->user_name) | |||
{ | { | |||
work = input_user_data->user_name; | Firebird::string work = input_user_data->user_name; | |||
if (work.length() > USERNAME_LENGTH) { | if (work.length() > USERNAME_LENGTH) { | |||
return user_error(status, isc_usrname_too_long); | return user_error(status, isc_usrname_too_long); | |||
} | } | |||
Firebird::string::size_type l = work.find(' '); | Firebird::string::size_type l = work.find(' '); | |||
if (l != Firebird::string::npos) { | if (l != Firebird::string::npos) { | |||
work.resize(l); | work.resize(l); | |||
} | } | |||
userInfo.user.set(&statusWrapper, work.c_str()); | userInfo.user.set(&statusWrapper, work.c_str()); | |||
Firebird::check(&statusWrapper); | Firebird::check(&statusWrapper); | |||
userInfo.user.setEntered(&statusWrapper, 1); | userInfo.user.setEntered(&statusWrapper, 1); | |||
Firebird::check(&statusWrapper); | Firebird::check(&statusWrapper); | |||
} | } | |||
else { | else { | |||
return user_error(status, isc_usrname_required); | return user_error(status, isc_usrname_required); | |||
} | } | |||
if (input_user_data->password) | if (input_user_data->password) | |||
{ | { | |||
/* | userInfo.pass.set(&statusWrapper, input_user_data->password); | |||
if (strlen(input_user_data->password) > 8) { | ||||
return user_error(status, isc_password_too_long); | ||||
} | ||||
*/ | ||||
Firebird::string::size_type l = work.find(' '); | ||||
if (l != Firebird::string::npos) { | ||||
work.resize(l); | ||||
} | ||||
userInfo.pass.set(&statusWrapper, work.c_str()); | ||||
Firebird::check(&statusWrapper); | Firebird::check(&statusWrapper); | |||
userInfo.pass.setEntered(&statusWrapper, 1); | userInfo.pass.setEntered(&statusWrapper, 1); | |||
Firebird::check(&statusWrapper); | Firebird::check(&statusWrapper); | |||
} | } | |||
else { | else { | |||
return user_error(status, isc_password_required); | return user_error(status, isc_password_required); | |||
} | } | |||
copyField(userInfo.u, input_user_data->uid, input_user_data->sec_flags & sec_uid_spec); | copyField(userInfo.u, input_user_data->uid, input_user_data->sec_flags & sec_uid_spec); | |||
copyField(userInfo.g, input_user_data->gid, input_user_data->sec_flags & sec_gid_spec); | copyField(userInfo.g, input_user_data->gid, input_user_data->sec_flags & sec_gid_spec); | |||
skipping to change at line 937 | skipping to change at line 925 | |||
* Functional description | * Functional description | |||
* Deletes a user from the server's security | * Deletes a user from the server's security | |||
* database. | * database. | |||
* Return 0 if the user was deleted | * Return 0 if the user was deleted | |||
* | * | |||
* Return > 0 if any error occurs. | * Return > 0 if any error occurs. | |||
* | * | |||
**************************************/ | **************************************/ | |||
Auth::StackUserData userInfo; | Auth::StackUserData userInfo; | |||
userInfo.op = Auth::DEL_OPER; | userInfo.op = Auth::DEL_OPER; | |||
Firebird::string work; | ||||
Firebird::LocalStatus s; | Firebird::LocalStatus s; | |||
Firebird::CheckStatusWrapper statusWrapper(&s); | Firebird::CheckStatusWrapper statusWrapper(&s); | |||
if (input_user_data->user_name) | if (input_user_data->user_name) | |||
{ | { | |||
work = input_user_data->user_name; | Firebird::string work = input_user_data->user_name; | |||
if (work.length() > USERNAME_LENGTH) { | if (work.length() > USERNAME_LENGTH) { | |||
return user_error(status, isc_usrname_too_long); | return user_error(status, isc_usrname_too_long); | |||
} | } | |||
Firebird::string::size_type l = work.find(' '); | Firebird::string::size_type l = work.find(' '); | |||
if (l != Firebird::string::npos) { | if (l != Firebird::string::npos) { | |||
work.resize(l); | work.resize(l); | |||
} | } | |||
userInfo.user.set(&statusWrapper, work.c_str()); | userInfo.user.set(&statusWrapper, work.c_str()); | |||
skipping to change at line 983 | skipping to change at line 970 | |||
* Functional description | * Functional description | |||
* Adds a user to the server's security | * Adds a user to the server's security | |||
* database. | * database. | |||
* Return 0 if the user was added | * Return 0 if the user was added | |||
* | * | |||
* Return > 0 if any error occurs. | * Return > 0 if any error occurs. | |||
* | * | |||
**************************************/ | **************************************/ | |||
Auth::StackUserData userInfo; | Auth::StackUserData userInfo; | |||
userInfo.op = Auth::MOD_OPER; | userInfo.op = Auth::MOD_OPER; | |||
Firebird::string work; | ||||
Firebird::LocalStatus s; | Firebird::LocalStatus s; | |||
Firebird::CheckStatusWrapper statusWrapper(&s); | Firebird::CheckStatusWrapper statusWrapper(&s); | |||
if (input_user_data->user_name) | if (input_user_data->user_name) | |||
{ | { | |||
work = input_user_data->user_name; | Firebird::string work = input_user_data->user_name; | |||
if (work.length() > USERNAME_LENGTH) { | if (work.length() > USERNAME_LENGTH) { | |||
return user_error(status, isc_usrname_too_long); | return user_error(status, isc_usrname_too_long); | |||
} | } | |||
Firebird::string::size_type l = work.find(' '); | Firebird::string::size_type l = work.find(' '); | |||
if (l != Firebird::string::npos) { | if (l != Firebird::string::npos) { | |||
work.resize(l); | work.resize(l); | |||
} | } | |||
userInfo.user.set(&statusWrapper, work.c_str()); | userInfo.user.set(&statusWrapper, work.c_str()); | |||
check(&statusWrapper); | check(&statusWrapper); | |||
userInfo.user.setEntered(&statusWrapper, 1); | userInfo.user.setEntered(&statusWrapper, 1); | |||
check(&statusWrapper); | check(&statusWrapper); | |||
} | } | |||
else { | else { | |||
return user_error(status, isc_usrname_required); | return user_error(status, isc_usrname_required); | |||
} | } | |||
if (input_user_data->password) | if (input_user_data->password) | |||
{ | { | |||
/* | userInfo.pass.set(&statusWrapper, input_user_data->password); | |||
if (strlen(input_user_data->password) > 8) { | ||||
return user_error(status, isc_password_too_long); | ||||
} | ||||
*/ | ||||
Firebird::string::size_type l = work.find(' '); | ||||
if (l != Firebird::string::npos) { | ||||
work.resize(l); | ||||
} | ||||
userInfo.pass.set(&statusWrapper, work.c_str()); | ||||
check(&statusWrapper); | check(&statusWrapper); | |||
userInfo.pass.setEntered(&statusWrapper, 1); | userInfo.pass.setEntered(&statusWrapper, 1); | |||
check(&statusWrapper); | check(&statusWrapper); | |||
} | } | |||
else { | else { | |||
return user_error(status, isc_password_required); | return user_error(status, isc_password_required); | |||
} | } | |||
copyField(userInfo.u, input_user_data->uid, input_user_data->sec_flags & sec_uid_spec); | copyField(userInfo.u, input_user_data->uid, input_user_data->sec_flags & sec_uid_spec); | |||
copyField(userInfo.g, input_user_data->gid, input_user_data->sec_flags & sec_gid_spec); | copyField(userInfo.g, input_user_data->gid, input_user_data->sec_flags & sec_gid_spec); | |||
End of changes. 8 change blocks. | ||||
30 lines changed or deleted | 5 lines changed or added |