/*
- * Copyright (c) 2005 Apple Computer, Inc.
- * All rights reserved.
+ * Copyright (c) 2005-2016 Apple Inc. All rights reserved.
*
* @APPLE_BSD_LICENSE_HEADER_START@
*
long au_cond;
/* Determine whether auditing is enabled. */
- if (auditon(A_GETCOND, &au_cond, sizeof(long)) < 0) {
+ if (auditon(A_GETCOND, &au_cond, sizeof(long)) < 0) {
if (errno == ENOSYS)
return;
errx(1, "login: Could not determine audit condition");
if (setaudit_addr(&auinfo, sizeof(auinfo)) < 0)
err(1, "login: setaudit_addr failed");
-
+
char *session = NULL;
asprintf(&session, "%x", auinfo.ai_asid);
if (NULL == session) {
}
setenv("SECURITYSESSIONID", session, 1);
free(session);
-
+
/* If we are not auditing, don't cut an audit record; just return. */
if (au_cond == AUC_NOAUDIT)
return;
pid_t pid = getpid();
/* If we are not auditing, don't cut an audit record; just return. */
- if (auditon(A_GETCOND, &au_cond, sizeof(long)) < 0) {
+ if (auditon(A_GETCOND, &au_cond, sizeof(long)) < 0) {
if (errno == ENOSYS)
return;
errx(1, "login: Could not determine audit condition");
long au_cond;
/* If we are not auditing, don't cut an audit record; just return. */
- if (auditon(A_GETCOND, &au_cond, sizeof(long)) < 0) {
+ if (auditon(A_GETCOND, &au_cond, sizeof(long)) < 0) {
if (errno == ENOSYS)
return;
errx(1, "login: Could not determine audit condition");