From dbdde2e74bf94aef5f2158066e349fe07af6f1f4 Mon Sep 17 00:00:00 2001 From: Bill Joy Date: Mon, 18 May 1981 08:57:33 -0800 Subject: [PATCH] chaos change and also .. from rootdir change per jek SCCS-vsn: sys/kern/vfs_lookup.c 4.7 SCCS-vsn: sys/ufs/ffs/ufs_lookup.c 4.7 SCCS-vsn: sys/ufs/ufs/ufs_lookup.c 4.7 --- usr/src/sys/kern/vfs_lookup.c | 21 ++++++++++++--------- usr/src/sys/ufs/ffs/ufs_lookup.c | 21 ++++++++++++--------- usr/src/sys/ufs/ufs/ufs_lookup.c | 21 ++++++++++++--------- 3 files changed, 36 insertions(+), 27 deletions(-) diff --git a/usr/src/sys/kern/vfs_lookup.c b/usr/src/sys/kern/vfs_lookup.c index d0e6431729..9870e0c478 100644 --- a/usr/src/sys/kern/vfs_lookup.c +++ b/usr/src/sys/kern/vfs_lookup.c @@ -1,4 +1,4 @@ -/* vfs_lookup.c 4.6 81/04/28 */ +/* vfs_lookup.c 4.7 81/05/18 */ #include "../h/param.h" #include "../h/systm.h" @@ -32,9 +32,6 @@ int (*func)(); int i; dev_t d; off_t eo; -#ifdef CHAOS - extern long cdevpath; -#endif /* * If name starts with '/' start from @@ -63,12 +60,18 @@ cloop: return(dp); #ifdef CHAOS - if((dp->i_mode & IFMT) == IFCHR && - (cdevpath & (1 << major(dp->i_un.i_rdev)))) { - u.u_dirp--; + /* + * If the current node is a character + * special file with the SUID bit set, return anyway. + * This lets the Chaos open decode the rest of the name in its own + * peculiar way. jrl 3/81 + */ + if((dp->i_mode&(IFMT|ISUID)) == (IFCHR|ISUID)) { + u.u_dirp--; /* back up to the slash or null */ return(dp); } #endif + /* * If there is another component, * Gather up name into @@ -117,8 +120,8 @@ seloop: u.u_segflg = 1; eo = 0; bp = NULL; - if (dp == u.u_rdir && u.u_dent.d_name[0] == '.' && - u.u_dent.d_name[1] == '.' && u.u_dent.d_name[2] == 0) + if (dp == u.u_rdir && u.u_dbuf[0] == '.' && + u.u_dbuf[1] == '.' && u.u_dbuf[2] == 0) goto cloop; eloop: diff --git a/usr/src/sys/ufs/ffs/ufs_lookup.c b/usr/src/sys/ufs/ffs/ufs_lookup.c index 8cff88beb1..2dc81dc4b2 100644 --- a/usr/src/sys/ufs/ffs/ufs_lookup.c +++ b/usr/src/sys/ufs/ffs/ufs_lookup.c @@ -1,4 +1,4 @@ -/* ufs_lookup.c 4.6 81/04/28 */ +/* ufs_lookup.c 4.7 81/05/18 */ #include "../h/param.h" #include "../h/systm.h" @@ -32,9 +32,6 @@ int (*func)(); int i; dev_t d; off_t eo; -#ifdef CHAOS - extern long cdevpath; -#endif /* * If name starts with '/' start from @@ -63,12 +60,18 @@ cloop: return(dp); #ifdef CHAOS - if((dp->i_mode & IFMT) == IFCHR && - (cdevpath & (1 << major(dp->i_un.i_rdev)))) { - u.u_dirp--; + /* + * If the current node is a character + * special file with the SUID bit set, return anyway. + * This lets the Chaos open decode the rest of the name in its own + * peculiar way. jrl 3/81 + */ + if((dp->i_mode&(IFMT|ISUID)) == (IFCHR|ISUID)) { + u.u_dirp--; /* back up to the slash or null */ return(dp); } #endif + /* * If there is another component, * Gather up name into @@ -117,8 +120,8 @@ seloop: u.u_segflg = 1; eo = 0; bp = NULL; - if (dp == u.u_rdir && u.u_dent.d_name[0] == '.' && - u.u_dent.d_name[1] == '.' && u.u_dent.d_name[2] == 0) + if (dp == u.u_rdir && u.u_dbuf[0] == '.' && + u.u_dbuf[1] == '.' && u.u_dbuf[2] == 0) goto cloop; eloop: diff --git a/usr/src/sys/ufs/ufs/ufs_lookup.c b/usr/src/sys/ufs/ufs/ufs_lookup.c index 8cff88beb1..2dc81dc4b2 100644 --- a/usr/src/sys/ufs/ufs/ufs_lookup.c +++ b/usr/src/sys/ufs/ufs/ufs_lookup.c @@ -1,4 +1,4 @@ -/* ufs_lookup.c 4.6 81/04/28 */ +/* ufs_lookup.c 4.7 81/05/18 */ #include "../h/param.h" #include "../h/systm.h" @@ -32,9 +32,6 @@ int (*func)(); int i; dev_t d; off_t eo; -#ifdef CHAOS - extern long cdevpath; -#endif /* * If name starts with '/' start from @@ -63,12 +60,18 @@ cloop: return(dp); #ifdef CHAOS - if((dp->i_mode & IFMT) == IFCHR && - (cdevpath & (1 << major(dp->i_un.i_rdev)))) { - u.u_dirp--; + /* + * If the current node is a character + * special file with the SUID bit set, return anyway. + * This lets the Chaos open decode the rest of the name in its own + * peculiar way. jrl 3/81 + */ + if((dp->i_mode&(IFMT|ISUID)) == (IFCHR|ISUID)) { + u.u_dirp--; /* back up to the slash or null */ return(dp); } #endif + /* * If there is another component, * Gather up name into @@ -117,8 +120,8 @@ seloop: u.u_segflg = 1; eo = 0; bp = NULL; - if (dp == u.u_rdir && u.u_dent.d_name[0] == '.' && - u.u_dent.d_name[1] == '.' && u.u_dent.d_name[2] == 0) + if (dp == u.u_rdir && u.u_dbuf[0] == '.' && + u.u_dbuf[1] == '.' && u.u_dbuf[2] == 0) goto cloop; eloop: -- 2.20.1