2017-01-13 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in 'lib/rduser.cpp' that caused the
	'RDUser::groupAuthorized()' to return false positive results.
This commit is contained in:
Fred Gleason 2017-01-13 19:03:22 -05:00
parent 7df68e7ffd
commit 21dcac3e4a
2 changed files with 6 additions and 3 deletions

View File

@ -15507,3 +15507,6 @@
* Fixed a bug in 'rdlogedit/edit_log.cpp' that caused the Modified
datestamp to be updated when 'OK' was clicked even if no changes
were made.
2017-01-13 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in 'lib/rduser.cpp' that caused the
'RDUser::groupAuthorized()' to return false positive results.

View File

@ -390,9 +390,9 @@ bool RDUser::groupAuthorized(const QString &group_name)
RDSqlQuery *q;
bool ret=false;
sql=QString().
sprintf("select GROUP_NAME from USER_PERMS where USER_NAME=\"%s\"",
(const char *)RDEscapeString(user_name));
sql=QString("select GROUP_NAME from USER_PERMS where ")+
"(USER_NAME=\""+RDEscapeString(user_name)+"\")&&"+
"(GROUP_NAME=\""+RDEscapeString(group_name)+"\")";
q=new RDSqlQuery(sql);
ret=q->first();
delete q;