michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include michael@0: #include michael@0: michael@0: int main(int argc, char **argv) michael@0: { michael@0: if (argc != 2) michael@0: return 1; michael@0: michael@0: uid_t realuser = getuid(); michael@0: char uidstring[20]; michael@0: snprintf(uidstring, 19, "%i", realuser); michael@0: uidstring[19] = '\0'; michael@0: michael@0: return execl("/usr/sbin/chown", michael@0: "/usr/sbin/chown", "-R", "-h", uidstring, argv[1], (char*) 0); michael@0: }