+/* smram-linux-tool.c
+ * General SMRAM manipulation utility
+ * NetWatch system management mode administration console
+ *
+ * Copyright (c) 2008 Jacob Potter and Joshua Wise. All rights reserved.
+ * This program is free software; you can redistribute and/or modify it under
+ * the terms found in the file LICENSE in the root of this source tree.
+ *
+ */
+
+
#include <unistd.h>
#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
+#include <smram.h>
static struct option longopts[] = {
{ "open", no_argument, NULL, 'o' },
{
if (geteuid() != 0)
{
- printf("This program must be run as root, dumbass.\n");
+ printf("%s: This program must be run as root.\n", argv[0]);
return 1;
}
if (op & OP_SET)
{
- smram_aseg_set_state(do_open);
+ smram_aseg_set_state(do_open ? SMRAM_ASEG_OPEN : SMRAM_ASEG_SMMONLY);
}
return 0;