/* hacked version of "uchown" to interpret PROM stuff */

/* Copyright 1996 by the Massachusetts Institute of Technology.
 *
 * Permission to use, copy, modify, and distribute this
 * software and its documentation for any purpose and without
 * fee is hereby granted, provided that the above copyright
 * notice appear in all copies and that both that copyright
 * notice and this permission notice appear in supporting
 * documentation, and that the name of M.I.T. not be used in
 * advertising or publicity pertaining to distribution of the
 * software without specific, written prior permission.
 * M.I.T. makes no representations about the suitability of
 * this software for any purpose.  It is provided "as is"
 * without express or implied warranty.
 */

/* This file implements the uchown command, which is a very simple wrapper
 * around the uchown system call, which is just like chown but without the
 * bounds checks on the uid and gid. */

static const char rcsid[] = "$Id: uchown.c,v 1.1 1996/12/11 09:01:49 ghudson Exp $";

#include <stdio.h>
#include <sys/types.h>
#include <sys/syscall.h>

#define UCHOWN_SYSCALL 206

int main(int argc, char **argv)
{
  int result;
  gid_t gid;

  if (argc != 2)
    {
      fprintf(stderr, "Usage: %s filename uid [gid]\n", argv[0]);
      return 1;
    }
  result = syscall(UCHOWN_SYSCALL, argv[1]);
  return 0;
}
