你仍然表示,将在后台运行的东西 [英] u said still it will run something in background

查看:133
本文介绍了你仍然表示,将在后台运行的东西的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main (int argc, char **argv) {
    char *command;
    if (argc != 2) {
        fprintf (stderr, "Wrong number of arguments\n");
        return 1;
    }
    if ((command = malloc (strlen (argv[1]) + 6)) == NULL) {
        fprintf (stderr, "Could not allocate memory\n");
        return 1;
    }
    strcpy (command, "echo ");
    strcat(command,argv[1]);
    system(command);
    free (command);
    return 0;
}

如何修补这个code所以不会是给用户的任何privelige
事情是通过运行此我可以接取作为root用户如何编辑这使这不会发生。

how to patch this code so there wont be any privelige given to user the thing is by running this i can get acess as root user how to edit this so that this will not happen

推荐答案

个seteuid(2) 致电前,放弃root特权系统(3)

这篇关于你仍然表示,将在后台运行的东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆