PERFORCE change 91656 for review

Christian S.J. Peron csjp at FreeBSD.org
Sun Feb 12 17:12:10 PST 2006


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

Change 91656 by csjp at csjp_xor on 2006/02/13 01:11:27

	Drop audit failures for reasons which were caused by the operating system 
	instead of reasons caused by the user. An example might be failure to create
	a set of pipes via pipe(2) or the failure to fork a process.
	
	Discussed with: wsalamon

Affected files ...

.. //depot/projects/trustedbsd/audit3/usr.bin/su/su.c#7 edit

Differences ...

==== //depot/projects/trustedbsd/audit3/usr.bin/su/su.c#7 (text+ko) ====

@@ -226,9 +226,6 @@
 
 	nargv = malloc(sizeof(char *) * (size_t)(argc + 4));
 	if (nargv == NULL) {
-#ifdef USE_BSM_AUDIT
-		audit_su(getuid(), AUDIT_SU_FAILURE);
-#endif
 		errx(1, "malloc failure");
 	}
 
@@ -262,9 +259,6 @@
 
 	username = strdup(pwd->pw_name);
 	if (username == NULL) {
-#ifdef USE_BSM_AUDIT
-		audit_su(getuid(), AUDIT_SU_FAILURE);
-#endif
 		err(1, "strdup failure");
 	}
 
@@ -451,9 +445,6 @@
 	statusp = 1;
 	if (pipe(fds) == -1) {
 		PAM_END();
-#ifdef USE_BSM_AUDIT
-		audit_su(getuid(), AUDIT_SU_FAILURE);
-#endif
 		err(1, "pipe");
 	}
 	child_pid = fork();
@@ -487,18 +478,12 @@
 		if (tcgetpgrp(STDERR_FILENO) == child_pgrp)
 			tcsetpgrp(STDERR_FILENO, getpgrp());
 		if (pid == -1) {
-#ifdef USE_BSM_AUDIT
-			audit_su(getuid(), AUDIT_SU_FAILURE);
-#endif
 			err(1, "waitpid");
 		}
 		PAM_END();
 		exit(WEXITSTATUS(statusp));
 	case -1:
 		PAM_END();
-#ifdef USE_BSM_AUDIT
-		audit_su(getuid(), AUDIT_SU_FAILURE);
-#endif
 		err(1, "fork");
 	case 0:
 		close(fds[1]);


More information about the trustedbsd-cvs mailing list