Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/regress/sys/kern/getcwd Add permission checking (execute-onl...



details:   https://anonhg.NetBSD.org/src/rev/612b873bc338
branches:  trunk
changeset: 474554:612b873bc338
user:      sommerfeld <sommerfeld%NetBSD.org@localhost>
date:      Sun Jul 11 09:54:41 1999 +0000

description:
Add permission checking (execute-only innermost directory)

diffstat:

 regress/sys/kern/getcwd/getcwd.c |  15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diffs (29 lines):

diff -r e1e28d887e39 -r 612b873bc338 regress/sys/kern/getcwd/getcwd.c
--- a/regress/sys/kern/getcwd/getcwd.c  Sun Jul 11 09:27:23 1999 +0000
+++ b/regress/sys/kern/getcwd/getcwd.c  Sun Jul 11 09:54:41 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: getcwd.c,v 1.4 1999/06/19 18:02:06 sommerfeld Exp $ */
+/* $NetBSD: getcwd.c,v 1.5 1999/07/11 09:54:41 sommerfeld Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -260,6 +260,19 @@
        chdir ("/");
        rmdir ("/tmp/permdir/subdir");
        rmdir ("/tmp/permdir");
+
+       mkdir ("/tmp/permdir", 0755);
+       mkdir ("/tmp/permdir/subdir", 0711);
+       chdir ("/tmp/permdir/subdir");
+       
+       seteuid(altid);
+
+       CHECK("/tmp/permdir/subdir", __getcwd(kbuf, sizeof(kbuf)), 20, 0);
+
+       seteuid(0);
+       chdir ("/");
+       rmdir ("/tmp/permdir/subdir");
+       rmdir ("/tmp/permdir");
 }
 
 void



Home | Main Index | Thread Index | Old Index