chmod 4755 (rwsr-xr-x) дает (rwxrwxrwx)

наконец, что прибыл: официальное руководство

0
задан 4 March 2018 в 19:34

6 ответов

Следуя за вопросом Zanna, я переместил файлы из общей папки, и теперь разрешения установлены правильно.

0
ответ дан 17 July 2018 в 19:34

Вы запускаете gcc как root по какой-то странной причине, но затем вы запускаете chmod в качестве обычного пользователя. У вас нет [прав на изменение прав call_shellcode, поскольку вы скомпилировали его как root, и поэтому разрешения остаются неизменными.

Не компилируйте как root! Не делайте ничего, как root, если вам не нужно.

3
ответ дан 17 July 2018 в 19:34

Из man chmod:

SETUID AND SETGID BITS chmod clears the set-group-ID bit of a regular file if the file's group ID does not match the user's effective group ID or one of the user's supplementary group IDs, unless the user has appropriate privileges. Additional restrictions may cause the set-user-ID and set-group-ID bits of MODE or RFILE to be ignored. This behavior depends on the policy and functionality of the underlying chmod system call. When in doubt, check the underlying system behavior.
0
ответ дан 17 July 2018 в 19:34

Следуя за вопросом Zanna, я переместил файлы из общей папки, и теперь разрешения установлены правильно.

0
ответ дан 23 July 2018 в 20:18

Вы запускаете gcc как root по какой-то странной причине, но затем вы запускаете chmod в качестве обычного пользователя. У вас нет [прав на изменение прав call_shellcode, поскольку вы скомпилировали его как root, и поэтому разрешения остаются неизменными.

Не компилируйте как root! Не делайте ничего, как root, если вам не нужно.

3
ответ дан 23 July 2018 в 20:18
  • 1
    Я просто попробовал gcc -o call_shellcode call_shellcode.c без sudo, и он все еще не работает – James Tan 4 March 2018 в 19:40
  • 2
    @JamesTan - файл call_shellcode уже существует и принадлежит root, вам нужно sudo rm call_shellcode перед запуском gcc в качестве обычного пользователя – Yaron 4 March 2018 в 19:42

Из man chmod:

SETUID AND SETGID BITS chmod clears the set-group-ID bit of a regular file if the file's group ID does not match the user's effective group ID or one of the user's supplementary group IDs, unless the user has appropriate privileges. Additional restrictions may cause the set-user-ID and set-group-ID bits of MODE or RFILE to be ignored. This behavior depends on the policy and functionality of the underlying chmod system call. When in doubt, check the underlying system behavior.
0
ответ дан 23 July 2018 в 20:18

Другие вопросы по тегам:

Похожие вопросы: