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 mode\n",
28
if (sscanf(argv[2], "%o", &mode) != 1) {
29
fprintf(stderr, "FAIL: bad mode %s\n", argv[2]);
33
if (chmod(argv[1], mode) == -1) {
34
fprintf(stderr, "FAIL: fchmod %s %o failed - %s\n",
35
argv[1], mode, strerror(errno));