Whamcloud - gitweb
- symbolic link fixes related to intent smashing
authorbraam <braam>
Mon, 25 Nov 2002 22:20:35 +0000 (22:20 +0000)
committerbraam <braam>
Mon, 25 Nov 2002 22:20:35 +0000 (22:20 +0000)
- fixes Kevin Harlan's symbolic link bug

lustre/tests/setuid.c [new file with mode: 0644]

diff --git a/lustre/tests/setuid.c b/lustre/tests/setuid.c
new file mode 100644 (file)
index 0000000..04dba5e
--- /dev/null
@@ -0,0 +1,27 @@
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <errno.h>
+#include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/fsuid.h>
+
+int main(int argc, char ** argv)
+{
+        int rc, fsuid;
+
+        if (argc < 2) { 
+                printf("Usage %s fsuid\n", argv[0]);
+                return 1;
+        }
+
+        fsuid = strtoul(argv[2], NULL, 0);
+        rc = setfsuid(fsuid);
+        if (rc) { 
+                printf("mknod(%s) error: %s\n", argv[1], strerror(errno));
+        }
+        return rc;
+}