2
* Copyright (C) 2002-2005 Novell/SUSE
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License as
6
* published by the Free Software Foundation, version 2 of the
13
#include <sys/types.h>
18
int main(int argc, char *argv[])
23
fprintf(stderr, "usage: %s file groupname|gid\n",
29
if (sscanf(argv[2], "%d", &gid) != 1) {
30
fprintf(stderr, "FAIL: bad gid %s\n", argv[2]);
34
if (chown(argv[1], -1, gid) == -1) {
35
fprintf(stderr, "FAIL: chgrp %s %d failed - %s\n",
36
argv[1], gid, strerror(errno));