Expanding PATH records to be absolute paths

Steve Grubb sgrubb at redhat.com
Wed Sep 12 18:34:29 UTC 2007


On Wednesday 12 September 2007 14:14:58 Matthew Booth wrote:
> If I were going to do this from scratch, I'd cache CWD records and
> rewrite PATH records on the way through. I don't believe any other
> record requires this. AVC paths are already absolute, and I don't think
> there are any other paths. Is this right?

seems like its something like:

char *tpath, *actual;

asprintf(&tpath, "%s/%s", cwd, path);
actual = realpath(tpath, NULL);
if (actual) {
	// whatever you want to do with the canonicalized absolute pathname.
	free(actual);
}
free(tpath);


HTH,
-Steve




More information about the Linux-audit mailing list