The http_file_access function checks if a file access is
allowed for a specified user. This allows access protection of
sensitive web pages. The protected web pages will not display for
unpriviliged users. Instead of this, the Web server will show Error
page 403 - Forbidden.
The argument fname points to a buffer containing the file
name of a file, which the user is trying to access. The file name is
a 0-terminated string.
The argument user_id is an user identification number, the
same as it was returned from the http_check_account function.
It identifies the user, who is trying to access the specified
file.
The http_file_access function is in the HTTP_MultiUser.c
module. The prototype is defined in net_config.h.
note
This function is optional. If the HTTP resource access
restriction is not used, this function is not required.
Return Value
The http_file_access function returns __TRUE if access to
file is allowed, and __FALSE if access is forbidden.
BOOL http_file_access (U8 *fname, U8 user_id) {
/* This function checks if file access for the user is allowed. */
if (user_id == 3) {
/* Check if "Guest" is trying to access the "system.cgi" */
if (strcmp ((char *)fname, "system.cgi") == 0) {
/* The access to this file is not allowed for user "Guest". */
/* Web server will return the error code 403 - Forbidden. */
return (__FALSE);
}
}
return (__TRUE);
}
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.