From owner-p4-projects Thu May 2 9:28: 2 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6B2A337B405; Thu, 2 May 2002 09:27:57 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 9610E37B41B for ; Thu, 2 May 2002 09:27:56 -0700 (PDT) Received: (from perforce@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g42GRuZ59325 for perforce@freebsd.org; Thu, 2 May 2002 09:27:56 -0700 (PDT) (envelope-from arr@freebsd.org) Date: Thu, 2 May 2002 09:27:56 -0700 (PDT) Message-Id: <200205021627.g42GRuZ59325@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to arr@freebsd.org using -f From: "Andrew R. Reiter" Subject: PERFORCE change 10690 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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