- From fc428284ffc8e6e74946641facf6c828878e8c59 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Mon, 9 Oct 2023 17:42:23 +0200
- Subject: [PATCH 1/2] Add infrastructure so Cygwin |stat()| can return local
- uid/gid
- Add infrastructure so Cygwin |stat()| can return local uid/gid via
- the private "NfsV3Attributes" API (originally added by Microsoft
- for their NFSv3 client).
- The code is currently disabled (set
- |NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES| to |1| in
- sys/nfs41_build_features.h to enable it), until we wire it into
- the idmap code.
- Additionally we add sys/nfs41_build_features.h to enable/disable
- features during build time.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- daemon/open.c | 135 ++++++++++++++++++++++++++++++++++++-
- daemon/upcall.h | 5 ++
- sys/nfs41_build_features.h | 38 +++++++++++
- sys/nfs41_driver.c | 122 +++++++++++++++++++++++----------
- 4 files changed, 261 insertions(+), 39 deletions(-)
- create mode 100644 sys/nfs41_build_features.h
- diff --git a/daemon/open.c b/daemon/open.c
- index c7bd412..9d564d6 100644
- --- a/daemon/open.c
- +++ b/daemon/open.c
- @@ -21,16 +21,17 @@
- #include <Windows.h>
- #include <stdio.h>
- +#include <ctype.h>
- #include <strsafe.h>
- #include "nfs41_ops.h"
- +#include "nfs41_build_features.h"
- #include "delegation.h"
- #include "from_kernel.h"
- #include "daemon_debug.h"
- #include "upcall.h"
- #include "util.h"
- -
- static int create_open_state(
- IN const char *path,
- IN uint32_t open_owner_id,
- @@ -295,6 +296,12 @@ static int parse_open(unsigned char *buffer, uint32_t length, nfs41_upcall *upca
- if (status) goto out;
- status = safe_read(&buffer, &length, &args->mode, sizeof(DWORD));
- if (status) goto out;
- +#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- + status = safe_read(&buffer, &length, &args->owner_local_uid, sizeof(DWORD));
- + if (status) goto out;
- + status = safe_read(&buffer, &length, &args->owner_group_local_gid, sizeof(DWORD));
- + if (status) goto out;
- +#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
- status = safe_read(&buffer, &length, &args->srv_open, sizeof(HANDLE));
- if (status) goto out;
- status = parse_abs_path(&buffer, &length, &args->symlink);
- @@ -305,9 +312,16 @@ static int parse_open(unsigned char *buffer, uint32_t length, nfs41_upcall *upca
- dprintf(1, "parsing NFS41_OPEN: filename='%s' access mask=%d "
- "access mode=%d\n\tfile attrs=0x%x create attrs=0x%x "
- "(kernel) disposition=%d\n\topen_owner_id=%d mode=%o "
- +#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- + "owner_local_uid=%u owner_group_local_gid=%u "
- +#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
- "srv_open=%p symlink=%s ea=%p\n", args->path, args->access_mask,
- args->access_mode, args->file_attrs, args->create_opts,
- - args->disposition, args->open_owner_id, args->mode, args->srv_open,
- + args->disposition, args->open_owner_id, args->mode,
- +#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- + (unsigned int)args->owner_local_uid, (unsigned int)args->owner_group_local_gid,
- +#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
- + args->srv_open,
- args->symlink.path, args->ea);
- print_disposition(2, args->disposition);
- print_access_mask(2, args->access_mask);
- @@ -644,6 +658,117 @@ static int handle_open(nfs41_upcall *upcall)
- nfs_to_standard_info(&info, &args->std_info);
- args->mode = info.mode;
- args->changeattr = info.change;
- +
- +#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- + bitmap4 og_attr_request = { 0 };
- + nfs41_file_info og_info = { 0 };
- + char owner[NFS4_OPAQUE_LIMIT], group[NFS4_OPAQUE_LIMIT];
- + nfsacl41 acl = { 0 };
- +
- + /*
- + * gisburn:
- + * 1. We should cache owner/group information
- + * 2. We should always ask for
- + * FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP with the other
- + * attributes
- + */
- + og_attr_request.count = 2;
- + og_attr_request.arr[1] = FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP;
- + og_info.owner = owner;
- + og_info.owner_group = group;
- + status = nfs41_getattr(state->session, &state->file, &og_attr_request, &og_info);
- + if (status) {
- + eprintf("get_stat_data: nfs41_cached_getattr() failed with %d\n",
- + status);
- + }
- +
- +#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_TESTMAPPING
- + /*
- + * Map owner to local uid
- + *
- + * |owner| can be numeric string ("1616"), plain username
- + * ("gisburn") or username@domain ("gisburn@sun.com")
- + */
- + /* stomp over '@' */
- + char *at_ch; /* pointer to '@' */
- + if (at_ch = strchr(og_info.owner, '@'))
- + *at_ch = '\0';
- +
- + if (isdigit(og_info.owner[0])) {
- + args->owner_local_uid = atol(og_info.owner);
- + }
- + else if(!strcmp(og_info.owner, "nobody")) {
- + args->owner_local_uid = 65534;
- + }
- + else if(!strcmp(og_info.owner, "root")) {
- + args->owner_local_uid = 0;
- + }
- + else if(!strcmp(og_info.owner, "rmainz")) {
- + args->owner_local_uid = 1616;
- + }
- + else if(!strcmp(og_info.owner, "roland_mainz")) {
- + args->owner_local_uid = 197608;
- + }
- + else if(!strcmp(og_info.owner, "swulsch")) {
- + args->owner_local_uid = 1818;
- + }
- + else if(!strcmp(og_info.owner, "iam")) {
- + args->owner_local_uid = 2010;
- + }
- + else if(!strcmp(og_info.owner, "mwenzel")) {
- + args->owner_local_uid = 8239;
- + }
- + else if(!strcmp(og_info.owner, "test001")) {
- + args->owner_local_uid = 1000;
- + }
- + else {
- + args->owner_local_uid = 666; /* debug: number of the beast */
- + }
- +
- + /*
- + * Map owner_group to local gid
- + *
- + * |owner_group| can be numeric string ("1616"), plain username
- + * ("gisgrp") or username@domain ("gisgrp@sun.com")
- + */
- + if (at_ch = strchr(og_info.owner_group, '@'))
- + *at_ch = '\0';
- + if (isdigit(og_info.owner_group[0])) {
- + args->owner_group_local_gid = atol(og_info.owner_group);
- + }
- + else if(!strcmp(og_info.owner_group, "nogroup")) {
- + args->owner_group_local_gid = 65534;
- + }
- + else if(!strcmp(og_info.owner_group, "root")) {
- + args->owner_group_local_gid = 0;
- + }
- + else if(!strcmp(og_info.owner_group, "Kein")) {
- + args->owner_group_local_gid = 197121;
- + }
- + else if(!strcmp(og_info.owner_group, "rmainz")) {
- + args->owner_group_local_gid = 1616;
- + }
- + else if(!strcmp(og_info.owner, "iam")) {
- + args->owner_group_local_gid = 2010;
- + }
- + else if(!strcmp(og_info.owner_group, "swulsch")) {
- + args->owner_group_local_gid = 1818;
- + }
- + else if(!strcmp(og_info.owner_group, "mwenzel")) {
- + args->owner_group_local_gid = 8239;
- + }
- + else if(!strcmp(og_info.owner_group, "test001")) {
- + args->owner_group_local_gid = 1000;
- + }
- + else {
- + args->owner_group_local_gid = 666; /* debug: number of the beast */
- + }
- +#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_TESTMAPPING */
- +
- + dprintf(1, "handle_open: stat: owner=%u/'%s', owner_group=%u/'%s'\n",
- + (unsigned int)args->owner_local_uid, og_info.owner,
- + (unsigned int)args->owner_group_local_gid, og_info.owner_group);
- +#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
- } else {
- nfs41_file_info createattrs = { 0 };
- uint32_t create = 0, createhowmode = 0, lookup_status = status;
- @@ -753,6 +878,12 @@ static int marshall_open(unsigned char *buffer, uint32_t *length, nfs41_upcall *
- if (status) goto out;
- status = safe_write(&buffer, length, &args->mode, sizeof(args->mode));
- if (status) goto out;
- +#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- + status = safe_write(&buffer, length, &args->owner_local_uid, sizeof(args->owner_local_uid));
- + if (status) goto out;
- + status = safe_write(&buffer, length, &args->owner_group_local_gid, sizeof(args->owner_group_local_gid));
- + if (status) goto out;
- +#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
- status = safe_write(&buffer, length, &args->changeattr, sizeof(args->changeattr));
- if (status) goto out;
- status = safe_write(&buffer, length, &args->deleg_type, sizeof(args->deleg_type));
- diff --git a/daemon/upcall.h b/daemon/upcall.h
- index d224a6d..6dad62d 100644
- --- a/daemon/upcall.h
- +++ b/daemon/upcall.h
- @@ -23,6 +23,7 @@
- #define __NFS41_DAEMON_UPCALL_H__
- #include "nfs41_ops.h"
- +#include "nfs41_build_features.h"
- #include "from_kernel.h"
- #define NFSD_VERSION_MISMATCH 116
- @@ -50,6 +51,10 @@ typedef struct __open_upcall_args {
- ULONG create_opts;
- LONG open_owner_id;
- DWORD mode;
- +#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- + DWORD owner_local_uid; /* owner mapped into local uid */
- + DWORD owner_group_local_gid; /* owner group mapped into local gid */
- +#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
- ULONGLONG changeattr;
- HANDLE srv_open;
- DWORD deleg_type;
- diff --git a/sys/nfs41_build_features.h b/sys/nfs41_build_features.h
- new file mode 100644
- index 0000000..4ce5976
- --- /dev/null
- +++ b/sys/nfs41_build_features.h
- @@ -0,0 +1,38 @@
- +/* NFSv4.1 client for Windows
- + * Copyright © 2012 The Regents of the University of Michigan
- + *
- + * Olga Kornievskaia <aglo@umich.edu>
- + * Casey Bodley <cbodley@umich.edu>
- + * Roland Mainz <roland.mainz@nrubsig.org>
- + *
- + * This library is free software; you can redistribute it and/or modify it
- + * under the terms of the GNU Lesser General Public License as published by
- + * the Free Software Foundation; either version 2.1 of the License, or (at
- + * your option) any later version.
- + *
- + * This library is distributed in the hope that it will be useful, but
- + * without any warranty; without even the implied warranty of merchantability
- + * or fitness for a particular purpose. See the GNU Lesser General Public
- + * License for more details.
- + *
- + * You should have received a copy of the GNU Lesser General Public License
- + * along with this library; if not, write to the Free Software Foundation,
- + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- + */
- +
- +#ifndef _NFS41_DRIVER_BUILDFEATURES_
- +#define _NFS41_DRIVER_BUILDFEATURES_ 1
- +
- +/*
- + * NFS41_DRIVER_FEATURE_* - features for this build, we use this
- + * for development to add new features which are "off" by default
- + * until they are ready
- + */
- +
- +/*
- + * NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES - return local uid/gid values
- + */
- +// #define NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES 1
- +// #define NFS41_DRIVER_FEATURE_LOCAL_UIDGID_TESTMAPPING 1
- +
- +#endif /* !_NFS41_DRIVER_BUILDFEATURES_ */
- diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
- index 6a8061d..b52a151 100644
- --- a/sys/nfs41_driver.c
- +++ b/sys/nfs41_driver.c
- @@ -29,6 +29,8 @@
- #include "nfs41_driver.h"
- #include "nfs41_np.h"
- #include "nfs41_debug.h"
- +#include "nfs41_build_features.h"
- +
- #define USE_MOUNT_SEC_CONTEXT
- @@ -200,6 +202,10 @@ typedef struct _updowncall_entry {
- ULONG cattrs;
- LONG open_owner_id;
- DWORD mode;
- +#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- + DWORD owner_local_uid;
- + DWORD owner_group_local_gid;
- +#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
- HANDLE srv_open;
- DWORD deleg_type;
- BOOLEAN symlink_embedded;
- @@ -385,6 +391,10 @@ typedef struct _NFS41_FCB {
- BOOLEAN Renamed;
- BOOLEAN DeletePending;
- DWORD mode;
- +#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- + DWORD owner_local_uid; /* owner mapped into local uid */
- + DWORD owner_group_local_gid; /* owner group mapped into local gid */
- +#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
- ULONGLONG changeattr;
- } NFS41_FCB, *PNFS41_FCB;
- #define NFS41GetFcbExtension(pFcb) \
- @@ -612,13 +622,13 @@ NTSTATUS marshal_nfs41_mount(
- if (!MmIsAddressValid(entry->u.Mount.srv_name) ||
- !MmIsAddressValid(entry->u.Mount.root)) {
- status = STATUS_INTERNAL_ERROR;
- - goto out;
- - }
- - header_len = *len + length_as_utf8(entry->u.Mount.srv_name) +
- - length_as_utf8(entry->u.Mount.root) + 3 * sizeof(DWORD);
- - if (header_len > buf_len) {
- - status = STATUS_INSUFFICIENT_RESOURCES;
- - goto out;
- + goto out;
- + }
- + header_len = *len + length_as_utf8(entry->u.Mount.srv_name) +
- + length_as_utf8(entry->u.Mount.root) + 3 * sizeof(DWORD);
- + if (header_len > buf_len) {
- + status = STATUS_INSUFFICIENT_RESOURCES;
- + goto out;
- }
- status = marshall_unicode_as_utf8(&tmp, entry->u.Mount.srv_name);
- if (status) goto out;
- @@ -667,7 +677,11 @@ NTSTATUS marshal_nfs41_open(
- else tmp += *len;
- header_len = *len + length_as_utf8(entry->filename) +
- - 7 * sizeof(ULONG) + 2 * sizeof(HANDLE) +
- + 7 * sizeof(ULONG) +
- +#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- + 2 * sizeof(DWORD) +
- +#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
- + 2 * sizeof(HANDLE) +
- length_as_utf8(&entry->u.Open.symlink);
- if (header_len > buf_len) {
- status = STATUS_INSUFFICIENT_RESOURCES;
- @@ -692,6 +706,12 @@ NTSTATUS marshal_nfs41_open(
- tmp += sizeof(entry->u.Open.open_owner_id);
- RtlCopyMemory(tmp, &entry->u.Open.mode, sizeof(DWORD));
- tmp += sizeof(DWORD);
- +#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- + RtlCopyMemory(tmp, &entry->u.Open.owner_local_uid, sizeof(DWORD));
- + tmp += sizeof(DWORD);
- + RtlCopyMemory(tmp, &entry->u.Open.owner_group_local_gid, sizeof(DWORD));
- + tmp += sizeof(DWORD);
- +#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
- RtlCopyMemory(tmp, &entry->u.Open.srv_open, sizeof(HANDLE));
- tmp += sizeof(HANDLE);
- status = marshall_unicode_as_utf8(&tmp, &entry->u.Open.symlink);
- @@ -718,10 +738,17 @@ NTSTATUS marshal_nfs41_open(
- #ifdef DEBUG_MARSHAL_DETAIL
- DbgP("marshal_nfs41_open: name=%wZ mask=0x%x access=0x%x attrs=0x%x "
- - "opts=0x%x dispo=0x%x open_owner_id=0x%x mode=%o srv_open=%p ea=%p\n",
- + "opts=0x%x dispo=0x%x open_owner_id=0x%x mode=%o "
- +#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- + "owner_local_uid=%lu owner_group_local_gid=%lu "
- +#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
- + "srv_open=%p ea=%p\n",
- entry->filename, entry->u.Open.access_mask,
- entry->u.Open.access_mode, entry->u.Open.attrs, entry->u.Open.copts,
- entry->u.Open.disp, entry->u.Open.open_owner_id, entry->u.Open.mode,
- +#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- + entry->u.Open.owner_local_uid,entry->u.Open.owner_group_local_gid,
- +#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
- entry->u.Open.srv_open, entry->u.Open.EaBuffer);
- #endif
- out:
- @@ -1647,6 +1674,12 @@ NTSTATUS unmarshal_nfs41_open(
- *buf += sizeof(HANDLE);
- RtlCopyMemory(&cur->u.Open.mode, *buf, sizeof(DWORD));
- *buf += sizeof(DWORD);
- +#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- + RtlCopyMemory(&cur->u.Open.owner_local_uid, *buf, sizeof(DWORD));
- + *buf += sizeof(DWORD);
- + RtlCopyMemory(&cur->u.Open.owner_group_local_gid, *buf, sizeof(DWORD));
- + *buf += sizeof(DWORD);
- +#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
- RtlCopyMemory(&cur->ChangeTime, *buf, sizeof(ULONGLONG));
- *buf += sizeof(ULONGLONG);
- RtlCopyMemory(&cur->u.Open.deleg_type, *buf, sizeof(DWORD));
- @@ -1673,10 +1706,17 @@ NTSTATUS unmarshal_nfs41_open(
- #endif
- }
- #ifdef DEBUG_MARSHAL_DETAIL
- - DbgP("unmarshal_nfs41_open: open_state 0x%x mode %o changeattr %llu "
- - "deleg_type %d\n", cur->open_state, cur->u.Open.mode,
- + DbgP("unmarshal_nfs41_open: open_state 0x%x mode %o "
- +#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- + "owner_local_uid %u owner_group_local_gid %u "
- +#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
- + "changeattr %llu "
- + "deleg_type %d\n", cur->open_state, cur->u.Open.mode,
- +#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- + cur->u.Open.owner_local_uid, cur->u.Open.owner_group_local_gid,
- +#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
- cur->ChangeTime, cur->u.Open.deleg_type);
- -#endif
- +#endif /* DEBUG_MARSHAL_DETAIL */
- out:
- return status;
- }
- @@ -3500,15 +3540,15 @@ NTSTATUS check_nfs41_create_args(
- }
- /* rdbss seems miss this sharing_violation check */
- - if (Fcb->OpenCount && params->Disposition == FILE_SUPERSEDE) {
- - if ((!RxContext->CurrentIrpSp->FileObject->SharedRead &&
- - (params->DesiredAccess & FILE_READ_DATA)) ||
- - ((!RxContext->CurrentIrpSp->FileObject->SharedWrite &&
- - (params->DesiredAccess & (FILE_WRITE_DATA | FILE_APPEND_DATA |
- - FILE_WRITE_ATTRIBUTES))) ||
- - (!RxContext->CurrentIrpSp->FileObject->SharedDelete &&
- - (params->DesiredAccess & DELETE)))) {
- - status = STATUS_SHARING_VIOLATION;
- + if (Fcb->OpenCount && params->Disposition == FILE_SUPERSEDE) {
- + if ((!RxContext->CurrentIrpSp->FileObject->SharedRead &&
- + (params->DesiredAccess & FILE_READ_DATA)) ||
- + ((!RxContext->CurrentIrpSp->FileObject->SharedWrite &&
- + (params->DesiredAccess & (FILE_WRITE_DATA | FILE_APPEND_DATA |
- + FILE_WRITE_ATTRIBUTES))) ||
- + (!RxContext->CurrentIrpSp->FileObject->SharedDelete &&
- + (params->DesiredAccess & DELETE)))) {
- + status = STATUS_SHARING_VIOLATION;
- goto out;
- }
- }
- @@ -3754,6 +3794,10 @@ retry_on_link:
- RtlCopyMemory(&nfs41_fcb->StandardInfo, &entry->u.Open.sinfo,
- sizeof(entry->u.Open.sinfo));
- nfs41_fcb->mode = entry->u.Open.mode;
- +#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- + nfs41_fcb->owner_local_uid = entry->u.Open.owner_local_uid;
- + nfs41_fcb->owner_group_local_gid = entry->u.Open.owner_group_local_gid;
- +#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
- nfs41_fcb->changeattr = entry->ChangeTime;
- if (((params->CreateOptions & FILE_DELETE_ON_CLOSE) &&
- !pVNetRootContext->read_only) || oldDeletePending)
- @@ -4311,14 +4355,14 @@ NTSTATUS nfs41_QueryVolumeInformation(
- print_queryvolume_args(RxContext);
- #endif
- - status = check_nfs41_dirquery_args(RxContext);
- - if (status) goto out;
- -
- - RtlZeroMemory(RxContext->Info.Buffer, RxContext->Info.LengthRemaining);
- -
- - switch (InfoClass) {
- - case FileFsVolumeInformation:
- - if ((ULONG)RxContext->Info.LengthRemaining >= DevExt->VolAttrsLen) {
- + status = check_nfs41_dirquery_args(RxContext);
- + if (status) goto out;
- +
- + RtlZeroMemory(RxContext->Info.Buffer, RxContext->Info.LengthRemaining);
- +
- + switch (InfoClass) {
- + case FileFsVolumeInformation:
- + if ((ULONG)RxContext->Info.LengthRemaining >= DevExt->VolAttrsLen) {
- RtlCopyMemory(RxContext->Info.Buffer, DevExt->VolAttrs,
- DevExt->VolAttrsLen);
- RxContext->Info.LengthRemaining -= DevExt->VolAttrsLen;
- @@ -4502,6 +4546,10 @@ void create_nfs3_attrs(
- else
- attrs->type = NF3REG;
- attrs->mode = nfs41_fcb->mode;
- +#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
- + attrs->uid = nfs41_fcb->owner_local_uid;
- + attrs->gid = nfs41_fcb->owner_group_local_gid;
- +#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
- attrs->nlink = nfs41_fcb->StandardInfo.NumberOfLinks;
- attrs->size.QuadPart = attrs->used.QuadPart =
- nfs41_fcb->StandardInfo.EndOfFile.QuadPart;
- @@ -6085,14 +6133,14 @@ NTSTATUS nfs41_Lock(
- LARGE_INTEGER poll_delay = {0};
- #ifdef ENABLE_TIMINGS
- LARGE_INTEGER t1, t2;
- - t1 = KeQueryPerformanceCounter(NULL);
- -#endif
- -
- - poll_delay.QuadPart = 0;
- -
- -#ifdef DEBUG_LOCK
- - DbgEn();
- - print_lock_args(RxContext);
- + t1 = KeQueryPerformanceCounter(NULL);
- +#endif
- +
- + poll_delay.QuadPart = 0;
- +
- +#ifdef DEBUG_LOCK
- + DbgEn();
- + print_lock_args(RxContext);
- #endif
- /* RxReleaseFcbResourceForThreadInMRx(RxContext, RxContext->pFcb,
- --
- 2.39.0
msnfs42client: Add infrastructure so Cygwin |stat()| can return local uid/gid
Posted by Anonymous on Mon 9th Oct 2023 17:45
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.