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

    Details

    • Type: Incident report
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: None
    • Component/s: Frontend (F)
    • Labels:
      None
    • Environment:
      using zabbix 1.6.5, issue present in branches/1.6 and trunk.
      database is postgresql.
      PHP 5.1.6 (RHEL5.3).

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: