diff options
author | Kinga Tanska <kinga.tanska@intel.com> | 2022-06-06 12:32:12 +0200 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2022-06-14 16:36:03 +0200 |
commit | e702f392959d1c2ad2089e595b52235ed97b4e18 (patch) | |
tree | 8c7c640a9e700c970e1c51f1a0393f18843b81dc /mdadm.h | |
parent | Incremental: Fix possible memory and resource leaks (diff) | |
download | mdadm-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.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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); |