Skip to content

Commit

Permalink
V1.0 RC1 build complete
Browse files Browse the repository at this point in the history
  • Loading branch information
jonsjava committed Dec 24, 2014
1 parent 2d755ab commit ff18bb3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion html/client/get_commands.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
else{
$add_after = "";
}
echo "key_to_check=\"$key_to_check\"\r\ncmd_to_run=\"$cmd $package_string;$add_after\"";
echo "key_to_check='$key_to_check'
cmd_to_run='$cmd $package_string;$add_after'";
}
}
mysql_close($link);
8 changes: 5 additions & 3 deletions html/client/run_commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ if [[ ! -f "/opt/patch_manager/.patchrc" ]]; then
exit 0
fi
. /opt/patch_manager/.patchrc
rm -rf /tmp/cmds_$client_key > /dev/null 2>&1
curl -s -H "X-CLIENT-KEY: $client_key" $get_cmd_uri > /tmp/cmds_$client_key
cmds_line_count=$(cat /tmp/cmds_$client_key|wc -l)
if [ "$cmds_line_count" -gt "0" ]; then
. /tmp/cmds_$client_key
key_to_check=$(head -n 1 /tmp/cmds_$client_key)
if [ "$key_to_check" = "$auth_key" ]; then
key_sum=$(echo $key_to_check|sha256sum)
auth_sum=$(echo $auth_key|sha256sum)
if [ "$key_sum" == "$auth_sum" ]; then
echo $cmd_to_run|bash
fi
fi
rm -rf /tmp/cmds_$client_key
rm -rf /tmp/cmds_$client_key
2 changes: 1 addition & 1 deletion html/client/send_patches.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
$row = mysql_fetch_array($client_check_res);
$server_name = $row['server_name'];
$data = file_get_contents("php://input");
mysql_query("DELETE FROM `patches` WHERE `server_name='$server_name';");
mysql_query("DELETE FROM `patches` WHERE `server_name`='$server_name';");
$package_array = explode("\n", $data);
$suppression_sql = "SELECT * from `supressed` WHERE `server_name` IN('$server_name',0);";
$suppression_res = mysql_query($sql);
Expand Down
2 changes: 1 addition & 1 deletion html/inc/navbar.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
if (!isset($index_check) || $index_check != "active"){
exit();
}
$patch_list_sql = "SELECT count(*) as total_found FROM `patches` p LEFT JOIN servers s on s.server_name = p.server_name WHERE s.trusted = 1 and p.upgraded=0;";
$patch_list_sql = "SELECT count(*) as total_found FROM `patches` p LEFT JOIN servers s on s.server_name = p.server_name WHERE s.trusted = 1 and p.upgraded=0; and p.package_name !='';";
$patch_list_link = mysql_connect(DB_HOST,DB_USER,DB_PASS);
mysql_select_db(DB_NAME,$patch_list_link);
$patch_list_res = mysql_query($patch_list_sql);
Expand Down

0 comments on commit ff18bb3

Please sign in to comment.