Date: Thu, 2 May 2002 09:27:56 -0700 (PDT) From: "Andrew R. Reiter" <arr@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 10690 for review Message-ID: <200205021627.g42GRuZ59325@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=10690 Change 10690 by arr@arr_shibby on 2002/05/02 09:27:50 - Create AUDIT_SET_OBJECT - Create AUDIT_SET_OBJECT_UPATH for setting the path value with pointers from userland. - Create AUDIT_SET_OBJECT_KPATH for setting the path value with pointers from kernelland. The path handling stuff needs to be figured out. I've been toying with the idea of doing some minor caching method to decrease the # of copies... Perhaps those who read these submit messages have something to say about this? Affected files ... ... //depot/projects/trustedbsd/audit/sys/sys/audit.h#23 edit Differences ... ==== //depot/projects/trustedbsd/audit/sys/sys/audit.h#23 (text+ko) ==== @@ -132,6 +132,22 @@ (subj)->as_pid = (pid); \ } while (0) +/* XXX strncpy */ +#define AUDIT_SET_OBJECT(obj, access, path, uid, gid) do { \ + (obj)->ao_access = (access); \ + strncpy((obj)->ao_path, (path), sizeof((obj)->ao_path) - 1); \ + (obj)->ao_uid = (uid); \ + (obj)->ao_gid = (gid); \ +} while (0) + +/* Set the path with a pointer from userland */ +#define AUDIT_SET_OBJECT_UPATH(obj, upath) \ + copyinstr((upath), (obj)->ao_path, sizeof(obj)->ao_path), NULL) + +/* Set the path with a pointer from kernel land */ +#define AUDIT_SET_OBJECT_KPATH(obj, kpath) \ + copystr((kpath), (obj)->ao_path, sizeof(obj)->ao_path), NULL) + struct chmod_info { char ci_path[MAXPATHLEN]; mode_t ci_mode; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200205021627.g42GRuZ59325>