- diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
- index 07c1dd5..a6e4f88 100644
- --- a/cygwin/devel/msnfs41client.bash
- +++ b/cygwin/devel/msnfs41client.bash
- @@ -140,7 +140,7 @@ function nfsclient_rundeamon
- typeset -a nfsd_args=(
- 'nfsd_debug.exe'
- - '-d' '0'
- + '-d' '1'
- '--noldap'
- #'--numworkerthreads' '512'
- #'--gid' '1616' '--uid' '1616'
- diff --git a/daemon/acl.c b/daemon/acl.c
- index e4fb02e..d4f4c1a 100644
- --- a/daemon/acl.c
- +++ b/daemon/acl.c
- @@ -36,7 +36,7 @@
- #include "sid.h"
- //#define DEBUG_ACLS
- -#define ACLLVL 2 /* dprintf level for acl logging */
- +#define ACLLVL 1 /* dprintf level for acl logging */
- static int parse_getacl(unsigned char *buffer, uint32_t length,
- nfs41_upcall *upcall)
- @@ -287,6 +287,7 @@ static int handle_getacl(void *daemon_context, nfs41_upcall *upcall)
- args->sec_desc_len = 0;
- status = MakeSelfRelativeSD(&sec_desc, args->sec_desc, &args->sec_desc_len);
- if (status) {
- + dprintf(1, "handle_getacl: MakeSelfRelativeSD() failed.\n");
- status = ERROR_INTERNAL_ERROR;
- goto out;
- }
- @@ -462,6 +463,7 @@ static int map_nfs4ace_who(PSID sid, PSID owner_sid, PSID group_sid, char *who_o
- DWORD size = 0, tmp_size = 0;
- SID_NAME_USE sid_type;
- LPSTR tmp_buf = NULL, who = NULL;
- + LPSTR sidstr = NULL;
- /* for ace mapping, we want to map owner's sid into "owner@"
- * but for set_owner attribute we want to map owner into a user name
- @@ -492,6 +494,85 @@ static int map_nfs4ace_who(PSID sid, PSID owner_sid, PSID group_sid, char *who_o
- return ERROR_SUCCESS;
- }
- +#ifdef NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID
- + if (!ConvertSidToStringSidA(sid, &sidstr)) {
- + status = GetLastError();
- + eprintf("map_nfs4ace_who: ConvertSidToStringSidA() failed, "
- + "error=%d\n", status);
- + goto out;
- + }
- +
- + dprintf(ACLLVL, "map_nfs4ace_who: Looking up SID '%s'\n", sidstr);
- +
- + /*
- + * Handle special "Unix_User+<uid>"-SIDs
- + */
- + if (!strncmp(sidstr, UNIXUSERSID_PREFIX, strlen(UNIXUSERSID_PREFIX))) {
- + const char *uidstr = sidstr+strlen(UNIXUSERSID_PREFIX);
- + uid_t uid;
- + char tmpwho[NFS4_OPAQUE_LIMIT+1];
- +
- + uid = (uid_t)atol(uidstr);
- + dprintf(ACLLVL, "map_nfs4ace_who: uidstr='%s', uid=%u\n",
- + uidstr, (unsigned int)uid);
- +
- + /* fixme! */
- + extern nfs41_daemon_globals nfs41_dg;
- +
- + status = nfs41_idmap_uid_to_name(nfs41_dg.idmapper, uid,
- + tmpwho, sizeof(tmpwho));
- + if (status) {
- + dprintf(ACLLVL, "map_nfs4ace_who: "
- + "nfs41_idmap_uid_to_name() failed, status=%d\n",
- + status);
- + goto out;
- + }
- +
- + (void)snprintf(who_out, NFS4_OPAQUE_LIMIT, "%s@%s", tmpwho, domain);
- +
- + dprintf(ACLLVL, "map_nfs4ace_who: returning Unix_User+ who='%s'\n", who_out);
- +
- + goto out;
- + }
- + else {
- + dprintf(ACLLVL, "map_nfs4ace_who: Not an Unix_User+ SID\n");
- + }
- +
- + /*
- + * Handle special "Unix_Group+<gid>"-SIDs
- + */
- + if (!strncmp(sidstr, UNIXGROUPSID_PREFIX, strlen(UNIXGROUPSID_PREFIX))) {
- + const char *gidstr = sidstr+strlen(UNIXGROUPSID_PREFIX);
- + gid_t gid;
- + char tmpwho[NFS4_OPAQUE_LIMIT+1];
- +
- + gid = (uid_t)atol(gidstr);
- + dprintf(ACLLVL, "map_nfs4ace_who: gidstr='%s', gid=%u\n",
- + gidstr, (unsigned int)gid);
- +
- + /* fixme! */
- + extern nfs41_daemon_globals nfs41_dg;
- +
- + status = nfs41_idmap_gid_to_group(nfs41_dg.idmapper, gid,
- + tmpwho, sizeof(tmpwho));
- + if (status) {
- + dprintf(ACLLVL, "map_nfs4ace_who: "
- + "nfs41_idmap_gid_to_group() failed, status=%d\n",
- + status);
- + goto out;
- + }
- +
- + (void)snprintf(who_out, NFS4_OPAQUE_LIMIT, "%s@%s", tmpwho, domain);
- +
- + dprintf(ACLLVL, "map_nfs4ace_who: returning Unix_Group+ who='%s'\n", who_out);
- +
- + goto out;
- + }
- + else {
- + dprintf(ACLLVL, "map_nfs4ace_who: Not an Unix_Group+ SID\n");
- + }
- +#endif /* NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID */
- +
- status = LookupAccountSidA(NULL, sid, who, &size, tmp_buf,
- &tmp_size, &sid_type);
- dprintf(ACLLVL, "map_nfs4ace_who: LookupAccountSid returned %d GetLastError "
- @@ -526,6 +607,8 @@ add_domain:
- if (who) free(who);
- status = ERROR_SUCCESS;
- out:
- + if (sidstr)
- + LocalFree(sidstr);
- return status;
- out_free_who:
- free(who);
- diff --git a/daemon/sid.h b/daemon/sid.h
- index e6d87c5..232e456 100644
- --- a/daemon/sid.h
- +++ b/daemon/sid.h
- @@ -27,6 +27,10 @@
- #include "nfs41_build_features.h"
- #include "nfs41_daemon.h"
- +#define UNIXUSERSID_PREFIX "S-1-22-1-"
- +#define UNIXGROUPSID_PREFIX "S-1-22-2-"
- +
- +
- /* prototypes */
- int create_unknownsid(WELL_KNOWN_SID_TYPE type, PSID *sid, DWORD *sid_len);
- void sidcache_init(void);
- diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
- index b3cf06c..d496497 100644
- --- a/sys/nfs41_driver.c
- +++ b/sys/nfs41_driver.c
- @@ -2643,8 +2643,10 @@ NTSTATUS map_mount_errors(
- case ERROR_BAD_NET_RESP: return STATUS_UNEXPECTED_NETWORK_ERROR;
- case ERROR_BAD_NET_NAME: return STATUS_BAD_NETWORK_NAME;
- case ERROR_BAD_NETPATH: return STATUS_BAD_NETWORK_PATH;
- + case ERROR_INTERNAL_ERROR: return STATUS_INTERNAL_ERROR;
- default:
- - print_error("failed to map windows error %d to NTSTATUS; "
- + print_error("map_mount_errors: "
- + "failed to map windows ERROR_%d to NTSTATUS; "
- "defaulting to STATUS_INSUFFICIENT_RESOURCES\n", status);
- return STATUS_INSUFFICIENT_RESOURCES;
- }
- @@ -3604,8 +3606,9 @@ NTSTATUS map_open_errors(
- case ERROR_TOO_MANY_LINKS: return STATUS_TOO_MANY_LINKS;
- case ERROR_DIRECTORY: return STATUS_FILE_IS_A_DIRECTORY;
- case ERROR_BAD_FILE_TYPE: return STATUS_NOT_A_DIRECTORY;
- + case ERROR_INTERNAL_ERROR: return STATUS_INTERNAL_ERROR;
- default:
- - print_error("[ERROR] nfs41_Create: upcall returned %d returning "
- + print_error("[ERROR] nfs41_Create: upcall returned ERROR_%d returning "
- "STATUS_INSUFFICIENT_RESOURCES\n", status);
- case ERROR_OUTOFMEMORY: return STATUS_INSUFFICIENT_RESOURCES;
- }
- @@ -4215,7 +4218,8 @@ NTSTATUS map_close_errors(
- case ERROR_NOT_EMPTY: return STATUS_DIRECTORY_NOT_EMPTY;
- case ERROR_FILE_INVALID: return STATUS_FILE_INVALID;
- default:
- - print_error("failed to map windows error %d to NTSTATUS; "
- + print_error("map_close_errors: "
- + "failed to map windows ERROR_%d to NTSTATUS; "
- "defaulting to STATUS_INTERNAL_ERROR\n", status);
- case ERROR_INTERNAL_ERROR: return STATUS_INTERNAL_ERROR;
- }
- @@ -4345,8 +4349,10 @@ NTSTATUS map_querydir_errors(
- case ERROR_NO_MORE_FILES: return STATUS_NO_MORE_FILES;
- case ERROR_OUTOFMEMORY: return STATUS_INSUFFICIENT_RESOURCES;
- case ERROR_FILENAME_EXCED_RANGE: return STATUS_NAME_TOO_LONG;
- + case ERROR_INTERNAL_ERROR: return STATUS_INTERNAL_ERROR;
- default:
- - print_error("failed to map windows error %d to NTSTATUS; "
- + print_error("map_querydir_errors: "
- + "failed to map windows ERROR_%d to NTSTATUS; "
- "defaulting to STATUS_INVALID_NETWORK_RESPONSE\n", status);
- case ERROR_BAD_NET_RESP: return STATUS_INVALID_NETWORK_RESPONSE;
- }
- @@ -4489,8 +4495,10 @@ NTSTATUS map_volume_errors(
- case ERROR_NETNAME_DELETED: return STATUS_NETWORK_NAME_DELETED;
- case ERROR_INVALID_PARAMETER: return STATUS_INVALID_PARAMETER;
- case ERROR_OUTOFMEMORY: return STATUS_INSUFFICIENT_RESOURCES;
- + case ERROR_INTERNAL_ERROR: return STATUS_INTERNAL_ERROR;
- default:
- - print_error("failed to map windows error %d to NTSTATUS; "
- + print_error("map_volume_errors: "
- + "failed to map windows ERROR_%d to NTSTATUS; "
- "defaulting to STATUS_INVALID_NETWORK_RESPONSE\n", status);
- case ERROR_BAD_NET_RESP: return STATUS_INVALID_NETWORK_RESPONSE;
- }
- @@ -4769,8 +4777,10 @@ NTSTATUS map_setea_error(
- case ERROR_INVALID_EA_HANDLE: return STATUS_NONEXISTENT_EA_ENTRY;
- case ERROR_NO_MORE_FILES: return STATUS_NO_MORE_EAS;
- case ERROR_EA_FILE_CORRUPT: return STATUS_EA_CORRUPT_ERROR;
- + case ERROR_INTERNAL_ERROR: return STATUS_INTERNAL_ERROR;
- default:
- - print_error("failed to map windows error %d to NTSTATUS; "
- + print_error("map_setea_error: "
- + "failed to map windows ERROR_%d to NTSTATUS; "
- "defaulting to STATUS_INVALID_PARAMETER\n", error);
- case ERROR_INVALID_PARAMETER: return STATUS_INVALID_PARAMETER;
- }
- @@ -5185,8 +5195,10 @@ NTSTATUS map_query_acl_error(
- case ERROR_ACCESS_DENIED: return STATUS_ACCESS_DENIED;
- case ERROR_FILE_NOT_FOUND: return STATUS_OBJECT_NAME_NOT_FOUND;
- case ERROR_INVALID_PARAMETER: return STATUS_INVALID_PARAMETER;
- + case ERROR_INTERNAL_ERROR: return STATUS_INTERNAL_ERROR;
- default:
- - print_error("failed to map windows error %d to NTSTATUS; "
- + print_error("map_query_acl_error: "
- + "failed to map windows ERROR_%d to NTSTATUS; "
- "defaulting to STATUS_INVALID_NETWORK_RESPONSE\n", error);
- case ERROR_BAD_NET_RESP: return STATUS_INVALID_NETWORK_RESPONSE;
- }
- @@ -5449,8 +5461,10 @@ NTSTATUS map_queryfile_error(
- case ERROR_ACCESS_DENIED: return STATUS_ACCESS_DENIED;
- case ERROR_NETNAME_DELETED: return STATUS_NETWORK_NAME_DELETED;
- case ERROR_INVALID_PARAMETER: return STATUS_INVALID_PARAMETER;
- + case ERROR_INTERNAL_ERROR: return STATUS_INTERNAL_ERROR;
- default:
- - print_error("failed to map windows error %d to NTSTATUS; "
- + print_error("map_queryfile_error: "
- + "failed to map windows ERROR_%d to NTSTATUS; "
- "defaulting to STATUS_INVALID_NETWORK_RESPONSE\n", error);
- case ERROR_BAD_NET_RESP: return STATUS_INVALID_NETWORK_RESPONSE;
- }
- @@ -5634,8 +5648,10 @@ NTSTATUS map_setfile_error(
- case ERROR_NETWORK_ACCESS_DENIED: return STATUS_NETWORK_ACCESS_DENIED;
- case ERROR_NETNAME_DELETED: return STATUS_NETWORK_NAME_DELETED;
- case ERROR_BUFFER_OVERFLOW: return STATUS_INSUFFICIENT_RESOURCES;
- + case ERROR_INTERNAL_ERROR: return STATUS_INTERNAL_ERROR;
- default:
- - print_error("failed to map windows error %d to NTSTATUS; "
- + print_error("map_setfile_error: "
- + "failed to map windows ERROR_%d to NTSTATUS; "
- "defaulting to STATUS_INVALID_PARAMETER\n", error);
- case ERROR_INVALID_PARAMETER: return STATUS_INVALID_PARAMETER;
- }
- @@ -6022,8 +6038,10 @@ NTSTATUS map_readwrite_errors(
- case ERROR_LOCK_VIOLATION: return STATUS_FILE_LOCK_CONFLICT;
- case ERROR_NETWORK_ACCESS_DENIED: return STATUS_NETWORK_ACCESS_DENIED;
- case ERROR_NETNAME_DELETED: return STATUS_NETWORK_NAME_DELETED;
- + case ERROR_INTERNAL_ERROR: return STATUS_INTERNAL_ERROR;
- default:
- - print_error("failed to map windows error %d to NTSTATUS; "
- + print_error("map_readwrite_errors: "
- + "failed to map windows ERROR_%d to NTSTATUS; "
- "defaulting to STATUS_NET_WRITE_FAULT\n", status);
- case ERROR_NET_WRITE_FAULT: return STATUS_NET_WRITE_FAULT;
- }
- @@ -6301,8 +6319,10 @@ NTSTATUS map_lock_errors(
- /* if we return ERROR_INVALID_PARAMETER, Windows translates that to
- * success!! */
- case ERROR_INVALID_PARAMETER: return STATUS_LOCK_NOT_GRANTED;
- + case ERROR_INTERNAL_ERROR: return STATUS_INTERNAL_ERROR;
- default:
- - print_error("failed to map windows error %d to NTSTATUS; "
- + print_error("map_lock_errors: "
- + "failed to map windows ERROR_%d to NTSTATUS; "
- "defaulting to STATUS_INVALID_NETWORK_RESPONSE\n", status);
- case ERROR_BAD_NET_RESP: return STATUS_INVALID_NETWORK_RESPONSE;
- }
- @@ -6521,8 +6541,10 @@ NTSTATUS map_symlink_errors(
- case ERROR_INSUFFICIENT_BUFFER: return STATUS_BUFFER_TOO_SMALL;
- case STATUS_BUFFER_TOO_SMALL:
- case ERROR_BUFFER_OVERFLOW: return STATUS_BUFFER_OVERFLOW;
- + case ERROR_INTERNAL_ERROR: return STATUS_INTERNAL_ERROR;
- default:
- - print_error("failed to map windows error %d to NTSTATUS; "
- + print_error("map_symlink_errors: "
- + "failed to map windows ERROR_%d to NTSTATUS; "
- "defaulting to STATUS_INVALID_NETWORK_RESPONSE\n", status);
- case ERROR_BAD_NET_RESP: return STATUS_INVALID_NETWORK_RESPONSE;
- }
msnfs41client $ cp -p chmodtest chmodtest_cp2 # fails with "Function not implemented"
Posted by Anonymous on Wed 7th Feb 2024 14:33
raw | new post
modification of post by Anonymous (view diff)
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.