[En-Nut-Discussion] HTTP password protection

Peter Sodermanns peter.sodermanns at aixcon.de
Fri Aug 25 14:45:03 CEST 2006


Hi all,

Ethernut provides the function NutRegisterAuth() to restrict access on a 
directory in the web-server.

I used this function and observed that when I change username and 
password, one still can access with the old name/password combination. 
That's because NutRegisterAuth() appends that information to a list so 
access can be granted to several users.
I rather wanted to give my user the possibility to change his name 
and/or password instead of creating a new user which means that his old 
name and password remain valid.

So I added a function NutClearAuth() to auth.c, which deletes the list 
of users:

	/*!
	 * \brief Clear all authorization entries.
	 */
	int NutClearAuth(void)
	{
		AUTHINFO *auth;

		for (auth = authList; auth->auth_next; auth = auth->auth_next) {
			NutHeapFree(auth);
		}
		authList = 0;
		return 0;
	}


and it's declaration in httpd.h

	extern int NutClearAuth(void);


If that is of interest for others, too, someone can add it to the CVS.


Kind regards

           Peter


More information about the En-Nut-Discussion mailing list