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>
19
#include <linux/unistd.h>
21
#include "changehat.h"
23
int main(int argc, char *argv[])
28
fprintf(stderr, "usage: %s profile file\n",
33
/* change hat if hatname != nochange */
34
if (strcmp(argv[1], "nochange") != 0){
35
if (change_hat(argv[1], SD_ID_MAGIC+1)) {
36
fprintf(stderr, "FAIL: changehat %s failed - %s\n",
37
argv[1], strerror(errno));
42
if (strcmp(argv[1], "nochange") != 0){
43
if (change_hat(NULL, SD_ID_MAGIC+1)) {
44
fprintf(stderr, "FAIL: changehat %s failed - %s\n",
45
argv[1], strerror(errno));
50
rc = do_open(argv[2]);