chiark / gitweb /
noip.c: Add debugging to most of the syscall wrappers.
[preload-hacks] / uopen.1
CommitLineData
e4976bb0 1.de VS
2.sp 1
3.RS
4.nf
5.ft B
6..
7.de VE
8.ft R
9.fi
10.RE
11.sp 1
12..
292b125f 13.TH uopen 1 "5 May 2005" "Straylight/Edgeware" "Preload hacks"
e4976bb0 14.SH NAME
15uopen \- connect to Unix-domain sockets using open(2)
16.SH SYNOPSIS
17.B uopen
18.RI [ command
19.RI [ args ...]]
20.SH DESCRIPTION
21The
22.B uopen
23command runs
24.I command
25(by default, the calling user's shell, as determined by the
26.B SHELL
27environment variable) in an environment where an attempt by the program
28to
29.BR open (2)
30a Unix-domain socket results in a connection being made to the socket.
31.PP
32This might be used to implement a signature server which chooses a
33random signature for newly-written news and mail messages. This can be
34done by writing a simple program to choose and print a signature,
35causing it to be invoked in response to connections to the socket
36.B $HOME/.signature
37(for example, by
38.BR fw (1))
39and running the message-drafting program under the control of
40.BR uopen .
41If we were willing to accept
42.BR fortune (5)
43as our signature generator, this can be done using, say
44.VS
45fw -d -p$HOME/.sigd.pid \e
46 "from unix:$HOME/.signature to exec[fortune -s]"
47uopen emacs -nw -f vm
48.VE
49.SH BUGS
50.B uopen
51is implemented as an
52.B LD_PRELOAD
53hack. It won't work on setuid programs.
54.PP
55The code is needlessly Linux-specific in some places.
56.PP
57It may not catch some uses of
58.BR open (2)
59or its friends from inside the Linux C library. It's a strange and
60murky world in there, and glibc does all manner of strange linker tricks
61to stop you messing with
62.BR open (2).
63.SH SEE ALSO
64.BR fw (1),
65.BR ld.so (8),
66.BR open (2).
67.SH AUTHOR
a8be0591 68Mark Wooding, <mdw@distorted.org.uk>