updated
authorChristian Urban <christian dot urban at kcl dot ac dot uk>
Tue, 11 Oct 2016 22:15:22 +0100
changeset 478 6b7849a12d98
parent 477 b2c5a721f360
child 479 f76074ed6c9e
updated
progs/C6.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/progs/C6.c	Tue Oct 11 22:15:22 2016 +0100
@@ -0,0 +1,29 @@
+#include <stdio.h>
+#include <string.h>
+
+int main(void)
+{
+    char buff[15];
+    int pass = 0;
+
+    printf("\n Enter the password : \n");
+    gets(buff);
+
+    if(strcmp(buff, "thegeekstuff"))
+    {
+        printf ("\n Wrong Password \n");
+    }
+    else
+    {
+        printf ("\n Correct Password \n");
+        pass = 1;
+    }
+
+    if(pass)
+    {
+       /* Now Give root or admin rights to user*/
+        printf ("\n Root privileges given to the user \n");
+    }
+
+    return 0;
+}