Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F156442548
D53670.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D53670.diff
View Options
diff --git a/usr.sbin/setaudit/Makefile b/usr.sbin/setaudit/Makefile
--- a/usr.sbin/setaudit/Makefile
+++ b/usr.sbin/setaudit/Makefile
@@ -1,8 +1,6 @@
PROG= setaudit
MAN= setaudit.8
-WARNS?= 3
-
LIBADD+= bsm
.include <bsd.prog.mk>
diff --git a/usr.sbin/setaudit/setaudit.c b/usr.sbin/setaudit/setaudit.c
--- a/usr.sbin/setaudit/setaudit.c
+++ b/usr.sbin/setaudit/setaudit.c
@@ -23,6 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
+
#include <sys/types.h>
#include <sys/socket.h>
@@ -31,23 +32,18 @@
#include <netinet/in.h>
-#include <stdio.h>
+#include <err.h>
+#include <netdb.h>
#include <pwd.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <netdb.h>
-#include <stdlib.h>
-#include <err.h>
-
-static char *aflag;
-static char *mflag;
-static char *sflag;
static void
usage(char *prog)
{
-
- (void) fprintf(stderr,
+ (void)fprintf(stderr,
"usage: %s [-46] [-a auid] [-m mask] [-s source] [-p port] command ...\n",
prog);
exit(1);
@@ -62,15 +58,17 @@
auditinfo_addr_t aia;
struct addrinfo *res;
struct passwd *pwd;
- char *r, *prog;
+ char *aflag, *mflag, *sflag, *r, *prog;
int ch, error;
+ aflag = mflag = sflag = NULL;
+
prog = argv[0];
bzero(&aia, sizeof(aia));
bzero(&hints, sizeof(hints));
aia.ai_termid.at_type = AU_IPv4;
hints.ai_family = PF_UNSPEC;
- while ((ch = getopt(argc, argv, "46a:m:s:p:")) != -1)
+ while ((ch = getopt(argc, argv, "46a:m:p:s:")) != -1)
switch (ch) {
case '4':
hints.ai_family = PF_INET;
@@ -84,12 +82,12 @@
case 'm':
mflag = optarg;
break;
- case 's':
- sflag = optarg;
- break;
case 'p':
aia.ai_termid.at_port = htons(atoi(optarg));
break;
+ case 's':
+ sflag = optarg;
+ break;
default:
usage(prog);
/* NOT REACHED */
@@ -117,14 +115,14 @@
errx(1, "%s", gai_strerror(error));
switch (res->ai_family) {
case PF_INET6:
- sin6 = (struct sockaddr_in6 *) res->ai_addr;
+ sin6 = (struct sockaddr_in6 *)(void *)res->ai_addr;
bcopy(&sin6->sin6_addr.s6_addr,
&aia.ai_termid.at_addr[0],
sizeof(struct in6_addr));
aia.ai_termid.at_type = AU_IPv6;
break;
case PF_INET:
- sin = (struct sockaddr_in *) res->ai_addr;
+ sin = (struct sockaddr_in *)(void *)res->ai_addr;
bcopy(&sin->sin_addr.s_addr,
&aia.ai_termid.at_addr[0],
sizeof(struct in_addr));
@@ -135,6 +133,6 @@
if (setaudit_addr(&aia, sizeof(aia)) < 0) {
err(1, "setaudit_addr");
}
- (void) execvp(*argv, argv);
+ (void)execvp(*argv, argv);
err(1, "%s", *argv);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, May 14, 5:41 PM (19 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33050906
Default Alt Text
D53670.diff (2 KB)
Attached To
Mode
D53670: setaudit: Bump WARNS and fix some style bugs
Attached
Detach File
Event Timeline
Log In to Comment