Skip to content
Snippets Groups Projects
Commit faeac611 authored by Phil Schwan's avatar Phil Schwan
Browse files

b=3359

r=lee@sandia.gov

libsysio fixes which always apply the umask before calling liblustre.
With these changes, liblustre can stop worrying about the umask entirely.
parent 0a72bda9
No related branches found
No related tags found
No related merge requests found
...@@ -76,6 +76,8 @@ SYSIO_INTERFACE_NAME(mkdir)(const char *path, mode_t mode) ...@@ -76,6 +76,8 @@ SYSIO_INTERFACE_NAME(mkdir)(const char *path, mode_t mode)
err = -EROFS; err = -EROFS;
goto error; goto error;
} }
mode |= S_IFDIR;
mode &= ~(_sysio_umask & 0777); /* apply umask */
err = (*pno->p_parent->p_base->pb_ino->i_ops.inop_mkdir)(pno, mode); err = (*pno->p_parent->p_base->pb_ino->i_ops.inop_mkdir)(pno, mode);
error: error:
P_RELE(pno); P_RELE(pno);
......
...@@ -80,13 +80,17 @@ PREPEND(__, SYSIO_INTERFACE_NAME(xmknod))(int __ver, ...@@ -80,13 +80,17 @@ PREPEND(__, SYSIO_INTERFACE_NAME(xmknod))(int __ver,
} }
/* /*
* Support only character-special and fifos right now. * Support only regular, character-special and fifos right now.
* (mode & S_IFMT) == 0 is the same as S_IFREG.
*/ */
if (!(S_ISCHR(mode) || S_ISFIFO(mode))) { if ((mode & S_IFMT) &&
!(S_ISREG(mode) || S_ISCHR(mode) || S_ISFIFO(mode))) {
err = -EINVAL; err = -EINVAL;
goto out; goto out;
} }
mode &= ~(_sysio_umask & 0777); /* apply umask */
INTENT_INIT(&intent, INT_CREAT, &mode, NULL); INTENT_INIT(&intent, INT_CREAT, &mode, NULL);
err = _sysio_namei(_sysio_cwd, path, ND_NEGOK, &intent, &pno); err = _sysio_namei(_sysio_cwd, path, ND_NEGOK, &intent, &pno);
if (err) if (err)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment