File: honeypot.pl

package info (click to toggle)
uml-utilities 20070815.4-2.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 752 kB
  • sloc: ansic: 3,392; perl: 1,277; makefile: 239; exp: 129; sh: 122
file content (42 lines) | stat: -rw-r--r-- 1,193 bytes parent folder | download | duplicates (8)
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
#!/usr/bin/perl
# 
# Copyright (C) 2002, 2003 Jeff Dike (jdike@karaya.com)
# Licensed under the GPL
#

use hppfs;
use hppfslib;
use strict;

my $dir;

@ARGV and $dir = $ARGV[0] or die "Not enough arguments - pass dir where UML will be running";

# !mkdir $dir and warn "Couldn't create '$dir' : $!";
!mkdir "$dir/proc" and warn "Couldn't create '$dir/proc' : $!";

my $hppfs = hppfs->new($dir);

my $remove_filesystems = remove_lines("hppfs", "hostfs");

# Need to be able to add directories, i.e. driver, bus/pci
# partitions needs work
# slabinfo if UML ever uses the slab cache for anything

$hppfs->add("cmdline" => host_proc("cmdline"),
	    "cpuinfo" => host_proc("cpuinfo"),
	    "dma" => host_proc("dma"),
	    "devices" => remove_lines("ubd"),
	    "exitcode" => "remove",
	    "filesystems" => $remove_filesystems,
	    "interrupts" => host_proc("interrupts"),
	    "iomem" => host_proc("iomem"),
	    "ioports" => host_proc("ioports"),
	    "mounts" => $remove_filesystems,
	    "pid/mounts" => $remove_filesystems,
	    "stat" => host_proc("stat"),
	    "uptime" => host_proc("uptime"),
	    "version" => host_proc("version"),
	    dup_proc_dir("bus", $dir) );

$hppfs->handler();