This file is indexed.

/usr/share/dsyslog/www/logs.php is in dsyslog-module-mysql 0.6.0build2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?
/*
 * dsyslog - a dumb syslog (e.g. syslog for people who have a clue)
 * Copyright (c) 2008 William Pitcock <nenolod@sacredspiral.co.uk>
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice is present in all copies.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
include "functions.php";

$_skip = 0;
if ($_REQUEST[skip]) {
	$_skip = $_REQUEST[skip];
}

$_uappend="";
$_append="where";
if ($_REQUEST[source]) {
	$_cond .= "$_append source='$_REQUEST[source]' ";
	$_url .= $_uappend."source=$_REQUEST[source]";
	$_explain .= "$_append source is '$_REQUEST[source]' ";
	$_append = " and ";
	$_uappend = "&";
}
if ($_REQUEST[program]) {
	$_cond .= "$_append program='$_REQUEST[program]' ";
	$_url .= $_uappend."program=$_REQUEST[program]";
	$_explain .= "$_append program is '$_REQUEST[program]' ";
	$_append = " and ";
	$_uappend = "&";
}

$query = "SELECT datestamp,source,program,message FROM log $_cond ORDER BY timestamp DESC LIMIT $_skip,100;";
$_title = "Log entries $_explain";

include "header.php";

?>
<? divboxstart("Machines"); ?>
Logs are available for these machines:
<?
	$res = get_db_rows("SELECT DISTINCT source FROM log ORDER BY source DESC;");
	while ($row = get_db_tuple($res)) {
		echo "$delim<a href=\"logs.php?source=$row[source]\">$row[source]</a>";
		if (!$delim) $delim = " | ";
	}
?>
 | <a href="logs.php">All logs</a>.
</ul>
<? divboxend(); ?>
<br>
<? divboxstart("Programs"); ?>
Logs are available for these programs:
<?
	$res = get_db_rows("SELECT DISTINCT program FROM log ORDER BY source DESC;");
	while ($row = get_db_tuple($res)) {
		echo "$delim<a href=\"logs.php?program=$row[program]\">$row[program]</a>";
		if (!$delim) $delim = " | ";
	}
?>
 | <a href="logs.php">All logs</a>.
</ul>
<? divboxend(); ?>
<br>
<div style='text-align: right;'>Navigation: 
<?
        $res = get_db_rows("SELECT COUNT(*) FROM log $_cond;");
        $row = get_db_tuple($res);
        $max = $count = ceil($row[0] / 100);

        while ($count)
        {
                echo "<a href='?skip=".(($max - $count) * 100)."$_url'>".(($max - $count) + 1)."</a> ";
                $count--;
        }
?>
</div>
<? divboxstart("Log entries $_explain", "#fcfcfc"); ?>
<table class="logviewer" width="100%">
<tr>
<td style="font-weight: bold;">Service</td>
<td style="text-align: right; font-weight: bold;">Time</td>
</tr>
<tr>
<td style="font-weight: bold; border-bottom: 1px #000 solid;" colspan="2">Message</td>
</tr>
<?
	$res = get_db_rows($query);
	while ($row = get_db_tuple($res)) {
?>
<tr>
<td><a href="logs.php?<?= $_url ?>&source=<?= $row[source] ?>"><?= $row[source] ?></a>'s <a href="logs.php?<?= $_url ?>&program=<?= $row[program] ?>"><?= $row[program] ?></a></td>
<td style="text-align: right;"><?= $row[datestamp] ?></td>
</tr>
<tr>
<td style="border-bottom: 1px #000 solid;" colspan="2"><?= $row[message] ?>&nbsp;</td>
</tr>
<?
	}
?>
</table>
<? divboxend(); ?>
<?
include "footer.php";
?>