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>
16
#include <sys/ptrace.h>
22
#include "changehat.h"
27
int main(int argc, char *argv[])
33
fprintf(stderr, "usage: %s\n", argv[0]);
40
if (pid){ /* parent */
43
while (wait(&status) != pid);
44
retval = WEXITSTATUS(status);
46
/* change profile so that ptrace can fail */
47
if (change_hat(argv[1], SD_ID_MAGIC + 1) == -1 &&
49
/* confined process failed to change_hat */
50
fprintf(stderr, "FAIL: changehat %s failed - %s\n",
51
argv[1], strerror(errno));
54
if (ptrace(PTRACE_TRACEME, 0, 0, 0) == -1){
55
fprintf(stderr, "FAIL: ptrace failed - %s\n",