我写了一个简单的程序
当您运行此程序时,如果您不是root用户,请输入root密码,然后将uid更改为root
root
if (getuid()) { char *pass = getpass(""); //how to change uid to root ? }
root密码时如何将uid更改为root ?
c linux root uid
c ×1
linux ×1
root ×1
uid ×1