diff options
author | Doug Ledford <dledford@redhat.com> | 2010-04-16 18:16:40 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2010-04-16 18:16:40 -0400 |
commit | 56d318f825099f61370fc696c2a3e8f57bcf198c (patch) | |
tree | f1dd12d03287c6e341f14a4f2983fd58c60aa103 | |
parent | bdf05eca34d74d8220031dc8e672ba4d9209a800 (diff) | |
download | mdadm-hotunplug.tar.gz mdadm-hotunplug.tar.xz mdadm-hotunplug.zip |
Add stub for validation of partition table file during config parsinghotunplug
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r-- | config.c | 6 | ||||
-rw-r--r-- | mdadm.h | 1 | ||||
-rw-r--r-- | util.c | 6 |
3 files changed, 13 insertions, 0 deletions
@@ -903,6 +903,12 @@ void domainline(char *line) free_domain(de); return; } + if (de->handler->validate(de)) { + fprintf(stderr, Name ": partition table file failed " + "validation.\n"); + free_domain(de); + return; + } } de->next = domain_list; domain_list = de; @@ -299,6 +299,7 @@ struct domain_ent; extern struct partition_handler { char *match; /* string we match in mdadm.conf */ + int (*validate)(struct domain_ent *domain); int (*check_table)(int dfd, int verbose, int export, struct domain_ent *domain); int (*write_table)(int dfd, int verbose, int export, @@ -1745,6 +1745,11 @@ char *get_devpath_from_devname(char *devname) return NULL; } +static int sfdisk_validate(struct domain_ent *domain) +{ + return 0; +} + static int sfdisk_check_table(int dfd, int verbose, int export, struct domain_ent *domain) { @@ -1759,6 +1764,7 @@ static int sfdisk_write_table(int dfd, int verbose, int export, static struct partition_handler sfdisk_handler = { .match = "sfdisk", + .validate = sfdisk_validate, .check_table = sfdisk_check_table, .write_table = sfdisk_write_table, }; |