You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

chgdbmailusers.c 514B

1234567891011121314151617181920212223242526272829
  1. #include <stdio.h>
  2. #include <unistd.h>
  3. // set the UID this script will run as (root user)
  4. #define UID 0
  5. #define CMD "/usr/sbin/dbmail-users"
  6. /* INSTALLING:
  7. gcc -o chgdbmailusers chgdbmailusers.c
  8. chown root.apache chgdbmailusers
  9. strip chgdbmailusers
  10. chmod 4550 chgdbmailusers
  11. */
  12. main(int argc, char *argv[])
  13. {
  14. int rc, cc;
  15. cc = setuid(UID);
  16. rc = execvp(CMD, argv);
  17. if ((rc != 0) || (cc != 0))
  18. {
  19. fprintf(stderr, "__ %s: failed %d %d\n", argv[0], rc, cc);
  20. return 1;
  21. }
  22. return 0;
  23. }