chiark / gitweb /
Fix reading of timeouts
[pixie] / pixie.1
CommitLineData
9d2e2c65 1.\" -*-nroff-*-
2.de hP
3.IP
4.ft B
5\h'-\w'\\$1\ 'u'\\$1\ \c
6.ft P
7..
8.ie t .ds o \(bu
9.el .ds o o
10.
11.TH pixie 1 "14 October 1999"
12.SH "NAME"
13pixie \- new, improved PGP passphrase pixie
14.SH "SYNOPSIS"
15.B pixie
16.RB [ \-xqv ]
17.RB [ \-t
18.IR timeout ]
19.RB [ \-d
20.IR dir ]
21.RI [ socket ]
22.PP
23.B pgp-pixie
24.SH "DESCRIPTION"
25The passphrase pixie sets up a Unix-domain socket and gives your PGP
26passphrase to anyone who connects to it. It tries quite hard to make
27sure that only your own processes are allowed to do this, and to be
28secure in other ways. This is mostly useful with Ian Jackson's
29.B auto-pgp
30tools.
31.SS "Command line options"
32The
33.B pixie
34program understands the following command line options:
35.TP
36.B "\-h, \-\-help"
37Prints a relatively comprehensive help message, and exit successfully.
38.TP
39.B "\-V, \-\-version"
40Print the pixie's version number and exit successfully.
41.TP
42.B "\-u, \-\-usage"
43Print a terse usage summary and exit successfully.
44.TP
45.B "\-x, \-\-x11"
46Use the
47.BR xgetline (1)
48program to request a passphrase when necessary, rather than requesting
49the passphrase from the terminal.
50.RB ( xgetline
51is part of the
52.B xtoys
53distribution. It requires the GTK library.) Use the
54.B +x
55or
56.B \-\-no\-x11
57option to prevent use of
58.BR xgetline .
59.TP
60.B "\-q, \-\-quiet"
61Produce fewer messages. This can be used multiple times to make the
62pixie very quiet.
63.TP
64.B "\-v, \-\-verbose"
65Produce more messages. This can be used multiple times to make the
66pixie more verbose.
67.TP
68.BI "\-t, \-\-timeout=" timeout
69Sets a timeout for the user's passphrase. The timeout is, by default,
70in seconds, although a suffix
71.RB ` m ',
72.RB ` h '
73or
74.RB ` d '
75can be added to specify minutes, hours or days respectively. A timeout
76of zero means that the pixie will never time out a passphrase. The
77default is to time out a passphrase after 5 minutes.
78.TP
79.BI "\-d, \-\-dir=" directory
80Create, secure and set the named directory as being current before
81creating a socket. If the directory does not exist, it is created with
82mode 700 (readable and writable only by owner); if it does exist, it is
83checked to ensure that it's owned by the calling user, and it's not
84readable or writable by anyone other than the caller.
85.PP
86If neither of
87.B \-x
88nor
89.B +x
90are specified on the command line, the pixie decides for itself how to
91ask for a passphrase. If standard input is a terminal, it uses the
92terminal; otherwise it tries
93.BR xgetline .
94.PP
95A socket name is required if no
96.B \-d
97option is given; otherwise it's optional and defaults to
98.BR pass-socket .
99.PP
100The
101.B pgp-pixie
102shell script provides some default arguments to the main
103.B pixie
104program which put the socket in
105.BR $PGPPATH/.wrapper/pass-socket ,
106where the other
107.B auto-pgp
108tools expect it to be. It passes any command line options straight on
109to the main
110.B pixie
111program.
112.SS "Pixie initialization"
113The pixie initializes itself as follows:
114.hP 1.
115If the operating system supports locking pages into memory, the pixie
116requests a page of memory and then attempts to lock it. If successful,
117the passphrase will be stored in this area of memory to prevent its
118being swapped out to disk.
119.hP 2.
120The pixie sets its effective uid the same as its real uid, dropping any
121setuid privileges the program might have had.
122.hP 3.
123If the attempt to lock the page failed, or the operating system doesn't
124support locking pages, a buffer of normal memory is allocated for the
125passphrase.
126.hP 4.
127The pixie parses its command line options.
128.hP 5.
129If a directory was specified with the
130.B \-d
131option, the pixie attempts to set it as the current directory. If the
132attempt fails because the directory doesn't exist, it is created and the
133attempt to change directory is made again. The directory's status is
134then examined to ensure that it conforms with the security requirements
135described above.
136.hP 6.
137A Unix domain socket is created, with the process's umask (see
138.BR umask (2))
139artifically set to 077. If socket cannot be created, for whatever
140reason, the pixie reports an error and exits.
141.hP 7.
142If the verbosity level is sufficiently high, and a locked memory page
143could not be allocated, the pixie emits a warning.
144.SS "Runtime behaviour"
145After initialization, the pixie enters a loop, waiting for various
146things to happen.
147.PP
148If a client connects to the pixie's socket, the pixie will write its
149passphrase to the connected socket and then close it. If the pixie
150currently has no passphrase, it asks for one and starts a timer (if one
151was requested by the user).
152.PP
153When the passphrase timer expires, all memory of the passphrase is
154expunged, and the timer is removed. Any future connections requesting a
155passphrase will require the user to type one in again.
156.PP
157Some signals have a special meaning for the pixie:
158.TP
159.BR SIGINT " and " SIGTERM
160Cause an orderly shutdown of the pixie. The Unix-domain socket is
161removed.
162.TP
163.BR SIGHUP " and " SIGQUIT
164Causes the passphrase to be forgotten immediately, as if timed out.
165This can be handy if you've typed the passphrase wrongly.
166.RB ( SIGQUIT
167was chosen because it can be easily typed at the terminal, usually using
168.BR C-\e .)
169.SH "IMPORTANT SECURITY NOTE"
170Don't use this software on a machine with a hostile admin. You will
171lose. Any machine with hostile administration must be automatically
172assumed hostile. Never type a passphrase into a hostile machine. Don't
173sent a passphrase over a hostile or potentially hostile network. Don't
174do anything else stupid.
175.SH "OTHER CAVEATS"
176The
177.B \-d
178option doesn't do a thorough audit of a directory, in the way that, say
179.BR chkpath (1)
180does. It's your responsibility to make sure that the full path is
181relatively safe.
182.PP
183The
184.BR xgetline (1)
185program is not as careful about locking memory as the pixie is.
186Hopefully the fact that it's a short-lived process means that this isn't
187a major issue; however, it remains possible that the passphrase typed
188into
189.B xgetline
190could be swapped to disk.
191.PP
192It's possible, though unlikely, that there's a security hole in the part
193of the
194.B pixie
195program which can run with setuid privileges. In this case, remove
196setuid privileges immediately \- the program runs quite happily without,
197except that it might not be able to lock pages into memory.
198.SH "ACKNOWLEDGEMENTS"
199The original passphrase pixie was written by Ian Jackson as part of his
200.B auto-pgp
201package. This pixie incorporates some improvements over the original
202which were noted in the
203.B auto-pgp
204documentation.
205.SH "AUTHOR"
206Mark Wooding, <mdw@nsict.org>