xref: /linux-6.15/security/apparmor/include/path.h (revision c1ed5da1)
1b886d83cSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
2cdff2642SJohn Johansen /*
3cdff2642SJohn Johansen  * AppArmor security module
4cdff2642SJohn Johansen  *
5cdff2642SJohn Johansen  * This file contains AppArmor basic path manipulation function definitions.
6cdff2642SJohn Johansen  *
7cdff2642SJohn Johansen  * Copyright (C) 1998-2008 Novell/SUSE
8cdff2642SJohn Johansen  * Copyright 2009-2010 Canonical Ltd.
9cdff2642SJohn Johansen  */
10cdff2642SJohn Johansen 
11cdff2642SJohn Johansen #ifndef __AA_PATH_H
12cdff2642SJohn Johansen #define __AA_PATH_H
13cdff2642SJohn Johansen 
14cdff2642SJohn Johansen enum path_flags {
15cdff2642SJohn Johansen 	PATH_IS_DIR = 0x1,		/* path is a directory */
16cdff2642SJohn Johansen 	PATH_CONNECT_PATH = 0x4,	/* connect disconnected paths to / */
17cdff2642SJohn Johansen 	PATH_CHROOT_REL = 0x8,		/* do path lookup relative to chroot */
18cdff2642SJohn Johansen 	PATH_CHROOT_NSCONNECT = 0x10,	/* connect paths that are at ns root */
19cdff2642SJohn Johansen 
20*c1ed5da1SJohn Johansen 	PATH_DELEGATE_DELETED = 0x10000, /* delegate deleted files */
21*c1ed5da1SJohn Johansen 	PATH_MEDIATE_DELETED = 0x20000,	 /* mediate deleted paths */
22cdff2642SJohn Johansen };
23cdff2642SJohn Johansen 
244227c333SJohn Johansen int aa_path_name(const struct path *path, int flags, char *buffer,
2572c8a768SJohn Johansen 		 const char **name, const char **info,
2672c8a768SJohn Johansen 		 const char *disconnected);
27cdff2642SJohn Johansen 
28341c1fdaSJohn Johansen #define IN_ATOMIC true
29341c1fdaSJohn Johansen char *aa_get_buffer(bool in_atomic);
30df323337SSebastian Andrzej Siewior void aa_put_buffer(char *buf);
31d4669f0bSJohn Johansen 
32cdff2642SJohn Johansen #endif /* __AA_PATH_H */
33