/*This is a simple script meant to help debug scripts supposed to run in chroot.stuff run in chroot usually isn't run as root, but it can be hard to debugsuch stuff. By using this small util you can execute what you want, with theuid of your choice.How to compile:gcc -o /glftpd/bin/droproot droproot.cHow to run:chroot /glftpd /bin/droproot <number> "something to run"Number must be between 1 and 65535.The "" is only needed if you wish to pass args to the script you wish totest.Examples:chroot /glftpd /bin/droproot /bin/my_script.sh <- valid - no argschroot /glftpd /bin/droproot /bin/my_script.sh l33tuser <- invalid - arg will not be passed.chroot /glftpd /bin/droproot "/bin/my_script.sh l33tuser" <- valid - arg will be passed.*/#include <stdlib.h>#include <stdio.h>#include <sys/types.h>#include <unistd.h>int main(int argc, char **argv) { int number; if ( argc < 3 ) { printf("syntax: %s <number> \"<command to run>\"\n", argv[0]); return 1; } number = atoi(argv[1]); if ( number <1 || number >65535 ) { printf("syntax: %s <number> \"<command to run>\"\n", argv[0]); printf("<number> must be between 1 and 65535\n"); return 1; } setuid(number); setgid(number); seteuid(number); setegid(number); return system(argv[2]);}