+PACKAGE = preload-hacks
+VERSION = 1.0.0
+
+prefix = /usr/local
+exec_prefix = ${prefix}
+bindir = ${exec_prefix}/bin
+libdir = ${exec_prefix}/lib
+mandir = ${prefix}/man
+man1dir = ${mandir}/man1
+
CC = gcc
LD = gcc
CFLAGS = -O2 -g -fPIC -Wall
LDFLAGS = -shared
-LIBS = -ldl
+LDLIBS = -ldl
+INST_BIN = install -c -m755
+INST_LIB = install -c -m644
+INST_MAN = install -c -m644
+INST_BIN = install -c -m755
+MKDIRS = install -d -m755
+DESTDIR =
-SOURCES = noip.c uopen.c
-TARGETS = noip.so uopen.so
+LIBS = noip.so uopen.so
+MAN1 = $(patsubst %.so, %.1, $(LIBS))
+SCRIPTS = $(patsubst %.so, %, $(LIBS))
+TARGETS = $(LIBS) $(SCRIPTS)
+SOURCES = noip.c uopen.c withlib.in
all: $(TARGETS)
%.o: %.c
$(CC) -c $(CFLAGS) $< -o $@
noip.so: $(patsubst %.c, %.o, noip.c)
- $(LD) $(LDFLAGS) $< $(LIBS) -o $@
+ $(LD) $(LDFLAGS) $< $(LDLIBS) -o $@
uopen.so: $(patsubst %.c, %.o, uopen.c)
- $(LD) $(LDFLAGS) $< $(LIBS) -o $@
+ $(LD) $(LDFLAGS) $< $(LDLIBS) -o $@
+$(SCRIPTS): withlib.in
+ for i in $(SCRIPTS); do \
+ sed "s/@lib@/$$i/" withlib.in >$$i.new || exit 1; \
+ mv $$i.new $$i || exit 1; \
+ done
+install: all
+ $(MKDIRS) $(addprefix $(DESTDIR), \
+ $(bindir) $(libdir) $(bindir) $(man1dir))
+ $(INST_LIB) $(LIBS) $(DESTDIR)$(libdir)
+ $(INST_BIN) $(SCRIPTS) $(DESTDIR)$(bindir)
+ $(INST_MAN) $(MAN1) $(DESTDIR)$(man1dir)
+uninstall:
+ rm -f $(addprefix $(DESTDIR)$(libdir)/, $(LIBS))
+ rm -f $(addprefix $(DESTDIR)$(bindir)/, $(SCRIPTS))
+ rm -f $(addprefix $(DESTDIR)$(man1dir)/, $(MAN1))
+DISTDIR = $(PACKAGE)-$(VERSION)
+DISTTAR = $(DISTDIR).tar.gz
+distdir:
+ rm -rf $(DISTDIR)
+ mkdir $(DISTDIR)
+ ln $(SOURCES) $(MAN1) Makefile $(DISTDIR)
+ mkdir $(DISTDIR)/debian
+ ln debian/rules debian/copyright debian/changelog debian/control \
+ debian/*.install $(DISTDIR)/debian
+dist: distdir
+ tar chozf $(DISTTAR) $(DISTDIR)
+ rm -rf $(DISTDIR)
clean:
- rm -f $(OBJECTS) $(TARGETS)
\ No newline at end of file
+ rm -f *.o $(OBJECTS) $(TARGETS)
--- /dev/null
+preload-hacks (1.0.0) experimental; urgency=low
+
+ * Newly written preload hacks, specially for you.
+
+ -- Mark Wooding <mdw@nsict.org> Fri, 6 May 2005 10:17:24 +0100
--- /dev/null
+Source: preload-hacks
+Section: utils
+Priority: extra
+Maintainer: Mark Wooding <mdw@nsict.org>
+Standards-Version: 3.1.1
+
+Package: uopen
+Architecture: any
+Suggests: fw
+Depends: ${shlibs:Depends}
+Description: Automatic connection to Unix-domain sockets
+ uopen is a preload hack which detects attempts to open(2) Unix-domain
+ sockets and connects to the socket instead. This can be used, for
+ example, to implement a random-signature daemon.
+
+Package: noip
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Run programs with limited network access
+ noip is a preload hack which traps socket calls and forces (most)
+ attempts to use TCP/IP to use Unix-domain sockets in a private directory
+ instead. This can be used to help secure systems which use IP sockets
+ unnecessarily. It can also be used to limit access to forwarded SSH
+ ports. Full configuration is available via a file or environment
+ variables.
--- /dev/null
+Preload-hacks are copyright (c) 2003 Straylight/Edgeware.
+
+Preload-hacks are free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+Preload-hacks are distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have a copy of the GNU General Public License in
+/usr/share/common-licenses/GPL; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+USA.
--- /dev/null
+usr/bin/noip
+usr/lib/noip.so
+usr/share/man/man1/noip.1
--- /dev/null
+#! /usr/bin/make -f
+
+export DH_COMPAT = 4
+
+build:
+ make clean
+ make
+ touch build
+
+clean:
+ dh_clean
+ make clean
+
+install: build
+ dh_clean
+ make install \
+ prefix=/usr \
+ mandir=/usr/share/man \
+ DESTDIR=`pwd`/debian/tmp
+ dh_install --sourcedir=debian/tmp
+ rm -rf debian/tmp
+
+binary-indep:
+
+binary-arch: install
+ dh_testdir -a
+ dh_testroot -a
+ dh_compress -a
+ dh_installdocs -a
+ dh_strip -a
+ dh_shlibdeps -a
+ dh_gencontrol -a
+ dh_fixperms -a
+ dh_installdeb -a
+ dh_md5sums -a
+ dh_builddeb -a
+
+binary: binary-indep binary-arch
+
+source:
+ rm -rf deb-dist.tar.gz =deb=
+ make dist DISTTAR=deb-dist.tar.gz
+ mkdir =deb=
+ cd =deb=; tar xvfz ../deb-dist.tar.gz
+ d=`pwd`; cd ..; dpkg-source -i -i'/\.svn/' -b $$d/=deb=/*
+ rm -rf deb-dist.tar.gz =deb=
+
+.PHONY: binary binary-arch binary-indep clean install source
--- /dev/null
+usr/bin/uopen
+usr/lib/uopen.so
+usr/share/man/man1/uopen.1
+++ /dev/null
-#! /bin/sh
-
-set -e
-export LD_PRELOAD=$LD_PRELOAD${LD_PRELOAD+ }./noip.so
-[ $# -eq 0 ] && set -- "$SHELL"
-exec "$@"
#! /bin/sh
set -e
-export LD_PRELOAD=$LD_PRELOAD${LD_PRELOAD+ }./uopen.so
+export LD_PRELOAD=$LD_PRELOAD${LD_PRELOAD+ }@lib@.so
[ $# -eq 0 ] && set -- "${SHELL-/bin/sh}"
exec "$@"