chiark / gitweb /
It seems to work!
[preload-hacks] / uopen.1
diff --git a/uopen.1 b/uopen.1
new file mode 100644 (file)
index 0000000..d5a5ac8
--- /dev/null
+++ b/uopen.1
@@ -0,0 +1,68 @@
+.de VS
+.sp 1
+.RS
+.nf
+.ft B
+..
+.de VE
+.ft R
+.fi
+.RE
+.sp 1
+..
+.TH uopen 3 "5 May 2005" "Straylight/Edgeware" "Preload hacks"
+.SH NAME
+uopen \- connect to Unix-domain sockets using open(2)
+.SH SYNOPSIS
+.B uopen
+.RI [ command
+.RI [ args ...]]
+.SH DESCRIPTION
+The
+.B uopen
+command runs
+.I command
+(by default, the calling user's shell, as determined by the
+.B SHELL
+environment variable) in an environment where an attempt by the program
+to
+.BR open (2)
+a Unix-domain socket results in a connection being made to the socket.
+.PP
+This might be used to implement a signature server which chooses a
+random signature for newly-written news and mail messages.  This can be
+done by writing a simple program to choose and print a signature,
+causing it to be invoked in response to connections to the socket
+.B $HOME/.signature
+(for example, by
+.BR fw (1))
+and running the message-drafting program under the control of
+.BR uopen .
+If we were willing to accept
+.BR fortune (5)
+as our signature generator, this can be done using, say
+.VS
+fw -d -p$HOME/.sigd.pid \e
+  "from unix:$HOME/.signature to exec[fortune -s]"
+uopen emacs -nw -f vm
+.VE
+.SH BUGS
+.B uopen
+is implemented as an
+.B LD_PRELOAD
+hack.  It won't work on setuid programs.
+.PP
+The code is needlessly Linux-specific in some places. 
+.PP
+It may not catch some uses of
+.BR open (2)
+or its friends from inside the Linux C library.  It's a strange and
+murky world in there, and glibc does all manner of strange linker tricks
+to stop you messing with
+.BR open (2).
+.SH SEE ALSO
+.BR fw (1),
+.BR ld.so (8),
+.BR open (2).
+.SH AUTHOR
+Mark Wooding, <mdw@nsict.org>