PERFORCE change 101254 for review

Wayne Salamon wsalamon at FreeBSD.org
Tue Jul 11 00:07:19 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=101254

Change 101254 by wsalamon at vh3 on 2006/07/11 00:07:01

	Change the au_to_exec_* function prototypes, removing the 'const'
	modifier, adding the argument names. Also define KERNEL and user space
	versions of these functions.
	Fix up man page to match above.
	Fix name of exec argument for env in token printer.

Affected files ...

.. //depot/projects/trustedbsd/openbsm/bsm/audit_record.h#21 edit
.. //depot/projects/trustedbsd/openbsm/libbsm/au_token.3#8 edit
.. //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#38 edit
.. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#49 edit

Differences ...

==== //depot/projects/trustedbsd/openbsm/bsm/audit_record.h#21 (text+ko) ====

@@ -30,7 +30,7 @@
  *
  * @APPLE_BSD_LICENSE_HEADER_END@
  *
- * $P4: //depot/projects/trustedbsd/openbsm/bsm/audit_record.h#20 $
+ * $P4: //depot/projects/trustedbsd/openbsm/bsm/audit_record.h#21 $
  */
 
 #ifndef _BSM_AUDIT_RECORD_H_
@@ -308,8 +308,13 @@
 	    gid_t rgid, pid_t pid, au_asid_t sid, au_tid_addr_t *tid);
 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);
-token_t	*au_to_exec_args(const char **);
-token_t	*au_to_exec_env(const char **);
+#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);
+#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_kevent(struct kevent *kev);
 token_t	*au_to_trailer(int rec_size);

==== //depot/projects/trustedbsd/openbsm/libbsm/au_token.3#8 (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#7 $
+.\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/au_token.3#8 $
 .\"
 .Dd April 19, 2005
 .Dt AU_TOKEN 3
@@ -155,9 +155,9 @@
 .Ft token_t *
 .Fn au_to_me "void"
 .Ft token_t *
-.Fn au_to_exec_args "const char **args"
+.Fn au_to_exec_args "char **argv"
 .Ft token_t *
-.Fn au_to_exec_env "const char **env"
+.Fn au_to_exec_env "char **envp"
 .Ft token_t *
 .Fn au_to_header "int rec_size" "au_event_t e_type" "au_emod_t emod"
 .Ft token_t *

==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#38 (text+ko) ====

@@ -31,7 +31,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_io.c#37 $
+ * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#38 $
  */
 
 #include <sys/types.h>
@@ -1259,7 +1259,7 @@
 {
 	int i;
 
-	print_tok_type(fp, tok->id, "exec arg", raw);
+	print_tok_type(fp, tok->id, "exec env", raw);
 	for (i = 0; i< tok->tt.execenv.count; i++) {
 		print_delim(fp, del);
 		print_string(fp, tok->tt.execenv.text[i],

==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#49 (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#48 $
+ * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#49 $
  */
 
 #include <sys/types.h>
@@ -1055,7 +1055,7 @@
  * text					count null-terminated strings
  */
 token_t *
-au_to_exec_args(const char **args)
+au_to_exec_args(char **argv)
 {
 	token_t *t;
 	u_char *dptr = NULL;
@@ -1063,7 +1063,7 @@
 	int i, count = 0;
 	size_t totlen = 0;
 
-	nextarg = *args;
+	nextarg = *argv;
 
 	while (nextarg != NULL) {
 		int nextlen;
@@ -1071,7 +1071,7 @@
 		nextlen = strlen(nextarg);
 		totlen += nextlen + 1;
 		count++;
-		nextarg = *(args + count);
+		nextarg = *(argv + count);
 	}
 
 	totlen += count * sizeof(char);	/* nul terminations. */
@@ -1083,7 +1083,7 @@
 	ADD_U_INT32(dptr, count);
 
 	for (i = 0; i < count; i++) {
-		nextarg = *(args + i);
+		nextarg = *(argv + i);
 		ADD_MEM(dptr, nextarg, strlen(nextarg) + 1);
 	}
 
@@ -1096,7 +1096,7 @@
  * text					count null-terminated strings
  */
 token_t *
-au_to_exec_env(const char **env)
+au_to_exec_env(char **envp)
 {
 	token_t *t;
 	u_char *dptr = NULL;
@@ -1104,7 +1104,7 @@
 	size_t totlen = 0;
 	const char *nextenv;
 
-	nextenv = *env;
+	nextenv = *envp;
 
 	while (nextenv != NULL) {
 		int nextlen;
@@ -1112,7 +1112,7 @@
 		nextlen = strlen(nextenv);
 		totlen += nextlen + 1;
 		count++;
-		nextenv = *(env + count);
+		nextenv = *(envp + count);
 	}
 
 	totlen += sizeof(char) * count;
@@ -1124,7 +1124,7 @@
 	ADD_U_INT32(dptr, count);
 
 	for (i = 0; i < count; i++) {
-		nextenv = *(env + i);
+		nextenv = *(envp + i);
 		ADD_MEM(dptr, nextenv, strlen(nextenv) + 1);
 	}
 


More information about the trustedbsd-cvs mailing list