-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfdpass.1
90 lines (90 loc) · 2.37 KB
/
fdpass.1
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
.\" Copyright (c) 2010 Todd T. Fries <todd@fries.net>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate$
.Dt FDPASS 1
.Os
.Sh NAME
.Nm fdpass
.Nd file descriptor pass utility
.Sh SYNOPSIS
.Nm fdpass
.Fl f Ar file
.Op Fl n Ar num
.Op Fl r
.Op Fl u Ar user
.Op Fl w
.Cm utility
.Op Ar argument ...
.Sh DESCRIPTION
.Nm
opens a
.Ar file
and passes it to the file descriptor of a process via
.Xr execvp 3 .
.Nm
requires at least the
.Fl f Ar file
argument and a
.Cm utility
to be given.
.Pp
By default
.Nm
will use file descriptor number 3 to start.
.Nm can be passed multiple files.
By default, files are opened with both read and write permissions,
so any files requiring special privleges will need
.Nm
to run as a user capable of performing the open.
See the
.Sx EXAMPLES
section below for sample usage.
.Bl -tag -width Ds
.It Fl f Ar file
Specifies the file to open, and may be specified multiple times.
.It Op Fl n Ar num
File descriptor number to start with.
.It Op Fl r
Opens files read only.
.It Op Fl u Ar user
Specifies the user to become before executing qemu.
.It Op Fl w
Opens files write only.
.It Cm utility
Program to execute.
.It Op Ar argument ...
Program arguments.
.El
.Sh ENVIRONMENT
No environment variables are useful at this time.
.Sh EXAMPLES
The below example opens
.Dq tun0 ,
drops privileges to user
.Dq todd ,
and executes
.Xr qemu 1
with command line args instructing it to find the
.Dq tun0
file descriptor as file descriptor number 3.
.Bd -literal -offset indent
# fdpass -u todd -f /dev/tun0 qemu -hda test.hd -no-fd-bootchk \e
-monitor stdio -net nic,vlan=0 -net tap,vlan=0,fd=3
.Ed
.Sh SEE ALSO
.Xr qrun 1
.Sh HISTORY
This utility was created by
.An Claudio Jeker Aq claudio@openbsd.org .