diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-03-07 11:19:06 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-03-07 11:19:06 +0000 |
| commit | a7c3c8dc14e19dcf6fb56495b3c09bc41a66acf9 (patch) | |
| tree | 0c9ee87dff342e005102e00f497c5d88bf844e01 /plugins/password/helpers/chgvirtualminpasswd.c | |
| parent | fe3e81a373f8018745d4473f0690ac9a7f015bb3 (diff) | |
- Helper files moved to helpers/ directory from drivers/
git-svn-id: https://svn.roundcube.net/trunk@5977 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins/password/helpers/chgvirtualminpasswd.c')
| -rw-r--r-- | plugins/password/helpers/chgvirtualminpasswd.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/plugins/password/helpers/chgvirtualminpasswd.c b/plugins/password/helpers/chgvirtualminpasswd.c new file mode 100644 index 000000000..4e2299c66 --- /dev/null +++ b/plugins/password/helpers/chgvirtualminpasswd.c @@ -0,0 +1,28 @@ +#include <stdio.h> +#include <unistd.h> + +// set the UID this script will run as (root user) +#define UID 0 +#define CMD "/usr/sbin/virtualmin" + +/* INSTALLING: + gcc -o chgvirtualminpasswd chgvirtualminpasswd.c + chown root.apache chgvirtualminpasswd + strip chgvirtualminpasswd + chmod 4550 chgvirtualminpasswd +*/ + +main(int argc, char *argv[]) +{ + int rc,cc; + + cc = setuid(UID); + rc = execvp(CMD, argv); + if ((rc != 0) || (cc != 0)) + { + fprintf(stderr, "__ %s: failed %d %d\n", argv[0], rc, cc); + return 1; + } + + return 0; +} |
