From 7f38f9afe11124aaabc5bbd16b51a93732b2f1de Mon Sep 17 00:00:00 2001 From: Kolja Waschk Date: Wed, 28 Nov 2007 20:20:59 +0000 Subject: [PATCH] [ 1838018 ] "Forbid" to run JTAG tools with suid root git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@801 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/src/jtag.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jtag/src/jtag.c b/jtag/src/jtag.c index 708011e4..6f812cb8 100644 --- a/jtag/src/jtag.c +++ b/jtag/src/jtag.c @@ -310,6 +310,12 @@ main( int argc, const char **argv ) int norc = 0; int help = 0; int version = 0; + + if(geteuid()==0 && getuid()!=0) + { + printf (_("'%s' must not be run suid root!\n"), PACKAGE); + return(-1); + }; #ifdef ENABLE_NLS /* l10n support */