summaryrefslogtreecommitdiff
path: root/examples/VFS
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2003-05-01 01:35:56 +0000
committerJelmer Vernooij <jelmer@samba.org>2003-05-01 01:35:56 +0000
commit9bf2a5bde9f25b7e602ffb353d1bcd1da1e8975a (patch)
treeb7cc99849819fc658f7fba38f64f32a2cea8724a /examples/VFS
parentd2373e7dce03a933be465cfd006c20d2bcc6e758 (diff)
downloadsamba-9bf2a5bde9f25b7e602ffb353d1bcd1da1e8975a.tar.gz
samba-9bf2a5bde9f25b7e602ffb353d1bcd1da1e8975a.tar.bz2
samba-9bf2a5bde9f25b7e602ffb353d1bcd1da1e8975a.zip
Don't crash if the underlying VFS doesn't support ACL's
(This used to be commit a7520177b088589eec7f3989273020dab89d90b5)
Diffstat (limited to 'examples/VFS')
-rw-r--r--examples/VFS/skel.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/VFS/skel.c b/examples/VFS/skel.c
index fe6e0731ef..0742caa608 100644
--- a/examples/VFS/skel.c
+++ b/examples/VFS/skel.c
@@ -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);
}