Sync our ieee80211*.9 manual pages with the recent upgrade.
[dragonfly.git] / share / examples / portal / README
1
2 This contains a couple of examples for using the portal filing system.
3
4 The portal file system provides a way of obtaining a file descriptor
5 to a filesystem object (i.e. something that is accessed by open(2),
6 pipe(2), socket(2) or socketpair(2)) via the filesystem namespace.
7 At present the only file descriptor supported are TCP sockets and
8 files.
9
10 NOTE!!!! The portal file system is experimental in nature and should
11 not be considered secure, use with caution.
12
13 First off mount the filesystem using something like:
14
15 # mount_portal /usr/share/examples/portal/portal.conf /p
16
17 Then you should be able to do things like
18 # cat /p/tcp/localhost/daytime
19 Sun Nov 22 17:50:09 1998
20 (assuming inetd is running the daytime service, by default it is off)
21
22 Welcome to FreeBSD!
23
24 # mkdir -p /tmp/root
25 # cd /tmp/root
26 # mkdir bin p
27 # cp /bin/sh /bin/cat bin
28 # mount_portal /usr/share/examples/portal/portal.conf /tmp/root/p
29 # chroot /tmp/root
30 # pwd
31 /
32 # echo *
33 bin p
34 # cat /etc/motd
35 cat: /etc/motd: No such file or directory
36 # cat /p/fs/etc/motd
37 FreeBSD 2.2.6-RELEASE (COMPUTER) #0: Sat Aug 22 17:11:37 BST 1998
38
39 Welcome to FreeBSD!
40
41 Finally, a very simple example of the listening server is available,
42 fire up two xterms. In the first
43
44 xterm-1$ cat /p/tcplisten/ANY/6666
45 (the ANY is a wildcard just like using INADDR_ANY, any resolvable host
46 can be used).
47
48 In the second xterm
49 xterm-2$ echo "hello there" >/p/tcp/localhost/6666
50
51 You should see the "hello there" string appear on the first terminal.
52
53 Unprivilged users can't create servers on privalged ports.
54 xterm-1$ cat /p/tcplisten/ANY/666
55 cat: /p/tcplisten/ANY/666: Operation not permitted
56
57 but root can
58 xterm-1# cat /p/tcplisten/ANY/666
59
60 In the second
61 xterm-2$ echo "hello there" >/p/tcp/localhost/666
62 should produce the expected response.
63
64 You can also swap the client/server read and write commands etc.