don't rely on old info in my_client
Subsystems (2)
PATCH 1/3 don't rely on old info in my_client
Here's a new set of patches to fix up "showmount -a", based on the approach suggested by Neil. This first patch is fairly simple. It just stops the current caching of my_client.
For an explanation, consider this situation with the current code:
1) Client mounts an NFS export from server that is restricted to a particular hostname or netgroup.
2) DNS or netgroup changes so that the client would be denied.
3) Client attempts mount again. Mount succeeds, even though it shouldn't due to the fact that mountd relies on cached info in my_client.
This situation can occur as long as no other client attempts a mount between 1 and 3 above. The patch below removes this caching, and causes a new invocation of client_compose for each pass through auth_authenticate:
utils/mountd/auth.c renamed from utils/mountd/auth.c.nocache +10 -15
@@ -76,21 +76,16 @@ auth_authenticate_internal(char *what, sif (new_cache) {int i;/* return static nfs_export with details filled in */ -if (my_client.m_naddr !=1 || - my_client.m_addrlist[0 ].s_addr != caller->sin_addr.s_addr) { -/* different client to last time, so do a lookup */ -char *n; - my_client.m_naddr =0 ; - my_client.m_addrlist[0 ] = caller->sin_addr; - n =client_compose (caller->sin_addr); - *error = unknown_host; -if (!n) -return NULL ; -strcpy (my_client.m_hostname, *n?n:"DEFAULT" ); -free (n); - my_client.m_naddr =1 ; - } - +char *n; + my_client.m_naddr =0 ; + my_client.m_addrlist[0 ] = caller->sin_addr; + n =client_compose (caller->sin_addr); + *error = unknown_host; +if (!n) +return NULL ; +strcpy (my_client.m_hostname, *n?n:"DEFAULT" ); +free (n); + my_client.m_naddr =1 ; my_exp.m_client = &my_client; exp =NULL ;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs