]> git.lizzy.rs Git - plan9front.git/blob - sys/man/3/shr
devshr: security!
[plan9front.git] / sys / man / 3 / shr
1 .TH SHR 3 
2 .SH NAME
3 shr \- global mountpoints
4 .SH SYNOPSIS
5 .nf
6 .B bind -a '#σ/share' /dev
7
8 .BI #σ/ share1
9 .BI #σc/ share1/service1
10 .BI #σc/ share1/service2
11  ...
12 .fi
13 .SH DESCRIPTION
14 The
15 .I shr
16 device provides global mountpoints in the form of share directories
17 where
18 .IR 9P
19 services can be mounted on.
20
21 Effectively, it is a global mountpoint registry that is separate from
22 private namespaces.
23 .PP
24 The
25 .I shr
26 device exports a mount tree and a control tree. The directories
27 in the mount tree
28 .BI #σ
29 are the share mountpoints themselve and in the control tree
30 .BI #σc
31 share directories list the service files of the share.
32 .PP
33 To create a new share, create the directory
34 .B #σc/myshare
35
36 To mount a service in that share, create the file
37 .B #σc/myshare/myserv
38 and then write a text string (suitable for
39 .IR strtoul ;
40 see
41 .IR atof (2))
42 giving the file descriptor number of an open
43 .I 9P
44 service.  Any process
45 with the proper permission may then access
46 .B #σ/myshare
47 on the mount tree.
48 .PP
49 The service file can be reopened and passed to
50 .IR mount
51 (see
52 .IR bind(2))
53 or added to another share.
54 .PP
55 Multiple services can be mounted under a share forming a union
56 directory. New services get mounted before old ones.
57 Removing the service file unmounts the service from the share.
58 .PP
59 Creating shares and mounts requires read-write access in the share
60 directory. The special user
61 .B none
62 is prohibited from these operations.
63 .SH SOURCE
64 .B /sys/src/9/port/devshr.c