1
/* $Id: chown.c 427 2007-03-08 00:09:47Z steve-beattie $ */
4
* Copyright (C) 2002-2005 Novell/SUSE
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License as
8
* published by the Free Software Foundation, version 2 of the
15
#include <sys/types.h>
20
int main(int argc, char *argv[])
25
fprintf(stderr, "usage: %s file username|uid\n",
30
if (sscanf(argv[2], "%d", &uid) != 1) {
31
fprintf(stderr, "FAIL: bad uid %s\n", argv[2]);
35
if (chown(argv[1], uid, -1) == -1) {
36
fprintf(stderr, "FAIL: chown %s %d failed - %s\n",
37
argv[1], uid, strerror(errno));