Suppose all web material is located within the directory /home/www. To prevent users from viewing and manipulating files such as /etc/password, which one of the following statements should you use?

A open_dir = “/home/www/”
B open_dir = /home/www/
C open_basedir = /home/www/
D open_basedir = “/home/www/”

Correct Answer: open_basedir = “/home/www/”

We can use open_basedir statement to define the paths from which we can access files using functions like fopen() and gzopen(). It is used to prevent users from viewing and manipulating files such as /etc/password.

Related Questions

You create home directories for users Jan and Kim on a Windows NT Server computer. Jan works on a Windows NT Workstation computer. Kim works on a Microsoft Windows for Workgroups computer. After they log on, Jan can access her home directory, but Kim cannot access her home directory. What should you do?
You have configured a Group Policy Object (GPO) for the marketing oranization unit (OU) to prevent users from accessing My Network Places and from running System in Control Panel. You want the Managers Domain Local Group to be able to access My Network Places, but you still want to prevent them from running System in Control Panel. What should you do?
Which command is used to make all files and sub-directories in the directory (progs) executable by all users?
Which command is used to copy the three files wb, collect and mon into the misc directory, under the same, when you were currently in the programs directory?
Which command is used to move all files to the bin sub-directory of the parent directory?
Assume that all users are members of the ACE domain and that most of the resources exist in the PUBS and CAD domains. You are a user with administrator rights in all domains. How would you allow users to access all of the resources, with a minimum set of trust relationships?
Which command should be used to display all files within the specified subordinate directory of the subdirectory?
If you want to temporarily store uploaded files in the /tmp/phpuploads/ directory, which one of the following statement will you use?

Next steps