View Issue Details

IDProjectCategoryView StatusLast Update
0001324bareos-core[All Projects] webuipublic2021-03-02 10:26
ReporterEmmanuel GaretteAssigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
PlatformLinux UbuntuOS20.04OS Version
Product Version20.0.0 
Fixed in Version 
Summary0001324: Infinite loop when trying to log with invalid account
DescriptionI'm using this community version of Webui: http://download.bareos.org/bareos/release/20/xUbuntu_20.04/

When I'm trying to log with invalid account, webui didn't return nothing and apache seems to run an infinite loop. The log file increases rapidly.

I think the problem is in this two lines:

          $send = fwrite($this->socket, $msg, $str_length);
         if($send === 0) {

The fwrite function returns false when an error provides (see: https://www.php.net/manual/en/function.fwrite.php ).

If a replace 0 by false, everything is ok.

In attachement a patch to solve this issues.
TagsNo tags attached.
bareos-master: impact
bareos-master: action
bareos-19.2: impact
bareos-19.2: action
bareos-18.2: impact
bareos-18.2: action
bareos-17.2: impact
bareos-17.2: action
bareos-16.2: impact
bareos-16.2: action
bareos-15.2: impact
bareos-15.2: action
bareos-14.2: impact
bareos-14.2: action
bareos-13.2: impact
bareos-13.2: action
bareos-12.4: impact
bareos-12.4: action

Activities

Emmanuel Garette

Emmanuel Garette

2021-03-02 10:26

reporter  

webui.patch (483 bytes)
--- BareosBSock.php	2021-03-02 10:16:20.195329949 +0100
+++ /usr/share/bareos-webui/vendor/Bareos/library/Bareos/BSock/BareosBSock.php	2021-03-02 10:16:46.147329949 +0100
@@ -217,7 +217,7 @@
       $str_length += 4;
       while($this->socket && $str_length > 0) {
          $send = fwrite($this->socket, $msg, $str_length);
-         if($send === 0) {
+         if($send === false) {
             fclose($this->socket);
             $this->socket = null;
             return false;
webui.patch (483 bytes)

Issue History

Date Modified Username Field Change
2021-03-02 10:26 Emmanuel Garette New Issue
2021-03-02 10:26 Emmanuel Garette File Added: webui.patch