2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-09-05 16:55:32 +00:00

Fix the return size of aa_getprocattr

aa_getprocattr is returning the size of the buffer not the size of the
data read that it is supposed to return.  Also update the man page to
reflect the return value as documented in the functions, and update
the test cases to check the return value.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Steve Beattie <sbeattie@ubuntu.com>
This commit is contained in:
John Johansen
2012-03-22 07:58:18 -07:00
parent 648166ecca
commit 86527a2f4c
3 changed files with 29 additions and 10 deletions

View File

@@ -280,11 +280,10 @@ int aa_getprocattr(pid_t tid, const char *attr, char **buf, char **mode)
free(buffer);
*buf = NULL;
*mode = NULL;
size = -1;
} else
*buf = buffer;
return size;
return rc;
}
static int setprocattr(pid_t tid, const char *attr, const char *buf, int len)