Received: from mail.remote.org (mail@visby.remote.org [212.227.14.25]) by hub.org (8.10.1/8.10.1) with ESMTP id e6B72gW43074 for ; Tue, 11 Jul 2000 03:02:42 -0400 (EDT) Received: from localhost by mail.remote.org with local-rmail id 13Bu40-0002fy-00; Tue, 11 Jul 2000 09:02:40 +0200 Received: from sqrt by eldorado.remote.org with local (Exim 2.02 #1) id 13Bu2P-0003zM-00; Tue, 11 Jul 2000 09:01:01 +0200 Date: Tue, 11 Jul 2000 09:01:01 +0200 From: Jochen Topf To: Gree3776@rowan.edu Cc: pgsql-admin@postgresql.org Subject: Re: Running Postgres 7.0.2 in a chroot environment Message-ID: <20000711090101.A15331@eldorado.remote.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i X-Archive-Number: 200007/47 I didn't quite follow everything you did, it looks a lot more complicated then what is needed. Maybe some tips will get you on the right path: 1) You can give arguments to a program started by su by quoting, like: su user -c 'program arg1 arg2' 2) argv[0] should be the name of the program and not the first argument. 3) The 'chroot' command (at least on my system here) does *only* a chroot system call and starts a shell. This is *not* enough to be secure. At least you have to do a chdir("/") after the chroot(). 4) There a programs around which do a chroot, chdir("/") and the setuid/gid to something sensible and start another programs. I have no reference handy but look around on freshmeat or the big FTP archives. Using chroot in itself is not enough! If you don't really know what you are doing and do kludgy things like the ones you describe in your posting, you will probabely create more security holes then you will fix. Jochen -- Jochen Topf - jochen@remote.org - http://www.remote.org/jochen/