Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-985

Dbexecute on pgsql return integer which may not work with binary AND

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • 1.6
    • Frontend (F)
    • None
    • using zabbix 1.6.5, issue present in branches/1.6 and trunk.
      database is postgresql.
      PHP 5.1.6 (RHEL5.3).

      Use case was to simply create a user-group which failed.
      Looking at the code, the part failing:

                      $result&=change_group_status($usrgrpid,$users_status);
                      $result&=change_group_gui_access($usrgrpid,$gui_access);
                      if(!$result) return     $result;
      

      in frontends/php/include/users.inc.php.

      The reason is because pg_query in db.inc.php will return a resource ID (integer ?) which may return false on a binary AND. In my case, the previous value of $result was resource 127 and the return of change_group_status() was 128. Doing a binary AND between 127 and 128 returned false.

      In my case, I patched the file users.inc.php, but you may just want to patch DBexecute to force it to return a boolean true/false.

            Unassigned Unassigned
            fischaz Johan Fischer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: