Merge pull request #754 from nkkashyap/master

Validate the URL format for http/https
This commit is contained in:
Takeshi Nakatani 2018-05-06 21:02:33 +09:00 committed by GitHub
commit 1db4739ed8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4739,6 +4739,11 @@ static int my_fuse_opt_proc(void* data, const char* arg, int key, struct fuse_ar
found = host.find_last_of('/');
length = host.length();
}
// Check url for http / https protocol string
if((host.compare(0, 8, "https://") != 0) && (host.compare(0, 7, "http://") != 0)) {
S3FS_PRN_EXIT("option url has invalid format, missing http / https protocol");
return -1;
}
return 0;
}
if(0 == strcmp(arg, "sigv2")){