]> granicus.if.org Git - zfs/blobdiff - cmd/zed/zed_conf.c
Merge branch 'zfsonlinux/merge-spl'
[zfs] / cmd / zed / zed_conf.c
index a79fe862d97a9c144d5b8a065a992fbe157780e6..86671369c19ef08ecac6fd40c78270b210af475e 100644 (file)
@@ -155,6 +155,8 @@ _zed_conf_display_help(const char *prog, int got_err)
            "Run daemon in the foreground.");
        fprintf(fp, "%*c%*s %s\n", w1, 0x20, -w2, "-M",
            "Lock all pages in memory.");
+       fprintf(fp, "%*c%*s %s\n", w1, 0x20, -w2, "-P",
+           "$PATH for ZED to use (only used by ZTS).");
        fprintf(fp, "%*c%*s %s\n", w1, 0x20, -w2, "-Z",
            "Zero state file.");
        fprintf(fp, "\n");
@@ -247,7 +249,7 @@ _zed_conf_parse_path(char **resultp, const char *path)
 void
 zed_conf_parse_opts(struct zed_conf *zcp, int argc, char **argv)
 {
-       const char * const opts = ":hLVc:d:p:s:vfFMZ";
+       const char * const opts = ":hLVc:d:p:P:s:vfFMZ";
        int opt;
 
        if (!zcp || !argv || !argv[0])
@@ -275,6 +277,9 @@ zed_conf_parse_opts(struct zed_conf *zcp, int argc, char **argv)
                case 'p':
                        _zed_conf_parse_path(&zcp->pid_file, optarg);
                        break;
+               case 'P':
+                       _zed_conf_parse_path(&zcp->path, optarg);
+                       break;
                case 's':
                        _zed_conf_parse_path(&zcp->state_file, optarg);
                        break;
@@ -394,13 +399,13 @@ zed_conf_scan_dir(struct zed_conf *zcp)
                            direntp->d_name);
                        continue;
                }
-               if ((st.st_mode & S_IWGRP) & !zcp->do_force) {
+               if ((st.st_mode & S_IWGRP) && !zcp->do_force) {
                        zed_log_msg(LOG_NOTICE,
                            "Ignoring \"%s\": writable by group",
                            direntp->d_name);
                        continue;
                }
-               if ((st.st_mode & S_IWOTH) & !zcp->do_force) {
+               if ((st.st_mode & S_IWOTH) && !zcp->do_force) {
                        zed_log_msg(LOG_NOTICE,
                            "Ignoring \"%s\": writable by other",
                            direntp->d_name);