标签:io ar linux type ui har return c oo
******test.c*******
#include<stdio.h>
#include<stdlib.h>
#include<sys/types.h>
#include<unistd.h>
int main(int argc, char** argv)
{
uid_t uid, euid;
uid = getuid();
euid = geteuid();
if (setreuid(euid, uid)) perror("setreuid");
system("command");
return 0;
}
/***********************/
编译:gcc -o test -Wall test.c
root下:chmod u+s test
标签:io ar linux type ui har return c oo
原文地址:http://www.cnblogs.com/feilv/p/4065551.html