2 * Security xattr support for devpts.
4 * Author: Stephen Smalley <sds@epoch.ncsc.mil>
5 * Copyright (c) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the Free
9 * Software Foundation; either version 2 of the License, or (at your option)
12 #include <linux/string.h>
14 #include <linux/security.h>
15 #include <linux/xattr.h>
18 devpts_xattr_security_list(struct inode *inode, char *list, size_t list_len,
19 const char *name, size_t name_len)
21 return security_inode_listsecurity(inode, list, list_len);
25 devpts_xattr_security_get(struct inode *inode, const char *name,
26 void *buffer, size_t size)
28 if (strcmp(name, "") == 0)
30 return security_inode_getsecurity(inode, name, buffer, size);
34 devpts_xattr_security_set(struct inode *inode, const char *name,
35 const void *value, size_t size, int flags)
37 if (strcmp(name, "") == 0)
39 return security_inode_setsecurity(inode, name, value, size, flags);
42 struct xattr_handler devpts_xattr_security_handler = {
43 .prefix = XATTR_SECURITY_PREFIX,
44 .list = devpts_xattr_security_list,
45 .get = devpts_xattr_security_get,
46 .set = devpts_xattr_security_set,