#include #include // perror int main(int argc, char* argv[]) { for (int i = 1; i < argc; i++) { struct stat buf; if(stat(argv[i], &buf) < 0) { perror("stat"); return 1; } if (chmod(argv[i], (buf.st_mode | S_IWGRP) & ~S_IXOTH) < 0) { perror("chmod"); return 2; } } }