comparison plugins/password/helpers/chgsaslpasswd.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 (cyrus user)
5 #define UID 96
6 // set the path to saslpasswd or saslpasswd2
7 #define CMD "/usr/sbin/saslpasswd2"
8
9 /* INSTALLING:
10 gcc -o chgsaslpasswd chgsaslpasswd.c
11 chown cyrus.apache chgsaslpasswd
12 strip chgsaslpasswd
13 chmod 4550 chgsaslpasswd
14 */
15
16 main(int argc, char *argv[])
17 {
18 int rc,cc;
19
20 cc = setuid(UID);
21 rc = execvp(CMD, argv);
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 }