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