/* * chown uid file ... */ #include #include #include #include #include struct passwd *pwd,*getpwnam(); struct stat stbuf; int uid; int status; main(argc, argv) char *argv[]; { register c; if(argc < 3) { printf("usage: chown uid file ...\n"); exit(4); } if(isnumber(argv[1])) { uid = atoi(argv[1]); goto cho; } if((pwd=getpwnam(argv[1])) == NULL) { printf("unknown user id: %s\n",argv[1]); exit(4); } uid = pwd->pw_uid; cho: for(c=2; c