chroot

From: xx yy (newyork2000_10314@yahoo.com)
Date: Wed Apr 24 2002 - 09:53:00 EDT


Hi All:
i am trying to chroot pgpcertificate server. I am able
to run chroot command successfully. However i want to
be able chroot and ran the command with different uid
and gid than root. i have created a pgp user account
with /bin/False for shell. But it seems
i am unable to that i have little c program but i keep
getting /dev/null permission denied error when i run
it.
so how can i chroot and run the command in the chroot
with different uid other than root.
anyhelp is greatly appreciated
thanks
john

here is the setup i m using
i have copied over all files from /opt/PGPcertd/*
(this where i have original PGPcertificate server
installed) to /pgp/opt/PGPcertd/* ( jailed enviroment
for chroot) and usr/lib usr/lib/share files to the
chroot env including /dev/null.
/pgp/opt/PGPcertd/*
/pgp/usr
/pgp/usr/lib
/pgp/dev/null

more chrootpgp.c
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
main (argc, argv) {

    chroot("/pgp") ;

  chdir("/");

 setgid(102);
  //setgiroups(1,gidlist); // also, could use
initgroups

 setuid(12887);

  execl("/opt/PGPcertd/bin/pgpcertd","-s","-f",
"/opt/PGPcertd/etc/pgpcertd.conf
", NULL);
//setgid(102);
//setuid(12887);

}
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:24:15 EDT