* terms of the GNU Lesser General Public License
* (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html)
*
* terms of the GNU Lesser General Public License
* (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html)
*
* Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
* license for use of this work by or on behalf of the US Government.
* Export of this program may require a license from the United States
* Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
* license for use of this work by or on behalf of the US Government.
* Export of this program may require a license from the United States
- err = _sysio_permitted(parent->p_base->pb_ino, X_OK);
- if (err)
- return err;
+ /*
+ * Sometimes we don't want to check permissions. At initialization
+ * time, for instance.
+ */
+ if (check_permissions) {
+ err = _sysio_permitted(parent, X_OK);
+ if (err)
+ return err;
+ }
* ND_NOFOLLOW symbolic links are not followed
* ND_NEGOK if terminal/leaf does not exist, return
* path node (alias) anyway.
* ND_NOFOLLOW symbolic links are not followed
* ND_NEGOK if terminal/leaf does not exist, return
* path node (alias) anyway.
* not tolerate errors here or else risk leaving the process
* in a very unexpected location. We abort then unless all goes
* well.
*/
icwd = _sysio_init_cwd;
_sysio_init_cwd = NULL;
* not tolerate errors here or else risk leaving the process
* in a very unexpected location. We abort then unless all goes
* well.
*/
icwd = _sysio_init_cwd;
_sysio_init_cwd = NULL;
- if (_sysio_namei(NULL, icwd, 0, NULL, &parent) != 0 ||
- _sysio_p_chdir(parent) != 0)
+ parent = nd->nd_root;
+ if (!parent)
+ abort();
+ (void )_sysio_namei(nd->nd_root, icwd, 0, NULL, &parent);
+ if (_sysio_p_chdir(parent) != 0)
nameidata.nd_slicnt = nd->nd_slicnt + 1;
err =
_sysio_path_walk(nd->nd_pno->p_parent, &nameidata);
nameidata.nd_slicnt = nd->nd_slicnt + 1;
err =
_sysio_path_walk(nd->nd_pno->p_parent, &nameidata);