Don't crash if the underlying VFS doesn't support ACL's
authorJelmer Vernooij <jelmer@samba.org>
Thu, 1 May 2003 01:35:23 +0000 (01:35 +0000)
committerJelmer Vernooij <jelmer@samba.org>
Thu, 1 May 2003 01:35:23 +0000 (01:35 +0000)
(This used to be commit 277fa587d596449a6ac15b440ae07d6707d758ac)

examples/VFS/skel.c

index fe6e0731efab8a870e813a167c3fd102b2abc7c8..0742caa6085502c3af27a8b190b4fffda96953e2 100644 (file)
@@ -232,11 +232,21 @@ static BOOL skel_set_nt_acl(struct files_struct *fsp, const char *name, uint32 s
 
 static BOOL skel_chmod_acl(struct connection_struct *conn, const char *name, mode_t mode)
 {
+       /* If the underlying VFS doesn't have ACL support... */
+       if (!default_vfs_ops.chmod_acl) {
+               errno = ENOSYS;
+               return -1;
+       }
        return default_vfs_ops.chmod_acl(conn, name, mode);
 }
 
 static BOOL skel_fchmod_acl(struct files_struct *fsp, int fd, mode_t mode)
 {
+       /* If the underlying VFS doesn't have ACL support... */
+       if (!default_vfs_ops.fchmod_acl) {
+               errno = ENOSYS;
+               return -1;
+       }
        return default_vfs_ops.fchmod_acl(fsp, fd, mode);
 }