From owner-p4-projects@FreeBSD.ORG Thu Mar 20 09:56:12 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 16CD51065673; Thu, 20 Mar 2008 09:56:12 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA7AA106566B for ; Thu, 20 Mar 2008 09:56:11 +0000 (UTC) (envelope-from delphij@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C64E78FC16 for ; Thu, 20 Mar 2008 09:56:11 +0000 (UTC) (envelope-from delphij@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m2K9uBE0018040 for ; Thu, 20 Mar 2008 09:56:11 GMT (envelope-from delphij@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m2K9uBmr018038 for perforce@freebsd.org; Thu, 20 Mar 2008 09:56:11 GMT (envelope-from delphij@freebsd.org) Date: Thu, 20 Mar 2008 09:56:11 GMT Message-Id: <200803200956.m2K9uBmr018038@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to delphij@freebsd.org using -f From: Xin LI To: Perforce Change Reviews Cc: Subject: PERFORCE change 138167 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2008 09:56:12 -0000 http://perforce.freebsd.org/chv.cgi?CH=138167 Change 138167 by delphij@charlie on 2008/03/20 09:56:02 Constify token operations' parameters. Affected files ... .. //depot/projects/trustedbsd/openbsm/bsm/audit_record.h#27 edit .. //depot/projects/trustedbsd/openbsm/libbsm/au_token.3#14 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#65 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/bsm/audit_record.h#27 (text+ko) ==== @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bsm/audit_record.h#26 $ + * $P4: //depot/projects/trustedbsd/openbsm/bsm/audit_record.h#27 $ */ #ifndef _BSM_AUDIT_RECORD_H_ @@ -239,7 +239,7 @@ int au_close_buffer(int d, short event, u_char *buffer, size_t *buflen); int au_close_token(token_t *tok, u_char *buffer, size_t *buflen); -token_t *au_to_file(char *file, struct timeval tm); +token_t *au_to_file(const char *file, struct timeval tm); token_t *au_to_header32_tm(int rec_size, au_event_t e_type, au_emod_t e_mod, struct timeval tm); @@ -252,9 +252,9 @@ #endif token_t *au_to_me(void); -token_t *au_to_arg(char n, char *text, uint32_t v); -token_t *au_to_arg32(char n, char *text, uint32_t v); -token_t *au_to_arg64(char n, char *text, uint64_t v); +token_t *au_to_arg(char n, const char *text, uint32_t v); +token_t *au_to_arg32(char n, const char *text, uint32_t v); +token_t *au_to_arg64(char n, const char *text, uint64_t v); #if defined(_KERNEL) || defined(KERNEL) token_t *au_to_attr(struct vnode_au_info *vni); @@ -263,7 +263,7 @@ #endif token_t *au_to_data(char unit_print, char unit_type, char unit_count, - char *p); + const char *p); token_t *au_to_exit(int retval, int err); token_t *au_to_groups(int *groups); token_t *au_to_newgroups(uint16_t n, gid_t *groups); @@ -273,8 +273,8 @@ token_t *au_to_ipc(char type, int id); token_t *au_to_ipc_perm(struct ipc_perm *perm); token_t *au_to_iport(uint16_t iport); -token_t *au_to_opaque(char *data, uint16_t bytes); -token_t *au_to_path(char *path); +token_t *au_to_opaque(const char *data, uint16_t bytes); +token_t *au_to_path(const char *path); token_t *au_to_process(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid, gid_t rgid, pid_t pid, au_asid_t sid, au_tid_t *tid); token_t *au_to_process32(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid, @@ -318,16 +318,16 @@ token_t *au_to_subject64_ex(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid, gid_t rgid, pid_t pid, au_asid_t sid, au_tid_addr_t *tid); #if defined(_KERNEL) || defined(KERNEL) -token_t *au_to_exec_args(char *args, int argc); -token_t *au_to_exec_env(char *envs, int envc); +token_t *au_to_exec_args(const char *args, int argc); +token_t *au_to_exec_env(const char *envs, int envc); #else token_t *au_to_exec_args(char **argv); token_t *au_to_exec_env(char **envp); #endif -token_t *au_to_text(char *text); +token_t *au_to_text(const char *text); token_t *au_to_kevent(struct kevent *kev); token_t *au_to_trailer(int rec_size); -token_t *au_to_zonename(char *zonename); +token_t *au_to_zonename(const char *zonename); __END_DECLS ==== //depot/projects/trustedbsd/openbsm/libbsm/au_token.3#14 (text+ko) ==== @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/au_token.3#13 $ +.\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/au_token.3#14 $ .\" .Dd April 19, 2005 .Dt AU_TOKEN 3 @@ -80,11 +80,11 @@ .Sh SYNOPSIS .In bsm/libbsm.h .Ft "token_t *" -.Fn au_to_arg32 "char n" "char *text" "u_int32_t v" +.Fn au_to_arg32 "char n" "const char *text" "u_int32_t v" .Ft "token_t *" -.Fn au_to_arg64 "char n" "char *text" "u_int64_t v" +.Fn au_to_arg64 "char n" "const char *text" "u_int64_t v" .Ft "token_t *" -.Fn au_to_arg "char n" "char *text" "u_int32_t v" +.Fn au_to_arg "char n" "const char *text" "u_int32_t v" .Ft "token_t *" .Fn au_to_attr32 "struct vattr *attr" .Ft "token_t *" @@ -92,7 +92,7 @@ .Ft "token_t *" .Fn au_to_attr "struct vattr *attr" .Ft "token_t *" -.Fn au_to_data "char unit_print" "char unit_type" "char unit_count" "char *p" +.Fn au_to_data "char unit_print" "char unit_type" "char unit_count" "const char *p" .Ft "token_t *" .Fn au_to_exit "int retval" "int err" .Ft "token_t *" @@ -112,13 +112,13 @@ .Ft "token_t *" .Fn au_to_iport "u_int16_t iport" .Ft "token_t *" -.Fn au_to_opaque "char *data" "u_int16_t bytes" +.Fn au_to_opaque "const char *data" "u_int16_t bytes" .Ft "token_t *" -.Fn au_to_file "char *file" "struct timeval tm" +.Fn au_to_file "const char *file" "struct timeval tm" .Ft "token_t *" -.Fn au_to_text "char *text" +.Fn au_to_text "const char *text" .Ft "token_t *" -.Fn au_to_path "char *text" +.Fn au_to_path "const char *text" .Ft "token_t *" .Fo au_to_process32 .Fa "au_id_t auid" "uid_t euid" "gid_t egid" "uid_t ruid" @@ -198,7 +198,7 @@ .Ft "token_t *" .Fn au_to_trailer "int rec_size" .Ft "token_t *" -.Fn au_to_zonename "char *zonename" +.Fn au_to_zonename "const char *zonename" .Sh DESCRIPTION These interfaces support the allocation of BSM audit tokens, represented by .Vt token_t , ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#65 (text+ko) ==== @@ -30,7 +30,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#64 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#65 $ */ #include @@ -98,7 +98,7 @@ * text N bytes + 1 terminating NULL byte */ token_t * -au_to_arg32(char n, char *text, u_int32_t v) +au_to_arg32(char n, const char *text, u_int32_t v) { token_t *t; u_char *dptr = NULL; @@ -123,7 +123,7 @@ } token_t * -au_to_arg64(char n, char *text, u_int64_t v) +au_to_arg64(char n, const char *text, u_int64_t v) { token_t *t; u_char *dptr = NULL; @@ -148,7 +148,7 @@ } token_t * -au_to_arg(char n, char *text, u_int32_t v) +au_to_arg(char n, const char *text, u_int32_t v) { return (au_to_arg32(n, text, v)); @@ -270,7 +270,7 @@ * data items (depends on basic unit) */ token_t * -au_to_data(char unit_print, char unit_type, char unit_count, char *p) +au_to_data(char unit_print, char unit_type, char unit_count, const char *p) { token_t *t; u_char *dptr = NULL; @@ -553,7 +553,7 @@ * data size bytes */ token_t * -au_to_opaque(char *data, u_int16_t bytes) +au_to_opaque(const char *data, u_int16_t bytes) { token_t *t; u_char *dptr = NULL; @@ -577,7 +577,7 @@ * file pathname N bytes + 1 terminating NULL byte */ token_t * -au_to_file(char *file, struct timeval tm) +au_to_file(const char *file, struct timeval tm) { token_t *t; u_char *dptr = NULL; @@ -609,7 +609,7 @@ * text N bytes + 1 terminating NULL byte */ token_t * -au_to_text(char *text) +au_to_text(const char *text) { token_t *t; u_char *dptr = NULL; @@ -635,7 +635,7 @@ * path N bytes + 1 terminating NULL byte */ token_t * -au_to_path(char *text) +au_to_path(const char *text) { token_t *t; u_char *dptr = NULL; @@ -1233,7 +1233,7 @@ * zonename N bytes + 1 terminating NULL byte */ token_t * -au_to_zonename(char *zonename) +au_to_zonename(const char *zonename) { u_char *dptr = NULL; u_int16_t textlen;