"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/alert_methods/SCP/alert" between
openvas-manager-7.0.2.tar.gz and openvas-manager-7.0.3.tar.gz

About: OpenVAS Manager is a layer between OpenVAS-Scanner and various client applications such as OpenVAS-Client or Greenbone Security Assistant. Among other features, it adds server-side storage of scan results and it makes it unnecessary for scan clients to keep connection until a scan finishes. OpenVAS-9.

alert  (openvas-manager-7.0.2):alert  (openvas-manager-7.0.3)
skipping to change at line 27 skipping to change at line 27
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
PASSWORD=$1 USERNAME=$1
USERNAME=$2 HOST=$2
HOST=$3 DEST=$3
DEST=$4 KNOWN_HOSTS=$4
KNOWN_HOSTS=$5 PASSWORD_FILE=$5
REPORT_FILE=$6 REPORT_FILE=$6
KNOWN_HOSTS_FILE=`mktemp` || exit 1 KNOWN_HOSTS_FILE=`mktemp` || exit 1
echo $KNOWN_HOSTS > $KNOWN_HOSTS_FILE echo $KNOWN_HOSTS > $KNOWN_HOSTS_FILE
PASSWORD_FILE=`mktemp` || exit 1 log_error() {
echo $PASSWORD > $PASSWORD_FILE logger "SCP alert: $1"
echo "$1" >&2
}
# Escape destination twice because it is also expanded on the remote end. # Escape destination twice because it is also expanded on the remote end.
sshpass -f ${PASSWORD_FILE} scp -o HashKnownHosts=no -o UserKnownHostsFile="${KN OWN_HOSTS_FILE} ~/.ssh/known_hosts ~/.ssh/known_hosts2 /etc/ssh/ssh_known_hosts" "${REPORT_FILE}" "${USERNAME}@${HOST}:'${DEST}'" sshpass -f ${PASSWORD_FILE} scp -o HashKnownHosts=no -o UserKnownHostsFile="${KN OWN_HOSTS_FILE} ~/.ssh/known_hosts ~/.ssh/known_hosts2 /etc/ssh/ssh_known_hosts" "${REPORT_FILE}" "${USERNAME}@${HOST}:'${DEST}'" 2>/dev/null
EXIT_CODE=$? EXIT_CODE=$?
if [ $EXIT_CODE -eq 1 ] if [ $EXIT_CODE -eq 1 ]
then then
logger "SCP alert: sshpass failed with exit code ${EXIT_CODE}: Invalid command line argument" log_error "sshpass failed with exit code ${EXIT_CODE}: Invalid command line ar gument"
elif [ $EXIT_CODE -eq 2 ] elif [ $EXIT_CODE -eq 2 ]
then then
logger "SCP alert: sshpass failed with exit code ${EXIT_CODE}: Conflicting arg uments given" log_error "sshpass failed with exit code ${EXIT_CODE}: Conflicting arguments g iven"
elif [ $EXIT_CODE -eq 3 ] elif [ $EXIT_CODE -eq 3 ]
then then
logger "SCP alert: sshpass failed with exit code ${EXIT_CODE}: General runtime error" log_error "sshpass failed with exit code ${EXIT_CODE}: General runtime error"
elif [ $EXIT_CODE -eq 4 ] elif [ $EXIT_CODE -eq 4 ]
then then
logger "SCP alert: sshpass failed with exit code ${EXIT_CODE}: Unrecognized re sponse from ssh (parse error)" log_error "sshpass failed with exit code ${EXIT_CODE}: Unrecognized response f rom ssh (parse error)"
elif [ $EXIT_CODE -eq 5 ] elif [ $EXIT_CODE -eq 5 ]
then then
logger "SCP alert: sshpass failed with exit code ${EXIT_CODE}: Invalid/incorre ct password" log_error "sshpass failed with exit code ${EXIT_CODE}: Invalid/incorrect passw ord"
elif [ $EXIT_CODE -eq 6 ] elif [ $EXIT_CODE -eq 6 ]
then then
logger "SCP alert: sshpass failed with exit code ${EXIT_CODE}: Host public key log_error "sshpass failed with exit code ${EXIT_CODE}: Host public key is unkn
is unknown." own."
elif [ $EXIT_CODE -eq 127 ]
then
log_error "sshpass failed with exit code ${EXIT_CODE}: Command not found."
elif [ $EXIT_CODE -ne 0 ] elif [ $EXIT_CODE -ne 0 ]
then then
logger "SCP alert: sshpass failed with exit code ${EXIT_CODE}" log_error "sshpass failed with exit code ${EXIT_CODE}"
fi fi
rm $KNOWN_HOSTS_FILE rm $KNOWN_HOSTS_FILE
rm $PASSWORD_FILE rm $PASSWORD_FILE
exit $EXIT_CODE
 End of changes. 11 change blocks. 
16 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)