Re: ImageMagick and chroot

Previous thread: Re: keep state in pf by Brian A. Seklecki on Thursday, May 17, 2007 - 3:12 pm. (1 message)

Next thread: Re: SFTP no autocompletion? by Ben on Thursday, May 17, 2007 - 5:27 pm. (1 message)
From: Marcos Laufer
Date: Thursday, May 17, 2007 - 4:14 pm

Hello ,

The script just worked . Thanks a lot Aiko for that script, and thanks to 
everybody for  the suggestions and help. Now the convert command 
runs , and i can see the web application shows me an image where it
supposed to be showd, but i still have some errors though , but i 
guess they are about the programming of this web application . 
I know that on the old server (lionux)  it  worked just fine with 
the code as it is (php5), but maybe has to be changed because 
of the chroot , i don't know , i'll try to contact the programmer to 
let him see it .
 
Thanks ,
Marcos 

----- Original Message ----- 
From: "Aiko Barz" <aiko@haeckser.de>
To: "Marcos Laufer" <marcos@ipv4networks.com>
Cc: <misc@openbsd.org>
Sent: Thursday, May 17, 2007 2:51 PM


Yes, run the following script and you are done.

#!/bin/sh


CHROOT="/var/www"


# Make dirs
[ ! -d "$CHROOT/bin" ]              && mkdir -p $CHROOT/bin
[ ! -d "$CHROOT/usr/local/bin" ]    && mkdir -p $CHROOT/usr/local/bin
[ ! -d "$CHROOT/usr/local/lib" ]    && mkdir -p $CHROOT/usr/local/lib
[ ! -d "$CHROOT/usr/lib" ]          && mkdir -p $CHROOT/usr/lib
[ ! -d "$CHROOT/usr/X11R6/lib" ]    && mkdir -p $CHROOT/usr/X11R6/lib/
[ ! -d "$CHROOT/usr/libexec" ]      && mkdir -p $CHROOT/usr/libexec
[ ! -d "$CHROOT/var/run" ]          && mkdir -p $CHROOT/var/run


SH="/bin/sh"
if [ -x $SH ]; then
    cp -f $SH $CHROOT/$SH
else
    echo "No shit. $SH not found! :)"
fi


LD_HINTS="/var/run/ld.so.hints"
if [ -f $LD_HINTS ]; then
    cp $LD_HINTS $CHROOT/$LD_HINTS
else
    echo "$LD_HINTS not found. Still wondering thou."
fi


CONVERT=$(which convert | awk '{print $1}')
if [ ! -z $CONVERT ] && [ -x $CONVERT ]; then
    cp -f $CONVERT $CHROOT/$CONVERT
    for i in $(ldd $CONVERT | awk '{if ($3 == "rlib") {print $7}}'); do
        if [ -f $i ]; then
            cp -f $i $CHROOT/$i
        fi
    done
else
    echo "convert not found."
    exit 1
fi


COMPOSITE=$(which composite | awk '{print $1}')
if [ ! -z ...
Previous thread: Re: keep state in pf by Brian A. Seklecki on Thursday, May 17, 2007 - 3:12 pm. (1 message)

Next thread: Re: SFTP no autocompletion? by Ben on Thursday, May 17, 2007 - 5:27 pm. (1 message)