[linux-cifs-client] [PATCH 3/5] [CIFS] change cifs_setup_session to take a unc string arg

Q (Igor Mammedov) qwerty0987654321 at mail.ru
Tue Oct 30 16:30:18 GMT 2007


Jeff Layton wrote:
> +
>  int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
> -					   struct nls_table *nls_info)
> +			struct nls_table *nls_info, const char *unc)
>  {
>  	int rc = 0;
>  	char ntlm_session_key[CIFS_SESS_KEY_SIZE];
>  	int ntlmv2_flag = FALSE;
>  	int first_time = 0;
> +	char *hostname;
> +
> +	hostname = extract_hostname_from_unc(unc);

We already have server's IP and userspace helper could easily do reverse 
lookup to find out server name.
Benefits:
    1. readability, simplicity: no need in adding additional argument 
and function (less changes)
    2. security: force administrators to do correct dns configuration. 
( 	FQDN -> IP -> FQDN )



-- 

Best regards,

-------------------------
Igor Mammedov,
niallain "at" gmail.com






More information about the linux-cifs-client mailing list