From 0def60137ea9725f82107f0d14b9d8079b715b8c Mon Sep 17 00:00:00 2001 From: Marcel Rodrigues Date: Mon, 27 Jul 2015 18:23:32 -0300 Subject: [PATCH] Check permission before changing directory. --- rover.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rover.c b/rover.c index 97dfcc1..1514894 100644 --- a/rover.c +++ b/rover.c @@ -909,6 +909,10 @@ main(int argc, char *argv[]) update_view(); } else if (!strcmp(key, RVK_CD_DOWN)) { if (!rover.nfiles || !S_ISDIR(EMODE(ESEL))) continue; + if (chdir(ENAME(ESEL)) == -1) { + message("Access denied.", RED); + continue; + } strcat(CWD, ENAME(ESEL)); cd(1); } else if (!strcmp(key, RVK_CD_UP)) { -- 2.11.4.GIT