1
/* $Id: changehat_twice.c 61 2006-05-19 18:32:14Z steve-beattie $ */
4
* Copyright (C) 2002-2005 Novell/SUSE
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License as
8
* published by the Free Software Foundation, version 2 of the
15
#include <sys/types.h>
21
#include <linux/unistd.h>
23
#include "changehat.h"
25
int main(int argc, char *argv[])
30
fprintf(stderr, "usage: %s profile1 profile2 goodmagic|badmagic file\n",
35
/* change hat if hatname != nochange */
36
if (strcmp(argv[1], "nochange") != 0){
37
rc = change_hat(argv[1], SD_ID_MAGIC+1);
39
fprintf(stderr, "FAIL: changehat %s failed - %s\n",
40
argv[1], strerror(errno));
46
if (strcmp(argv[3], "badmagic") == 0){
50
if (strcmp(argv[1], "nochange") != 0){
51
rc = change_hat(argv[2], magic);
53
fprintf(stderr, "FAIL: changehat %s failed - %s\n",
54
argv[1], strerror(errno));
59
rc = do_open(argv[4]);