grub-mount: Fix oath parsing.

Brackets detection was copied from somewhere else and makes no sense in case
of grub-mount and prevents user from accessing and files with ) in them.
This commit is contained in:
Vladimir Serbinenko 2015-12-29 17:43:05 +01:00
parent ca7bb46d5c
commit 4111882828

View file

@ -151,7 +151,6 @@ fuse_getattr (const char *path, struct stat *st)
{ {
struct fuse_getattr_ctx ctx; struct fuse_getattr_ctx ctx;
char *pathname, *path2; char *pathname, *path2;
const char *pathname_t;
if (path[0] == '/' && path[1] == 0) if (path[0] == '/' && path[1] == 0)
{ {
@ -170,12 +169,7 @@ fuse_getattr (const char *path, struct stat *st)
ctx.file_exists = 0; ctx.file_exists = 0;
pathname_t = grub_strchr (path, ')'); pathname = xstrdup (path);
if (! pathname_t)
pathname_t = path;
else
pathname_t++;
pathname = xstrdup (pathname_t);
/* Remove trailing '/'. */ /* Remove trailing '/'. */
while (*pathname && pathname[grub_strlen (pathname) - 1] == '/') while (*pathname && pathname[grub_strlen (pathname) - 1] == '/')