Skip to content

Commit

Permalink
hfsplus: drop ACL support
Browse files Browse the repository at this point in the history
The HFS+ Access Control Lists have not worked at all for the past five
years, and nobody seems to have noticed.  Besides, POSIX draft ACLs are
not compatible with MacOS.  Drop the feature entirely.

Link: http://lkml.kernel.org/r/20180714190608.wtnmmtjqeyladkut@eaf
Signed-off-by: Ernesto A. Fernández <[email protected]>
Acked-by: Christoph Hellwig <[email protected]>
Cc: Viacheslav Dubeyko <[email protected]>
Cc: Jan Kara <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
eafer authored and torvalds committed Aug 22, 2018
1 parent afd6c9e commit f168d9f
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 232 deletions.
15 changes: 0 additions & 15 deletions fs/hfsplus/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,3 @@ config HFSPLUS_FS
MacOS 8. It includes all Mac specific filesystem data such as
data forks and creator codes, but it also has several UNIX
style features such as file ownership and permissions.

config HFSPLUS_FS_POSIX_ACL
bool "HFS+ POSIX Access Control Lists"
depends on HFSPLUS_FS
select FS_POSIX_ACL
help
POSIX Access Control Lists (ACLs) support permissions for users and
groups beyond the owner/group/world scheme.

It needs to understand that POSIX ACLs are treated only under
Linux. POSIX ACLs doesn't mean something under Mac OS X.
Mac OS X beginning with version 10.4 ("Tiger") support NFSv4 ACLs,
which are part of the NFSv4 standard.

If you don't know what Access Control Lists are, say N
2 changes: 0 additions & 2 deletions fs/hfsplus/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ obj-$(CONFIG_HFSPLUS_FS) += hfsplus.o
hfsplus-objs := super.o options.o inode.o ioctl.o extents.o catalog.o dir.o btree.o \
bnode.o brec.o bfind.o tables.o unicode.o wrapper.o bitmap.o part_tbl.o \
attributes.o xattr.o xattr_user.o xattr_security.o xattr_trusted.o

hfsplus-$(CONFIG_HFSPLUS_FS_POSIX_ACL) += posix_acl.o
28 changes: 0 additions & 28 deletions fs/hfsplus/acl.h

This file was deleted.

9 changes: 2 additions & 7 deletions fs/hfsplus/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "hfsplus_fs.h"
#include "hfsplus_raw.h"
#include "xattr.h"
#include "acl.h"

static inline void hfsplus_instantiate(struct dentry *dentry,
struct inode *inode, u32 cnid)
Expand Down Expand Up @@ -455,7 +454,7 @@ static int hfsplus_symlink(struct inode *dir, struct dentry *dentry,
if (res)
goto out_err;

res = hfsplus_init_inode_security(inode, dir, &dentry->d_name);
res = hfsplus_init_security(inode, dir, &dentry->d_name);
if (res == -EOPNOTSUPP)
res = 0; /* Operation is not supported. */
else if (res) {
Expand Down Expand Up @@ -496,7 +495,7 @@ static int hfsplus_mknod(struct inode *dir, struct dentry *dentry,
if (res)
goto failed_mknod;

res = hfsplus_init_inode_security(inode, dir, &dentry->d_name);
res = hfsplus_init_security(inode, dir, &dentry->d_name);
if (res == -EOPNOTSUPP)
res = 0; /* Operation is not supported. */
else if (res) {
Expand Down Expand Up @@ -567,10 +566,6 @@ const struct inode_operations hfsplus_dir_inode_operations = {
.mknod = hfsplus_mknod,
.rename = hfsplus_rename,
.listxattr = hfsplus_listxattr,
#ifdef CONFIG_HFSPLUS_FS_POSIX_ACL
.get_acl = hfsplus_get_posix_acl,
.set_acl = hfsplus_set_posix_acl,
#endif
};

const struct file_operations hfsplus_dir_operations = {
Expand Down
1 change: 0 additions & 1 deletion fs/hfsplus/hfsplus_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#define DBG_EXTENT 0x00000020
#define DBG_BITMAP 0x00000040
#define DBG_ATTR_MOD 0x00000080
#define DBG_ACL_MOD 0x00000100

#if 0
#define DBG_MASK (DBG_EXTENT|DBG_INODE|DBG_BNODE_MOD)
Expand Down
11 changes: 0 additions & 11 deletions fs/hfsplus/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "hfsplus_fs.h"
#include "hfsplus_raw.h"
#include "xattr.h"
#include "acl.h"

static int hfsplus_readpage(struct file *file, struct page *page)
{
Expand Down Expand Up @@ -267,12 +266,6 @@ static int hfsplus_setattr(struct dentry *dentry, struct iattr *attr)
setattr_copy(inode, attr);
mark_inode_dirty(inode);

if (attr->ia_valid & ATTR_MODE) {
error = posix_acl_chmod(inode, inode->i_mode);
if (unlikely(error))
return error;
}

return 0;
}

Expand Down Expand Up @@ -336,10 +329,6 @@ int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end,
static const struct inode_operations hfsplus_file_inode_operations = {
.setattr = hfsplus_setattr,
.listxattr = hfsplus_listxattr,
#ifdef CONFIG_HFSPLUS_FS_POSIX_ACL
.get_acl = hfsplus_get_posix_acl,
.set_acl = hfsplus_set_posix_acl,
#endif
};

static const struct file_operations hfsplus_file_operations = {
Expand Down
144 changes: 0 additions & 144 deletions fs/hfsplus/posix_acl.c

This file was deleted.

4 changes: 2 additions & 2 deletions fs/hfsplus/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,8 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
goto out_put_hidden_dir;
}

err = hfsplus_init_inode_security(sbi->hidden_dir,
root, &str);
err = hfsplus_init_security(sbi->hidden_dir,
root, &str);
if (err == -EOPNOTSUPP)
err = 0; /* Operation is not supported. */
else if (err) {
Expand Down
6 changes: 0 additions & 6 deletions fs/hfsplus/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,15 @@
*/

#include "hfsplus_fs.h"
#include <linux/posix_acl_xattr.h>
#include <linux/nls.h>
#include "xattr.h"
#include "acl.h"

static int hfsplus_removexattr(struct inode *inode, const char *name);

const struct xattr_handler *hfsplus_xattr_handlers[] = {
&hfsplus_xattr_osx_handler,
&hfsplus_xattr_user_handler,
&hfsplus_xattr_trusted_handler,
#ifdef CONFIG_HFSPLUS_FS_POSIX_ACL
&posix_acl_access_xattr_handler,
&posix_acl_default_xattr_handler,
#endif
&hfsplus_xattr_security_handler,
NULL
};
Expand Down
3 changes: 0 additions & 3 deletions fs/hfsplus/xattr.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,4 @@ ssize_t hfsplus_listxattr(struct dentry *dentry, char *buffer, size_t size);
int hfsplus_init_security(struct inode *inode, struct inode *dir,
const struct qstr *qstr);

int hfsplus_init_inode_security(struct inode *inode, struct inode *dir,
const struct qstr *qstr);

#endif
13 changes: 0 additions & 13 deletions fs/hfsplus/xattr_security.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include "hfsplus_fs.h"
#include "xattr.h"
#include "acl.h"

static int hfsplus_security_getxattr(const struct xattr_handler *handler,
struct dentry *unused, struct inode *inode,
Expand Down Expand Up @@ -72,18 +71,6 @@ int hfsplus_init_security(struct inode *inode, struct inode *dir,
&hfsplus_initxattrs, NULL);
}

int hfsplus_init_inode_security(struct inode *inode,
struct inode *dir,
const struct qstr *qstr)
{
int err;

err = hfsplus_init_posix_acl(inode, dir);
if (!err)
err = hfsplus_init_security(inode, dir, qstr);
return err;
}

const struct xattr_handler hfsplus_xattr_security_handler = {
.prefix = XATTR_SECURITY_PREFIX,
.get = hfsplus_security_getxattr,
Expand Down

0 comments on commit f168d9f

Please sign in to comment.