
Путь: Toys/Other, команды версии: Ver.4 Ver.9 chcon Комментарии в файле chcon.c :
Исходный текст в файле chcon.c #define FOR_chcon
#include "toys.h"
static int do_chcon(struct dirtree *try)
{
char *path, *con = *toys.optargs;
if (!dirtree_notdotdot(try)) return 0;
path = dirtree_path(try, 0);
if (toys.optflags & FLAG_v) printf("chcon '%s' to %s\n", path, con);
if (-1 == ((toys.optflags & FLAG_h) ? lsetfilecon : setfilecon)(path, con))
perror_msg("'%s' to %s", path, con);
free(path);
return (toys.optflags & FLAG_R)*DIRTREE_RECURSE;
}
void chcon_main(void)
{
char **file;
for (file = toys.optargs+1; *file; file++) dirtree_read(*file, do_chcon);
} |
![]() |