More unit-tests and bug fixes
[zeroinstall.git] / 0store-secure-add.1
bloba704e0f75563fb7cb8d41d33bd2d134554010975
1 .TH 0STORE\-SECURE\-ADD 1 "2010" "Thomas Leonard" ""
2 .SH NAME
3 0store\-secure\-add \(em add an implementation to the system cache
5 .SH SYNOPSIS
7 .B 0store\-secure\-add
8 \fBDIGEST\fP
10 .SH DESCRIPTION
11 .PP
12 This command imports the current directory into the system-wide shared Zero
13 Install cache, as /var/cache/0install.net/implementations/DIGEST.
14 This allows a program downloaded by one user to be shared with other users.
16 .PP
17 The current directory must contain a file called '.manifest' listing all the
18 files to be added (in the format required by DIGEST), and this file must have the
19 given digest. If not, the import is refused. Therefore, it is only possible to
20 add a directory to the cache if its name matches its contents.
22 .PP
23 It is intended that it be safe to grant untrusted users permission to call
24 this command with elevated privileges. To set this up, see below.
26 .SH SETTING UP SHARING
28 To enable sharing, the system administrator should follow these steps:
30 .PP
31 Create a new system user to own the cache:
33 .B adduser \-\-system zeroinst
35 .PP
36 Create the shared directory, owned by this new user:
38 .B mkdir /var/cache/0install.net
40 .B chown zeroinst /var/cache/0install.net
43 Use visudo(8) to add these lines to /etc/sudoers:
45 .B Defaults>zeroinst env_reset,always_set_home
47 .B ALL     ALL=(zeroinst) NOPASSWD: /usr/bin/0store\-secure\-add
50 Create a script called
51 .B 0store\-secure\-add\-helper
52 in PATH to call it. This script must be executable and contain these two lines:
55 #!/bin/sh
58 exec sudo \-S \-u zeroinst /usr/bin/0store\-secure\-add "$@" < /dev/null
61 The other Zero Install programs will call this helper script automatically.
63 .SH FILES
65 .IP "/var/cache/0install.net/implementations"
66 System-wide Zero Install cache.
68 .SH LICENSE
69 .PP
70 Copyright (C) 2009 Thomas Leonard.
72 .PP
73 You may redistribute copies of this program under the terms of the GNU Lesser General Public License.
75 .SH BUGS
76 .PP
77 This program is EXPERIMENTAL. It has not been audited. Do not use it yet in
78 security-critial environments.
80 .PP
81 The env_reset line in sudoers may not be required. sudo(1) seems to do it automatically.
83 .PP
84 If sudo let us check whether we could call a command then we could switch to
85 using it automatically, instead of needing to add the helper script. Currently,
86 sudo delays for one second and writes to auth.log if we try to use this system
87 when it hasn't been set up.
89 .PP
90 Please report bugs to the developer mailing list:
92 http://0install.net/support.html
94 .SH AUTHOR
95 .PP
96 Zero Install was created by Thomas Leonard.
98 .SH SEE ALSO
99 0store(1)
102 The Zero Install web-site:
104 .B http://0install.net