[apparmor] [PATCH 3/6] libapparmor: Clean up function that wraps features dir reading
Seth Arnold
seth.arnold at canonical.com
Thu Apr 2 00:58:27 UTC 2015
On Thu, Mar 26, 2015 at 04:47:59PM -0500, Tyler Hicks wrote:
> Make the function prototype for reading a features directory the same
> as the function prototype for reading a features file.
>
> Signed-off-by: Tyler Hicks <tyhicks at canonical.com>
Acked-by: Seth Arnold <seth.arnold at canonical.com>
Thanks
> ---
> libraries/libapparmor/src/features.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/libraries/libapparmor/src/features.c b/libraries/libapparmor/src/features.c
> index f913e91..0bb90ee 100644
> --- a/libraries/libapparmor/src/features.c
> +++ b/libraries/libapparmor/src/features.c
> @@ -175,13 +175,13 @@ static int features_dir_cb(int dirfd, const char *name, struct stat *st,
> return 0;
> }
>
> -static int handle_features_dir(const char *filename, char *buffer, int size,
> - char *pos)
> +static int load_features_dir(int dirfd, const char *path,
> + char *buffer, int size)
> {
> - struct features_struct fst = { buffer, size, pos };
> + struct features_struct fst = { buffer, size, buffer };
>
> - if (_aa_dirat_for_each(AT_FDCWD, filename, &fst, features_dir_cb)) {
> - PDEBUG("Failed evaluating %s\n", filename);
> + if (_aa_dirat_for_each(dirfd, path, &fst, features_dir_cb)) {
> + PDEBUG("Failed evaluating %s\n", path);
> return -1;
> }
>
> @@ -383,7 +383,7 @@ int aa_features_new(aa_features **features, const char *path)
> aa_features_ref(f);
>
> retval = S_ISDIR(stat_file.st_mode) ?
> - handle_features_dir(path, f->string, STRING_SIZE, f->string) :
> + load_features_dir(AT_FDCWD, path, f->string, STRING_SIZE) :
> load_features_file(AT_FDCWD, path, f->string, STRING_SIZE);
> if (retval == -1) {
> int save = errno;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20150401/9514c2b8/attachment.pgp>
More information about the AppArmor
mailing list