caller_uid = fs_m_in.REQ_UID;
caller_gid = fs_m_in.REQ_GID;
- /* Temporarily open the dir. */
- if ( (ldirp = get_inode(fs_dev, fs_m_in.REQ_INODE_NR)) == NIL_INODE) {
- return(EINVAL);
- }
-
/* Copy the link name's last component */
len = MFS_MIN(fs_m_in.REQ_PATH_LEN, sizeof(string));
r = sys_datacopy(FS_PROC_NR, (vir_bytes) fs_m_in.REQ_PATH,
if (r != OK) return r;
MFS_NUL(string, len, sizeof(string));
+ /* Temporarily open the dir. */
+ if ( (ldirp = get_inode(fs_dev, fs_m_in.REQ_INODE_NR)) == NIL_INODE) {
+ return(EINVAL);
+ }
+
/* Create the inode for the symlink. */
sip = new_node_o(ldirp, string, (mode_t) (I_SYMBOLIC_LINK | RWX_MODES),
(zone_t) 0);
fs_m_in.REQ_INODE_NR, fs_dev);
#endif
- /* Temporarily open the dir. */
- if ( (ldirp = get_inode(fs_dev, fs_m_in.REQ_INODE_NR)) == NIL_INODE) {
- return(EINVAL);
- }
-
/* Copy the link name's last component */
len = MFS_MIN(fs_m_in.REQ_PATH_LEN, sizeof(string));
r = sys_safecopyfrom(FS_PROC_NR, fs_m_in.REQ_GRANT, 0,
if (r != OK) return r;
MFS_NUL(string, len, sizeof(string));
+ /* Temporarily open the dir. */
+ if ( (ldirp = get_inode(fs_dev, fs_m_in.REQ_INODE_NR)) == NIL_INODE) {
+ return(EINVAL);
+ }
+
/* Create the inode for the symlink. */
sip = new_node_s(ldirp, string, (mode_t) (I_SYMBOLIC_LINK | RWX_MODES),
(zone_t) 0);
dirp = *pdirp;
- /* If 'string' is empty, yield same inode straight away. */
- if (string[0] == '\0') { return(get_inode(dirp->i_dev, (int) dirp->i_num)); }
-
/* Check for NIL_INODE. */
if (dirp == NIL_INODE) { return(NIL_INODE); }
+ /* If 'string' is empty, yield same inode straight away. */
+ /* This code won't trigger anymore with the current VFS path lookup logic. */
+ if (string[0] == '\0') { return(get_inode(dirp->i_dev, (int) dirp->i_num)); }
+
/* If 'string' is not present in the directory, signal error. */
if ( (r = search_dir_nocheck(dirp, string, &numb, LOOK_UP)) != OK) {
err_code = r;
dirp = *pdirp;
- /* If 'string' is empty, yield same inode straight away. */
- if (string[0] == '\0') { return(get_inode(dirp->i_dev, (int) dirp->i_num)); }
-
/* Check for NIL_INODE. */
if (dirp == NIL_INODE) { return(NIL_INODE); }
+ /* If 'string' is empty, yield same inode straight away. */
+ if (string[0] == '\0') { return(get_inode(dirp->i_dev, (int) dirp->i_num)); }
+
/* If 'string' is not present in the directory, signal error. */
if ( (r = search_dir(dirp, string, &numb, LOOK_UP)) != OK) {
err_code = r;