Logo Search packages:      
Sourcecode: cowdancer version File versions  Download package


chown test */

/* for fchown */
#define _BSD_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int main(int argc, char** argv)
  uid_t uid=getuid();
  gid_t gid;
  int fid;
  /* test that the four args work. */
  if(argc < 5)
  gid=atoi(argv[1]);          /* get the gid to change to */
  chown(argv[2], uid, gid);
  fid=open(argv[3], O_RDONLY);
  //if (fchown(fid, uid, gid)!=-1)  /* this func will fail */
  //  return 1;
  lchown(argv[4], uid, gid);

  return 0;

Generated by  Doxygen 1.6.0   Back to index