* 4. Absolutely no warranty of function or purpose is made by the authors.
* 5. Modifications may be freely made to this file providing the above
* conditions are met.
- *
- * $FreeBSD$
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/stat.h>
-#include <syslog.h>
+
#include <errno.h>
#include <libutil.h>
+#include <stddef.h>
+#include <syslog.h>
/*
* Check for common security problems on a given path
* It must be:
* 1. A regular file, and exists
- * 2. Owned and writaable only by root (or given owner)
+ * 2. Owned and writable only by root (or given owner)
* 3. Group ownership is given group or is non-group writable
*
* Returns: -2 if file does not exist,
msg = "%s: %s is not a regular file";
else if (sb.st_mode & S_IWOTH)
msg = "%s: %s is world writable";
- else if (uid != -1 && sb.st_uid != uid && sb.st_uid != 0) {
+ else if ((int)uid != -1 && sb.st_uid != uid && sb.st_uid != 0) {
if (uid == 0)
msg = "%s: %s is not owned by root";
else
msg = "%s: %s is not owned by uid %d";
- } else if (gid != -1 && sb.st_gid != gid && (sb.st_mode & S_IWGRP))
+ } else if ((int)gid != -1 && sb.st_gid != gid && (sb.st_mode & S_IWGRP))
msg = "%s: %s is group writeable by non-authorised groups";
else
r = 0;