Skip to content

Instantly share code, notes, and snippets.

@novaknole
Created March 22, 2018 13:21
Show Gist options
  • Save novaknole/183f47b07e045e07e5e6a49879f7cde7 to your computer and use it in GitHub Desktop.
Save novaknole/183f47b07e045e07e5e6a49879f7cde7 to your computer and use it in GitHub Desktop.
I will explain very clearly what I can't get .
Let's say I have a laravel application.
Let's say folders have permissions like this: drwxr-xr-x www-data www-data which means 755;
Then,I go to website and type url and click enter. As you say, I become user named www-data. code gets executed,for example:
$allCities = City::orderBy('id','desc')->paginate(10);
return view('admin_side.cities.allCities',compact('allCities'));
as we know, www-data makes it which is me also who went to that website.
I had the permission like drwxr-xr-x. so what happened in this scenario is everything worked.
what if i delete last (r and x) it becomes drwxr-x---. then if i go to that web url again, it doesn't work.
why? we saw that www-data still has (rwx) permissions. In my opinion www-data executes codes, but to show users final page,
what happens is WORLD PERMISSIONS FOR FILES get used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment