PERFORCE change 153800 for review

Christian S.J. Peron csjp at FreeBSD.org
Sat Nov 29 15:38:21 PST 2008


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

Change 153800 by csjp at hvm02 on 2008/11/29 23:37:23

	Fix a bug in how we calculate the total length or size for the token.
	We accounted for the NULL termination characters twice.

Affected files ...

.. //depot/projects/trustedbsd/openbsm/NEWS#13 edit
.. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#75 edit

Differences ...

==== //depot/projects/trustedbsd/openbsm/NEWS#13 (text+ko) ====

@@ -1,5 +1,9 @@
 OpenBSM Version History
 
+- Fix a bug how au_to_exec_args(3) and au_to_exec_env(3) calculates the total
+  size for the token.  This bug resulted in "unknown" tokens being printed
+  after the exec args/env tokens.
+
 OpenBSM 1.1 alpha 3
 
 - Add two new functions, au_bsm_to_errno() and au_errno_to_bsm(), to map
@@ -356,4 +360,4 @@
   to support reloading of kernel event table.
 - Allow comments in /etc/security configuration files.
 
-$P4: //depot/projects/trustedbsd/openbsm/NEWS#12 $
+$P4: //depot/projects/trustedbsd/openbsm/NEWS#13 $

==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#75 (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#74 $
+ * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#75 $
  */
 
 #include <sys/types.h>
@@ -1207,7 +1207,6 @@
 		nextarg = *(argv + count);
 	}
 
-	totlen += count * sizeof(char);	/* nul terminations. */
 	GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t) + totlen);
 	if (t == NULL)
 		return (NULL);
@@ -1269,7 +1268,6 @@
 		nextenv = *(envp + count);
 	}
 
-	totlen += sizeof(char) * count;
 	GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t) + totlen);
 	if (t == NULL)
 		return (NULL);


More information about the p4-projects mailing list