18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * AppArmor security module
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * This file contains AppArmor basic path manipulation function definitions.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright (C) 1998-2008 Novell/SUSE
88c2ecf20Sopenharmony_ci * Copyright 2009-2010 Canonical Ltd.
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#ifndef __AA_PATH_H
128c2ecf20Sopenharmony_ci#define __AA_PATH_H
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_cienum path_flags {
158c2ecf20Sopenharmony_ci	PATH_IS_DIR = 0x1,		/* path is a directory */
168c2ecf20Sopenharmony_ci	PATH_CONNECT_PATH = 0x4,	/* connect disconnected paths to / */
178c2ecf20Sopenharmony_ci	PATH_CHROOT_REL = 0x8,		/* do path lookup relative to chroot */
188c2ecf20Sopenharmony_ci	PATH_CHROOT_NSCONNECT = 0x10,	/* connect paths that are at ns root */
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci	PATH_DELEGATE_DELETED = 0x08000, /* delegate deleted files */
218c2ecf20Sopenharmony_ci	PATH_MEDIATE_DELETED = 0x10000,	 /* mediate deleted paths */
228c2ecf20Sopenharmony_ci};
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ciint aa_path_name(const struct path *path, int flags, char *buffer,
258c2ecf20Sopenharmony_ci		 const char **name, const char **info,
268c2ecf20Sopenharmony_ci		 const char *disconnected);
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci#define IN_ATOMIC true
298c2ecf20Sopenharmony_cichar *aa_get_buffer(bool in_atomic);
308c2ecf20Sopenharmony_civoid aa_put_buffer(char *buf);
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#endif /* __AA_PATH_H */
33