comparison plugins/password/helpers/chgvirtualminpasswd.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/virtualmin"
7
8 /* INSTALLING:
9 gcc -o chgvirtualminpasswd chgvirtualminpasswd.c
10 chown root.apache chgvirtualminpasswd
11 strip chgvirtualminpasswd
12 chmod 4550 chgvirtualminpasswd
13 */
14
15 main(int argc, char *argv[])
16 {
17 int rc,cc;
18
19 cc = setuid(UID);
20 rc = execvp(CMD, argv);
21 if ((rc != 0) || (cc != 0))
22 {
23 fprintf(stderr, "__ %s: failed %d %d\n", argv[0], rc, cc);
24 return 1;
25 }
26
27 return 0;
28 }