Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Mar 2008 09:56:11 GMT
From:      Xin LI <delphij@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 138167 for review
Message-ID:  <200803200956.m2K9uBmr018038@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <sys/types.h>
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803200956.m2K9uBmr018038>