Mercurial > nomad
changeset 773:d2abe33adc4e
objstore: create should make sure it got a file type
Modes can lack the type (i.e., contain _NATTR_NOTYPE), but we cannot create
an unknown type so we error out.
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Mon, 30 Mar 2020 17:42:36 -0400 |
parents | 8604b3125e6c |
children | c651eb14e63b |
files | src/objstore/obj_ops.c |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/objstore/obj_ops.c Mon Mar 30 17:31:46 2020 -0400 +++ b/src/objstore/obj_ops.c Mon Mar 30 17:42:36 2020 -0400 @@ -472,8 +472,8 @@ if (diropen->qualified) return -EROFS; - /* grafts are created differently */ - if (NATTR_ISGRAFT(mode)) + /* must have a type, grafts are created differently */ + if (_NATTR_ISNOTYPE(mode) || NATTR_ISGRAFT(mode)) return -EINVAL; MXLOCK(&dir->lock);