X-Git-Url: http://git.joshuawise.com/netwatch.git/blobdiff_plain/99970893290223f2006c3a0c6f34ab9eaf5cb4c9..d5d3737996d3828397e02f0f953fbc5c9e63f709:/tools/smram-linux-tool.c?ds=sidebyside diff --git a/tools/smram-linux-tool.c b/tools/smram-linux-tool.c index 0d47bb4..02112a4 100644 --- a/tools/smram-linux-tool.c +++ b/tools/smram-linux-tool.c @@ -1,7 +1,19 @@ +/* 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 #include #include #include +#include static struct option longopts[] = { { "open", no_argument, NULL, 'o' }, @@ -24,7 +36,7 @@ int main(int argc, char **argv) { 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; } @@ -61,7 +73,7 @@ int main(int argc, char **argv) if (op & OP_SET) { - smram_aseg_set_state(do_open); + smram_aseg_set_state(do_open ? SMRAM_ASEG_OPEN : SMRAM_ASEG_SMMONLY); } return 0;