Ciao a tutti, sto studiando la chmod, ma una riga mi risulta davvero poco chiara in questo esempio:

codice:
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>

int main(void) {
  struct stat statbuf;

  if (stat("pippo", &statbuf) < 0 ) {
    perror("errore in stat per pippo");
    exit(1);
  }
  
  if (chmod("pippo", (statbuf.st_mode & ~S_IXGRP) | S_ISGID) < 0 ) {
    perror("errore in chmod per pippo");
    exit(1);
  }

  if (chmod("pluto", S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ) < 0 ) {
    perror("errore in chmod per pluto");
    exit(1);
  }

  exit(0);
}
Ecco, la cosa che non mi è chiara è questo AND bit a bit:
(statbuf.st_mode & ~S_IXGRP)
in pratica non ho capito il motivo per cui viene fatto!

Ciao