summaryrefslogtreecommitdiffstats
path: root/mdadm.h
diff options
context:
space:
mode:
authorKinga Tanska <kinga.tanska@intel.com>2022-06-06 12:32:12 +0200
committerJes Sorensen <jsorensen@fb.com>2022-06-14 16:36:03 +0200
commite702f392959d1c2ad2089e595b52235ed97b4e18 (patch)
tree8c7c640a9e700c970e1c51f1a0393f18843b81dc /mdadm.h
parentIncremental: Fix possible memory and resource leaks (diff)
downloadmdadm-e702f392959d1c2ad2089e595b52235ed97b4e18.tar.xz
mdadm-e702f392959d1c2ad2089e595b52235ed97b4e18.zip
Mdmonitor: Fix segfault
Mdadm with "--monitor" parameter requires md device as an argument to be monitored. If given argument is not a md device, error shall be returned. Previously it was not checked and invalid argument caused segmentation fault. This commit adds checking that devices passed to mdmonitor are md devices. Signed-off-by: Kinga Tanska <kinga.tanska@intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'mdadm.h')
-rw-r--r--mdadm.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/mdadm.h b/mdadm.h
index 09915a00..d53df169 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -1636,6 +1636,7 @@ extern int create_mddev(char *dev, char *name, int autof, int trustworthy,
#define FOREIGN 2
#define METADATA 3
extern int open_mddev(char *dev, int report_errors);
+extern int is_mddev(char *dev);
extern int open_container(int fd);
extern int metadata_container_matches(char *metadata, char *devnm);
extern int metadata_subdev_matches(char *metadata, char *devnm);