PERFORCE change 76271 for review

Robert Watson rwatson at FreeBSD.org
Sat Apr 30 13:19:37 GMT 2005


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

Change 76271 by rwatson at rwatson_paprika on 2005/04/30 13:18:52

	From Darwin 8.0: identify Apple private APIs as such to avoid leaking
	them into the conumser of libbsm.h.  In one case, Apple has marked an
	API as Apple-private that we don't yet consider private
	(au_get_state()), which we will want to take a further look at.

Affected files ...

.. //depot/projects/trustedbsd/openbsm/libbsm/libbsm.h#7 edit

Differences ...

==== //depot/projects/trustedbsd/openbsm/libbsm/libbsm.h#7 (text+ko) ====

@@ -844,28 +844,36 @@
 __END_DECLS
 
 #ifdef __APPLE__
-/*
- * Apple-internal "wrapping" and utility definitions and prototypes.  
- */
+#include <sys/appleapiopts.h>
 
-#include <sys/appleapiopts.h>
+/**************************************************************************
+ **************************************************************************
+ ** The following definitions, functions, etc., are NOT officially
+ ** supported: they may be changed or removed in the future.  Do not use
+ ** them unless you are prepared to cope with that eventuality.
+ **************************************************************************
+ **************************************************************************/
 
 #ifdef __APPLE_API_PRIVATE
 #define __BSM_INTERNAL_NOTIFY_KEY "com.apple.audit.change"
-#endif
-#endif /* !__APPLE__ */
+#endif /* __APPLE_API_PRIVATE */
 
 /* 
  * au_get_state() return values 
  * XXX  use AUC_* values directly instead (<bsm/audit.h>); AUDIT_OFF and 
  * AUDIT_ON are deprecated and WILL be removed.  
  */
+#ifdef __APPLE_API_PRIVATE
 #define AUDIT_OFF	AUC_NOAUDIT
 #define AUDIT_ON	AUC_AUDITING
+#endif /* __APPLE_API_PRIVATE */
+#endif /* !__APPLE__ */
 
 /*
  * Error return codes for audit_set_terminal_id(), audit_write() and its 
  * brethren.  We have 255 (not including kAUNoErr) to play with.  
+ *
+ * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE.
  */
 enum
 {
@@ -885,6 +893,7 @@
     kAULastErr
 };
 
+#ifdef __APPLE__
 /*
  * Error return codes for au_get_state() and/or its private support
  * functions.  These codes are designed to be compatible with the
@@ -894,7 +903,10 @@
  * AU_UNIMPL should never happen unless you've changed your system software 
  * without rebooting.  Shame on you.  
  */
+#ifdef __APPLE_API_PRIVATE
 #define AU_UNIMPL	NOTIFY_STATUS_FAILED + 1	/* audit unimplemented */
+#endif /* __APPLE_API_PRIVATE */
+#endif /* !__APPLE__ */
 
 
 __BEGIN_DECLS
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list