Date: Tue, 5 Aug 1997 13:37:46 -0400 (EDT) From: Nathan Dorfman <nathan@rtfm.net> To: andrsn@andrsn.stanford.edu Cc: omar@clifford.inch.com, brian@awfulhak.org, dwhite@resnet.uoregon.edu, nathan@senate.org, khetan@iafrica.com, freebsd-questions@FreeBSD.ORG Subject: Static (was Re: wu-ftpd doesn't compress...) Message-ID: <199708051737.NAA00663@limbo.rtfm.net> In-Reply-To: <Pine.BSF.3.96.970805102219.13094A-100000@andrsn.stanford.edu> from Annelise Anderson at "Aug 5, 97 10:26:57 am"
next in thread | previous in thread | raw e-mail | index | archive | help
>
>
> On Tue, 5 Aug 1997, Omar Thameen wrote:
>
> > On Sun, Aug 03, 1997 at 11:14:56AM -0700, Annelise Anderson wrote:
> > >
> > >
> > > On Sun, 3 Aug 1997, Brian Somers wrote:
> > >
> > > > > On Tue, 29 Jul 1997, Brian Somers wrote:
> > > > >
> > > > > > > Wouldn't you need to add compress and tar binaries to ~ftp/bin so they
> > > > > > > will get executed after the chroot() in an anonymous login?
> > > > > >
> > > > > > Yep, except you put them in ~ftp/usr/bin and create
> > > > > > ~ftp/usr/lib/libc.so.... too.
> > > > >
> > > > > Not if you yank them from /bin, they're statically linked there.
> > > >
> > >
> > > /usr/bin contains tar, bin, and compress on my system, of which
> > > only compress is dynamically linked according to ldd. /stand
> > > doesn't contain compress.
> > >
> > > /usr/bin/compress:
> > > -lc.3 => /usr/lib/libc.so.3.0 (0x801d000)
> > >
> > > I tried putting compress in /home/ftp/bin and in /home/ftp/usr/bin,
> > > with the associated library in /home/ftp/lib and /home/ftp/usr/lib,
> > > but "get junk.tar.Z" still doesn't work--it creates a 0 byte file,
> > > even with ftpcompress changed to /usr/bin for .Z.
> > > However "get junk.tar.gz" does work.
> > >
> > > Annelise
> >
> > You'll need to get the source for compress and compile it statically
> > (check the Makefile), then put it in the ~ftp/bin directory.
> >
> > Omar
>
> I have the source. I added LDFLAGS= -STATIC to the Makefile but it
> doesn't do anything. Here's the Makefile; I would appreciate some
> help on what to do to it, as I have no idea.
>
> # @(#)Makefile 8.2 (Berkeley) 4/17/94
>
> PROG= compress
> SRCS= compress.c zopen.c
> LINKS= ${BINDIR}/compress ${BINDIR}/uncompress
> MLINKS= compress.1 uncompress.1
>
> # XXX zopen is not part of libc
> # MAN3=zopen.3
>
> .include <bsd.prog.mk>
>
> Annelise
>
Straight out of man gcc (RTFM!! ;>):
Linker Options
-llibrary -nostartfiles -nostdlib -static -shared
-symbolic -Xlinker option -Wl,option -u symbol
...snip..
-static
On systems that support dynamic linking, this pre-
vents linking with the shared libraries. On other
systems, this option has no effect.
You capitalized it wrong :-) also look at the ld option, -Bstatic as
opposed to -Bdynamic. It depends on whether you're passing the option
to cc or ld, it seems, as they have different syntax. So just add
-static to CFLAGS and you should be fine.
________________ _______________________________
/ Nathan Dorfman V PGP: finger nathan@rtfm.net /
/ nathan@rtfm.net | http://www.rtfm.net /
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708051737.NAA00663>
