/* $Header: /CVSROOT/debris/cmds/chmod.c,v 1.2 2005/08/15 01:04:52 tino Exp $ * * DebRIS: DEBian Remote Install Scripter * *chmod ... * * $Log: chmod.c,v $ * Revision 1.2 2005/08/15 01:04:52 tino * all functions now have a prefix (dris_) * * Revision 1.1 2005/08/13 22:59:12 tino * additional functions, see ChangeLog */ static int driscmd_chmod(char *args) { const char *n, *file; unsigned long mode; char *end; int ret; n = dris_nextarg(&args); mode = strtoul(n, &end, 8); if (*end || !*n) return dris_err("debris sends funny mode: %s", n); ret = 0; while ((file=dris_nextarg(&args))!=0) if (chmod(args, mode)) ret = dris_err("chmod: cannot set %lo to %s", mode, args); return ret; }