vishalmishra434 / rpms / openssh

Forked from rpms/openssh a month ago
Clone
Jan F. Chadima a7cb7d
diff -up openssh-5.6p1/audit-linux.c.audit1a openssh-5.6p1/audit-linux.c
Jan F. Chadima a7cb7d
--- openssh-5.6p1/audit-linux.c.audit1a	2010-12-10 21:47:03.000000000 +0100
Jan F. Chadima a7cb7d
+++ openssh-5.6p1/audit-linux.c	2010-12-10 21:50:31.000000000 +0100
Jan F. Chadima a7cb7d
@@ -59,7 +59,8 @@ linux_audit_record_event(int uid, const 
Jan F. Chadima a7cb7d
 	saved_errno = errno;
Jan F. Chadima a7cb7d
 	close(audit_fd);
Jan F. Chadima a7cb7d
 	errno = saved_errno;
Jan F. Chadima a7cb7d
-	return (rc >= 0);
Jan F. Chadima a7cb7d
+	/* do not report error if the error is EPERM and sshd is run as non root user */
Jan F. Chadima a7cb7d
+	return (rc >= 0) || ((rc == -EPERM) && (getuid() != 0));
Jan F. Chadima a7cb7d
 }
Jan F. Chadima a7cb7d
 
Jan F. Chadima a7cb7d
 /* Below is the sshd audit API code */