summaryrefslogtreecommitdiff
path: root/libnetfs/dir-mkdir.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnetfs/dir-mkdir.c')
-rw-r--r--libnetfs/dir-mkdir.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libnetfs/dir-mkdir.c b/libnetfs/dir-mkdir.c
index c0370b90..fdfde30c 100644
--- a/libnetfs/dir-mkdir.c
+++ b/libnetfs/dir-mkdir.c
@@ -25,7 +25,13 @@ error_t
netfs_S_dir_mkdir (struct protid *user, char *name, mode_t mode)
{
error_t err;
+
+ if (!user)
+ return EOPNOTSUPP;
+ mode &= ~(S_IFMT|S_ISPARE|S_ISVTX);
+ mode |= S_IFDIR;
+
mutex_lock (&user->po->np->lock);
err = netfs_attempt_mkdir (user->credential, user->po->np, name, mode);
mutex_unlock (&user->po->np->lock);