each mount has unique client_owner
add the netroot name to the hash for generating its client_owner Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
parent
f61bd10560
commit
4930e7caca
4 changed files with 13 additions and 2 deletions
|
|
@ -63,7 +63,8 @@ int handle_mount(nfs41_upcall *upcall)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
// create root
|
// create root
|
||||||
status = nfs41_root_create(NFS41_MAX_FILEIO_SIZE + WRITE_OVERHEAD,
|
status = nfs41_root_create(args->hostname,
|
||||||
|
NFS41_MAX_FILEIO_SIZE + WRITE_OVERHEAD,
|
||||||
NFS41_MAX_FILEIO_SIZE + READ_OVERHEAD, &root);
|
NFS41_MAX_FILEIO_SIZE + READ_OVERHEAD, &root);
|
||||||
if (status) {
|
if (status) {
|
||||||
eprintf("nfs41_rpc_clnt_create failed %d\n", status);
|
eprintf("nfs41_rpc_clnt_create failed %d\n", status);
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
|
|
||||||
/* nfs41_root */
|
/* nfs41_root */
|
||||||
int nfs41_root_create(
|
int nfs41_root_create(
|
||||||
|
IN const char *name,
|
||||||
IN uint32_t wsize,
|
IN uint32_t wsize,
|
||||||
IN uint32_t rsize,
|
IN uint32_t rsize,
|
||||||
OUT nfs41_root **root_out)
|
OUT nfs41_root **root_out)
|
||||||
|
|
@ -58,7 +59,7 @@ int nfs41_root_create(
|
||||||
InitializeCriticalSection(&root->lock);
|
InitializeCriticalSection(&root->lock);
|
||||||
|
|
||||||
/* generate a unique client_owner */
|
/* generate a unique client_owner */
|
||||||
status = nfs41_client_owner(&root->client_owner);
|
status = nfs41_client_owner(name, &root->client_owner);
|
||||||
if (status) {
|
if (status) {
|
||||||
eprintf("nfs41_client_owner() failed with %d\n", status);
|
eprintf("nfs41_client_owner() failed with %d\n", status);
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
||||||
|
|
@ -171,6 +171,7 @@ typedef struct __nfs41_root {
|
||||||
|
|
||||||
/* nfs41_namespace.c */
|
/* nfs41_namespace.c */
|
||||||
int nfs41_root_create(
|
int nfs41_root_create(
|
||||||
|
IN const char *name,
|
||||||
IN uint32_t wsize,
|
IN uint32_t wsize,
|
||||||
IN uint32_t rsize,
|
IN uint32_t rsize,
|
||||||
OUT nfs41_root **root_out);
|
OUT nfs41_root **root_out);
|
||||||
|
|
@ -274,6 +275,7 @@ void nfs41_server_addrs(
|
||||||
|
|
||||||
/* nfs41_client.c */
|
/* nfs41_client.c */
|
||||||
int nfs41_client_owner(
|
int nfs41_client_owner(
|
||||||
|
IN const char *name,
|
||||||
OUT client_owner4 *owner);
|
OUT client_owner4 *owner);
|
||||||
|
|
||||||
uint32_t nfs41_exchange_id_flags(
|
uint32_t nfs41_exchange_id_flags(
|
||||||
|
|
|
||||||
|
|
@ -379,6 +379,7 @@ out:
|
||||||
}
|
}
|
||||||
|
|
||||||
int nfs41_client_owner(
|
int nfs41_client_owner(
|
||||||
|
IN const char *name,
|
||||||
OUT client_owner4 *owner)
|
OUT client_owner4 *owner)
|
||||||
{
|
{
|
||||||
HCRYPTPROV context;
|
HCRYPTPROV context;
|
||||||
|
|
@ -405,6 +406,12 @@ int nfs41_client_owner(
|
||||||
goto out_context;
|
goto out_context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!CryptHashData(hash, (const BYTE*)name, (DWORD)strlen(name), 0)) {
|
||||||
|
status = GetLastError();
|
||||||
|
eprintf("CryptHashData() failed with %d\n", status);
|
||||||
|
goto out_hash;
|
||||||
|
}
|
||||||
|
|
||||||
/* add the mac address from each applicable adapter to the hash */
|
/* add the mac address from each applicable adapter to the hash */
|
||||||
status = hash_mac_addrs(hash);
|
status = hash_mac_addrs(hash);
|
||||||
if (status) {
|
if (status) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue