Mercurial > hg > rc1
comparison plugins/password/helpers/chgdbmailusers.c @ 0:1e000243b222
vanilla 1.3.3 distro, I hope
| author | Charlie Root |
|---|---|
| date | Thu, 04 Jan 2018 15:50:29 -0500 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:1e000243b222 |
|---|---|
| 1 #include <stdio.h> | |
| 2 #include <unistd.h> | |
| 3 | |
| 4 // set the UID this script will run as (root user) | |
| 5 #define UID 0 | |
| 6 #define CMD "/usr/sbin/dbmail-users" | |
| 7 | |
| 8 /* INSTALLING: | |
| 9 gcc -o chgdbmailusers chgdbmailusers.c | |
| 10 chown root.apache chgdbmailusers | |
| 11 strip chgdbmailusers | |
| 12 chmod 4550 chgdbmailusers | |
| 13 */ | |
| 14 | |
| 15 main(int argc, char *argv[]) | |
| 16 { | |
| 17 int rc, cc; | |
| 18 | |
| 19 cc = setuid(UID); | |
| 20 rc = execvp(CMD, argv); | |
| 21 | |
| 22 if ((rc != 0) || (cc != 0)) | |
| 23 { | |
| 24 fprintf(stderr, "__ %s: failed %d %d\n", argv[0], rc, cc); | |
| 25 return 1; | |
| 26 } | |
| 27 | |
| 28 return 0; | |
| 29 } |
