diff options
author | Doug Ledford <dledford@redhat.com> | 2010-04-15 17:38:37 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2010-04-15 17:38:37 -0400 |
commit | 097c0ef1870e64667f85e689286228035af8323e (patch) | |
tree | 1b9e6074ca81fccdb9d262e9e7ebdf69d4421eec /config.c | |
parent | 67da8fb8592e9e590ac7467c3bfa50e7c032de3a (diff) | |
download | mdadm-097c0ef1870e64667f85e689286228035af8323e.tar.gz mdadm-097c0ef1870e64667f85e689286228035af8323e.tar.xz mdadm-097c0ef1870e64667f85e689286228035af8323e.zip |
Added sanity checks on DOMAIN lines, add an action_mask value
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -811,10 +811,10 @@ void domainline(char *line) } /* Some sanity checks now that all the options are parsed */ if ((de->action & force) && - ((de->action & (force - 1)) <= incremental)) { + ((de->action & action_mask) <= incremental)) { fprintf(stderr, Name ": force makes no sense with ignore or " "incremental, removing.\n"); - de->action &= (force - 1); + de->action &= action_mask; } if (de->spare_group && de->action <= incremental) { fprintf(stderr, Name ": defined a spare group when we aren't " @@ -822,6 +822,18 @@ void domainline(char *line) free(de->spare_group); de->spare_group = NULL; } + if ((de->action & action_mask) == partition) + for (path = de->paths; path; path = path->next) + if ((strstr(path->path, "part") != NULL) || + (path->path[strlen(path->path) - 1] == '*')) { + fprintf(stderr, Name ": partition method only " + "allowed on whole disks, not on " + "partitions\n"); + fprintf(stderr, Name ": bad path=%s\n", + path->path); + free_domain(de); + return; + } de->next = domain_list; domain_list = de; } |