2
* Copyright (C) 2008 Junjiro Okajima
4
* This program, aufs is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
* lookup functions in 'delegate' mode
22
* $Id: dlgt.c,v 1.1 2008/04/07 05:43:39 sfjro Exp $
25
//#include <linux/security.h>
28
/* ---------------------------------------------------------------------- */
30
struct au_lookup_one_len_args {
33
struct dentry *parent;
37
static void au_call_lookup_one_len(void *args)
39
struct au_lookup_one_len_args *a = args;
40
*a->errp = vfsub_lookup_one_len(a->name, a->parent, a->len);
43
struct dentry *au_lkup_one_dlgt(const char *name, struct dentry *parent,
44
int len, unsigned int flags)
46
struct dentry *dentry;
49
LKTRTrace("%.*s/%.*s, 0x%x\n", AuDLNPair(parent), len, name, flags);
51
dirperm1 = au_ftest_ndx(flags, DIRPERM1);
52
if (!dirperm1 && !au_ftest_ndx(flags, DLGT))
53
dentry = vfsub_lookup_one_len(name, parent, len);
56
struct au_lookup_one_len_args args = {
62
wkq_err = au_wkq_wait(au_call_lookup_one_len, &args,
64
if (unlikely(wkq_err))
65
dentry = ERR_PTR(wkq_err);
68
AuTraceErrPtr(dentry);
72
/* ---------------------------------------------------------------------- */
74
struct security_inode_permission_args {
76
struct inode *h_inode;
78
struct nameidata *fake_nd;
81
static void call_security_inode_permission(void *args)
83
struct security_inode_permission_args *a = args;
84
LKTRTrace("fsuid %d\n", current->fsuid);
85
*a->errp = security_inode_permission(a->h_inode, a->mask, a->fake_nd);
88
int au_security_inode_permission(struct inode *h_inode, int mask,
89
struct nameidata *fake_nd, int dlgt)
96
err = security_inode_permission(h_inode, mask, fake_nd);
99
struct security_inode_permission_args args = {
105
wkq_err = au_wkq_wait(call_security_inode_permission,
107
if (unlikely(wkq_err))