pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS

Difference between
modified post cd2225 by Anonymous on Fri 20th Oct 2023 14:23
original post e01 by Anonymous on Thu 19th Oct 2023 20:51
Download diff
Show old version | new version | both versions

    
11
diff --git a/daemon/acl.c b/daemon/acl.c
22
index 1d1eac4..9c30eeb 100644
33
--- a/daemon/acl.c
44
+++ b/daemon/acl.c
55
@@ -223,6 +223,19 @@ static int map_name_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *sid_l
66
             name = "roland_mainz";
77
             dprintf(ACLLVL, "map_name_2_sid: remap 1616 --> roland_mainz\n");
88
         }
99
+        else if (!strcmp(name, "swulsch")) {
1010
+            name = "siegfried_wulsch";
1111
+            dprintf(ACLLVL, "map_name_2_sid: remap swulsch --> siegfried_wulsch\n");
1212
+        }
1313
+        else if (!strcmp(name, "197609")) {
1414
+            name = "siegfried_wulsch";
1515
+            dprintf(ACLLVL, "map_name_2_sid: remap 197609 --> siegfried_wulsch\n");
1616
+        }
1717
+        else if (!strcmp(name, "1818")) {
1818
+            name = "siegfried_wulsch";
1919
+            dprintf(ACLLVL, "map_name_2_sid: remap 1818 --> siegfried_wulsch\n");
2020
+        }
2121
+
2222
     }
2323
 #endif /* NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID */
2424
2525
diff --git a/daemon/daemon_debug.h b/daemon/daemon_debug.h
26-
index f484d58..b77e7d7 100644
26+
index f484d58..17cf046 100644
2727
--- a/daemon/daemon_debug.h
2828
+++ b/daemon/daemon_debug.h
29-
@@ -34,6 +34,11 @@
29+
@@ -34,6 +34,15 @@
3030
 #define DEFAULT_DEBUG_LEVEL 1
3131
3232
33-
+#define DASSERT(exp) \
33+
+#define EASSERT(exp) \
3434
+    if (!(exp)) { \
3535
+        eprintf("ASSERTION '%s' in '%s'/%ld failed.\n", \
3636
+            ""#exp"", __FILE__, (long)__LINE__); }
37+
+#define DASSERT(exp, level) \
3741
+
3842
 /* daemon_debug.h */
3943
 void set_debug_level(int level);
4044
 void dprintf(int level, LPCSTR format, ...);
4145
diff --git a/daemon/lookup.c b/daemon/lookup.c
42-
index ea0a9d2..f72afe5 100644
46+
index ea0a9d2..b90c3bd 100644
4347
--- a/daemon/lookup.c
4448
+++ b/daemon/lookup.c
4549
@@ -85,7 +85,8 @@ static void init_component_args(
4650
     args->attr_request.arr[1] = FATTR4_WORD1_MODE
4751
         | FATTR4_WORD1_NUMLINKS | FATTR4_WORD1_SYSTEM
4852
         | FATTR4_WORD1_TIME_ACCESS | FATTR4_WORD1_TIME_CREATE
4953
-        | FATTR4_WORD1_TIME_MODIFY;
5054
+        | FATTR4_WORD1_TIME_MODIFY
5155
+        | FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP;
5256
5357
     args->getrootattr.attr_request = &args->attr_request;
5458
     res->root.path = path;
55-
@@ -210,8 +211,12 @@ static int server_lookup(
59+
@@ -210,8 +211,9 @@ static int server_lookup(
5660
     if (count == 0) {
5761
         if (target_out)
5862
             *target_out = dir;
5963
-        if (info_out)
64+
-            memcpy(info_out, res->getrootattr.info, sizeof(nfs41_file_info));
6065
+        if (info_out) {
61-
+            /* fixme: need |copy_nfs41_file_info()| */
66+
+            nfs41_file_info_cpy(info_out, res->getrootattr.info);
6567
+        }
6668
     } else if (count == 1) {
6769
         if (parent_out)
6870
             *parent_out = dir;
69-
@@ -258,8 +263,12 @@ static int server_lookup(
71+
@@ -258,8 +260,9 @@ static int server_lookup(
7072
         if (i == count-1) {
7173
             if (target_out)
7274
                 *target_out = file;
7375
-            if (info_out)
76+
-                memcpy(info_out, res->getattr[i].info, sizeof(nfs41_file_info));
7477
+            if (info_out) {
75-
+                /* fixme: need |copy_nfs41_file_info()| */
78+
+                nfs41_file_info_cpy(info_out, res->getattr[i].info);
7979
+            }
8080
         } else if (i == count-2) {
8181
             if (parent_out)
8282
                 *parent_out = file;
8383
diff --git a/daemon/name_cache.c b/daemon/name_cache.c
84-
index eaa0f36..2b7c257 100644
84+
index eaa0f36..89879a7 100644
8585
--- a/daemon/name_cache.c
8686
+++ b/daemon/name_cache.c
8787
@@ -99,6 +99,8 @@ struct attr_cache_entry {
8888
     unsigned                type : 4;
8989
     unsigned                invalidated : 1;
9090
     unsigned                delegated : 1;
9191
+    char                    owner[NFS4_OPAQUE_LIMIT+1];
9292
+    char                    owner_group[NFS4_OPAQUE_LIMIT+1];
9393
 };
9494
 #define ATTR_ENTRY_SIZE sizeof(struct attr_cache_entry)
9595
9696
@@ -304,6 +306,14 @@ static void attr_cache_update(
9797
     if (info->attrmask.count >= 2) {
9898
         if (info->attrmask.arr[1] & FATTR4_WORD1_MODE)
9999
             entry->mode = info->mode;
100100
+        if (info->attrmask.arr[1] & FATTR4_WORD1_OWNER) {
101-
+            DASSERT(info->owner != NULL);
101+
+            EASSERT(info->owner != NULL);
102102
+            (void)strcpy(entry->owner, info->owner);
103103
+        }
104104
+        if (info->attrmask.arr[1] & FATTR4_WORD1_OWNER_GROUP) {
105-
+            DASSERT(info->owner_group != NULL);
105+
+            EASSERT(info->owner_group != NULL);
106106
+            (void)strcpy(entry->owner_group, info->owner_group);
107107
+        }
108108
         if (info->attrmask.arr[1] & FATTR4_WORD1_NUMLINKS)
109109
             entry->numlinks = info->numlinks;
110110
         if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_ACCESS) {
111-
@@ -341,6 +351,14 @@ static void copy_attrs(
111+
@@ -341,6 +351,12 @@ static void copy_attrs(
112112
     dst->type = src->type;
113113
     dst->numlinks = src->numlinks;
114114
     dst->mode = src->mode;
115-
+    DASSERT(src->owner != NULL);
115+
+    EASSERT(src->owner != NULL);
116-
+//    if (dst->owner == NULL)
116+
+    dst->owner = dst->owner_buf;
118117
+    (void)strcpy(dst->owner, src->owner);
119-
+    DASSERT(src->owner_group != NULL);
118+
+    EASSERT(src->owner_group != NULL);
120-
+//    if (dst->owner_group == NULL)
119+
+    dst->owner_group = dst->owner_group_buf;
122120
+    (void)strcpy(dst->owner_group, src->owner_group);
123121
     dst->fileid = src->fileid;
124122
     dst->hidden = src->hidden;
125123
     dst->system = src->system;
126-
@@ -353,7 +371,8 @@ static void copy_attrs(
124+
@@ -353,7 +369,8 @@ static void copy_attrs(
127125
     dst->attrmask.arr[1] = FATTR4_WORD1_MODE
128126
         | FATTR4_WORD1_NUMLINKS | FATTR4_WORD1_TIME_ACCESS
129127
         | FATTR4_WORD1_TIME_CREATE | FATTR4_WORD1_TIME_MODIFY
130128
-        | FATTR4_WORD1_SYSTEM;
131129
+        | FATTR4_WORD1_SYSTEM
132130
+        | FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP;
133131
 }
134132
135133
136-
@@ -401,7 +420,11 @@ struct nfs41_name_cache {
134+
diff --git a/daemon/nfs41_daemon.c b/daemon/nfs41_daemon.c
137-
 static __inline bool_t name_cache_enabled(
135+
index 42bfc6c..dcb509e 100644
138-
     IN struct nfs41_name_cache *cache)
136+
--- a/daemon/nfs41_daemon.c
139-
 {
137+
+++ b/daemon/nfs41_daemon.c
140-
+#if 0
138+
@@ -402,6 +402,7 @@ VOID ServiceStart(DWORD argc, LPTSTR *argv)
141-
+    return 0; /* fixme: caching of owner/owner_group not supported yet */
139+
 #ifdef NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN
142-
+#else
140+
     /* force enable for cygwin getent passwd/group testing */
143-
     return cache->expiration > 0;
141+
     cmd_args.ldap_enable = TRUE;
144-
+#endif
142+
+    DASSERT(0/* test asserts*/, 0);
145-
 }
143+
 #endif /* NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN */
146144
147-
 static __inline void name_cache_entry_rename(
145+
     nfs41_server_list_init();
148-
diff --git a/daemon/nfs41_daemon.c b/daemon/nfs41_daemon.c
146+
diff --git a/daemon/nfs41_types.h b/daemon/nfs41_types.h
149-
index 42bfc6c..bc69fa8 100644
147+
index c5bad79..18a763a 100644
150-
--- a/daemon/nfs41_daemon.c
148+
--- a/daemon/nfs41_types.h
151-
+++ b/daemon/nfs41_daemon.c
149+
+++ b/daemon/nfs41_types.h
152-
@@ -402,6 +402,7 @@ VOID ServiceStart(DWORD argc, LPTSTR *argv)
150+
@@ -236,6 +236,10 @@ typedef struct __nfs41_file_info {
153-
 #ifdef NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN
151+
     char                    *owner;
154-
     /* force enable for cygwin getent passwd/group testing */
152+
     char                    *owner_group;
155-
     cmd_args.ldap_enable = TRUE;
153+
     uint32_t                aclsupport;
156-
+    DASSERT(cmd_args.ldap_enable == FALSE);
154+
+
157-
 #endif /* NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN */
155+
+    /* Buffers */
156+
+    char owner_buf[NFS4_OPAQUE_LIMIT+1];
158159
159-
     nfs41_server_list_init();
160+
 #endif /* !__NFS41_DAEMON_TYPES_H__ */
160-
diff --git a/daemon/nfs41_types.h b/daemon/nfs41_types.h
161+
diff --git a/daemon/nfs41_xdr.c b/daemon/nfs41_xdr.c
161-
index c5bad79..18a763a 100644
162+
index 176b613..0261c54 100644
162-
--- a/daemon/nfs41_types.h
163+
--- a/daemon/nfs41_xdr.c
163-
+++ b/daemon/nfs41_types.h
164+
+++ b/daemon/nfs41_xdr.c
164-
@@ -236,6 +236,10 @@ typedef struct __nfs41_file_info {
165+
@@ -1802,19 +1802,33 @@ static bool_t decode_file_attrs(
165-
     char                    *owner;
166+
                 return FALSE;
166-
     char                    *owner_group;
167+
         }
167-
     uint32_t                aclsupport;
168+
         if (attrs->attrmask.arr[1] & FATTR4_WORD1_OWNER) {
169+
-            char *ptr = &info->owner[0];
168172
+
169-
+    /* Buffers */
173+
+            char *ptr = info->owner;
170-
+    char owner_buf[NFS4_OPAQUE_LIMIT+1];
174+
             uint32_t owner_len;
171-
+    char owner_group_buf[NFS4_OPAQUE_LIMIT+1];
175+
             if (!xdr_bytes(xdr, &ptr, &owner_len,
172-
 } nfs41_file_info;
176+
-                            NFS4_OPAQUE_LIMIT))
173-
177+
+                            NFS4_OPAQUE_LIMIT)) {
174-
 #endif /* !__NFS41_DAEMON_TYPES_H__ */
178+
+                info->owner = NULL;
180179
                 return FALSE;
180+
+            }
181184
         }
182-
         if (attrs->attrmask.arr[1] & FATTR4_WORD1_OWNER) {
185+
         if (attrs->attrmask.arr[1] & FATTR4_WORD1_OWNER_GROUP) {
183-
-            char *ptr = &info->owner[0];
186+
-            char *ptr = &info->owner_group[0];
184-
+            if (info->owner == NULL)
187+
+            if (info->owner_group == NULL)
185-
+                info->owner = info->owner_buf;
188+
+                info->owner_group = info->owner_group_buf;
186189
+
187-
+            char *ptr = info->owner;
190+
+            char *ptr = info->owner_group;
188-
             uint32_t owner_len;
191+
             uint32_t owner_group_len;
189-
             if (!xdr_bytes(xdr, &ptr, &owner_len,
192+
             if (!xdr_bytes(xdr, &ptr, &owner_group_len,
190193
-                            NFS4_OPAQUE_LIMIT))
191194
+                            NFS4_OPAQUE_LIMIT)) {
192-
+                info->owner = NULL;
195+
+                info->owner_group = NULL;
193196
                 return FALSE;
194197
+            }
195-
+            DASSERT(owner_len > 0);
198+
+            EASSERT(owner_group_len > 0);
196-
+            DASSERT(owner_len < sizeof(info->owner_group_buf));
199+
+            EASSERT(owner_group_len < sizeof(info->owner_group_buf));
197-
             info->owner[owner_len] = '\0';
200+
             info->owner_group[owner_group_len] = '\0';
198201
         }
199-
         if (attrs->attrmask.arr[1] & FATTR4_WORD1_OWNER_GROUP) {
202+
         if (attrs->attrmask.arr[1] & FATTR4_WORD1_SPACE_AVAIL) {
200-
-            char *ptr = &info->owner_group[0];
203+
diff --git a/daemon/open.c b/daemon/open.c
201-
+            if (info->owner_group == NULL)
204+
index 13e82b2..36f2fb2 100644
202-
+                info->owner_group = info->owner_group_buf;
205+
--- a/daemon/open.c
203-
+
206+
+++ b/daemon/open.c
204-
+            char *ptr = info->owner_group;
207+
@@ -629,7 +629,7 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
205-
             uint32_t owner_group_len;
208+
         status = NO_ERROR;
206-
             if (!xdr_bytes(xdr, &ptr, &owner_group_len,
209+
     } else if (args->symlink.len) {
207-
-                            NFS4_OPAQUE_LIMIT))
210+
         /* handle cygwin symlinks */
208-
+                            NFS4_OPAQUE_LIMIT)) {
211+
-        nfs41_file_info createattrs;
209-
+                info->owner_group = NULL;
212+
+        nfs41_file_info createattrs = { 0 };
210-
                 return FALSE;
213+
         createattrs.attrmask.count = 2;
211-
+            }
214+
         createattrs.attrmask.arr[0] = 0;
212-
+            DASSERT(owner_group_len > 0);
215+
         createattrs.attrmask.arr[1] = FATTR4_WORD1_MODE;
213-
+            DASSERT(owner_group_len < sizeof(info->owner_group_buf));
216+
@@ -663,33 +663,22 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
214-
             info->owner_group[owner_group_len] = '\0';
217+
         args->changeattr = info.change;
215-
         }
218+
216-
         if (attrs->attrmask.arr[1] & FATTR4_WORD1_SPACE_AVAIL) {
219+
 #ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
217-
diff --git a/daemon/open.c b/daemon/open.c
220+
-        bitmap4 og_attr_request = { 0 };
218-
index 13e82b2..f1d7f20 100644
221+
-        nfs41_file_info og_info = { 0 };
219-
--- a/daemon/open.c
222+
-        char owner[NFS4_OPAQUE_LIMIT], group[NFS4_OPAQUE_LIMIT];
220-
+++ b/daemon/open.c
223+
-        nfsacl41 acl = { 0 };
221-
@@ -629,7 +629,7 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
224+
-
222-
         status = NO_ERROR;
225+
-        /*
223-
     } else if (args->symlink.len) {
226+
-         * gisburn:
224-
         /* handle cygwin symlinks */
227+
-         * 1. We should cache owner/group information
225-
-        nfs41_file_info createattrs;
228+
-         * 2. We should always ask for
226-
+        nfs41_file_info createattrs = { 0 };
229+
-         * FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP with the other
227-
         createattrs.attrmask.count = 2;
230+
-         * attributes
228-
         createattrs.attrmask.arr[0] = 0;
231+
-         */
229-
         createattrs.attrmask.arr[1] = FATTR4_WORD1_MODE;
232+
-        og_attr_request.count = 2;
230-
@@ -663,33 +663,21 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
233+
-        og_attr_request.arr[1] = FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP;
231-
         args->changeattr = info.change;
234+
-        og_info.owner = owner;
232-
235+
-        og_info.owner_group = group;
233-
 #ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
236+
-        status = nfs41_getattr(state->session, &state->file, &og_attr_request, &og_info);
234-
-        bitmap4 og_attr_request = { 0 };
237+
-        if (status) {
235-
-        nfs41_file_info og_info = { 0 };
238+
-            eprintf("get_stat_data: nfs41_cached_getattr() failed with %d\n",
236-
-        char owner[NFS4_OPAQUE_LIMIT], group[NFS4_OPAQUE_LIMIT];
239+
-            status);
237-
-        nfsacl41 acl = { 0 };
240+
-        }
238241
-
239-
-        /*
242+
+        char owner[NFS4_OPAQUE_LIMIT], owner_group[NFS4_OPAQUE_LIMIT];
240-
-         * gisburn:
243+
         uid_t map_uid = -1;
241-
-         * 1. We should cache owner/group information
244+
         gid_t gid_dummy = -1;
242-
-         * 2. We should always ask for
245+
         gid_t map_gid = -1;
243-
-         * FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP with the other
246+
         char *at_ch; /* pointer to '@' */
244-
-         * attributes
247+
245-
-         */
248+
+        EASSERT((info.attrmask.arr[1] & FATTR4_WORD1_OWNER) != 0);
246-
-        og_attr_request.count = 2;
249+
+        EASSERT((info.attrmask.arr[1] & FATTR4_WORD1_OWNER_GROUP) != 0);
247-
-        og_attr_request.arr[1] = FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP;
250+
+        EASSERT(info.owner != NULL);
248-
-        og_info.owner = owner;
251+
+        EASSERT(info.owner_group != NULL);
249-
-        og_info.owner_group = group;
252+
+        EASSERT(info.owner == info.owner_buf);
250-
-        status = nfs41_getattr(state->session, &state->file, &og_attr_request, &og_info);
253+
+        EASSERT(info.owner_group == info.owner_group_buf);
251-
-        if (status) {
254+
+        /* Make copies as we will modify  them */
252-
-            eprintf("get_stat_data: nfs41_cached_getattr() failed with %d\n",
255+
+        (void)strcpy(owner, info.owner);
253-
-            status);
256+
+        (void)strcpy(owner_group, info.owner_group);
254-
-        }
257+
+
255-
-
258+
         /*
256-
+        char owner[NFS4_OPAQUE_LIMIT], owner_group[NFS4_OPAQUE_LIMIT];
259+
          * Map owner to local uid
257-
         uid_t map_uid = -1;
260+
          *
258-
         gid_t gid_dummy = -1;
261+
@@ -697,12 +686,12 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
259-
         gid_t map_gid = -1;
262+
          *  ("gisburn") or username@domain ("gisburn@sun.com")
260-
         char *at_ch; /* pointer to '@' */
263+
          */
264+
         /* stomp over '@' */
261268
262-
+        DASSERT((info.attrmask.arr[1] & FATTR4_WORD1_OWNER) != 0);
269+
         if (nfs41_idmap_name_to_ids(
263-
+        DASSERT((info.attrmask.arr[1] & FATTR4_WORD1_OWNER_GROUP) != 0);
270+
             nfs41dg->idmapper,
264-
+        DASSERT(info.owner != NULL);
271+
-            og_info.owner,
265-
+        DASSERT(info.owner_group != NULL);
272+
+            owner,
266-
+        DASSERT(info.owner == info.owner_buf);
273+
             &map_uid,
267-
+        DASSERT(info.owner_group == info.owner_group_buf);
274+
             &gid_dummy) == 0) {
268-
+        (void)strcpy(owner, info.owner?info.owner:"<FIXME_OWNER>");
275+
              args->owner_local_uid = map_uid;
269-
+        (void)strcpy(owner_group, info.owner_group?info.owner_group:"<FIXME_GROUP>");
276+
@@ -711,7 +700,7 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
270-
+
277+
             args->owner_local_uid = NFS_USER_NOBODY_UID;
278+
             eprintf("get_stat_data: "
271284
         /*
272-
          * Map owner to local uid
285+
@@ -721,12 +710,12 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
273-
          *
286+
          * ("gisgrp") or username@domain ("gisgrp@sun.com")
276287
          */
277288
         /* stomp over '@' */
278-
-        if (at_ch = strchr(og_info.owner, '@'))
289+
-        if (at_ch = strchr(og_info.owner_group, '@'))
279-
+        if (at_ch = strchr(owner, '@'))
290+
+        if (at_ch = strchr(owner_group, '@'))
280291
             *at_ch = '\0';
281292
282-
         if (nfs41_idmap_name_to_ids(
293+
         if (nfs41_idmap_group_to_gid(
283294
             nfs41dg->idmapper,
284-
-            og_info.owner,
295+
-            og_info.owner_group,
285-
+            owner,
296+
+            owner_group,
286-
             &map_uid,
297+
             &map_gid) == 0) {
287-
             &gid_dummy) == 0) {
298+
             args->owner_group_local_gid = map_gid;
299+
         }
291302
             eprintf("get_stat_data: "
292-
                 "no username mapping for '%s', fake uid=%d\n",
303+
                 "no group mapping for '%s', fake gid=%d\n",
293-
-                og_info.owner, args->owner_local_uid);
304+
-                og_info.owner_group, args->owner_group_local_gid);
294-
+                owner, args->owner_local_uid);
305+
+                owner_group, args->owner_group_local_gid);
295306
         }
296307
297-
         /*
308+
         dprintf(1, "handle_open: stat: owner=%u/'%s', owner_group=%u/'%s'\n",
298-
@@ -721,12 +709,12 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
309+
-            (unsigned int)args->owner_local_uid, og_info.owner,
299-
          * ("gisgrp") or username@domain ("gisgrp@sun.com")
310+
-            (unsigned int)args->owner_group_local_gid, og_info.owner_group);
300-
          */
311+
+            (unsigned int)args->owner_local_uid, owner,
301-
         /* stomp over '@' */
312+
+            (unsigned int)args->owner_group_local_gid, owner_group);
302-
-        if (at_ch = strchr(og_info.owner_group, '@'))
313+
 #endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
303-
+        if (at_ch = strchr(owner_group, '@'))
314+
     } else {
304-
             *at_ch = '\0';
315+
         nfs41_file_info createattrs = { 0 };
316+
diff --git a/daemon/util.c b/daemon/util.c
305323
306-
         if (nfs41_idmap_group_to_gid(
324+
+/* copy |nfs41_file_info| */
307-
             nfs41dg->idmapper,
325+
+void nfs41_file_info_cpy(
308-
-            og_info.owner_group,
326+
+    OUT nfs41_file_info *dest,
309-
+            owner_group,
327+
+    IN const nfs41_file_info *src)
310-
             &map_gid) == 0) {
328+
+{
311-
             args->owner_group_local_gid = map_gid;
329+
+    (void)memcpy(dest, src, sizeof(nfs41_file_info));
312-
         }
330+
+    dest->owner = dest->owner_buf;
313-
@@ -734,12 +722,12 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
331+
+    dest->owner_group = dest->owner_group_buf;
314-
             args->owner_group_local_gid = NFS_GROUP_NOGROUP_GID;
332+
+}
315-
             eprintf("get_stat_data: "
333+
+
316-
                 "no group mapping for '%s', fake gid=%d\n",
334+
 void get_file_time(
317-
-                og_info.owner_group, args->owner_group_local_gid);
335+
     OUT PLARGE_INTEGER file_time)
318-
+                owner_group, args->owner_group_local_gid);
336+
 {
319-
         }
337+
diff --git a/daemon/util.h b/daemon/util.h
320-
338+
index fa0d32c..c4bc886 100644
321-
         dprintf(1, "handle_open: stat: owner=%u/'%s', owner_group=%u/'%s'\n",
339+
--- a/daemon/util.h
322-
-            (unsigned int)args->owner_local_uid, og_info.owner,
340+
+++ b/daemon/util.h
323-
-            (unsigned int)args->owner_group_local_gid, og_info.owner_group);
341+
@@ -106,6 +106,9 @@ void nfs_to_standard_info(
324-
+            (unsigned int)args->owner_local_uid, owner,
342+
 void nfs_to_network_openinfo(
325-
+            (unsigned int)args->owner_group_local_gid, owner_group);
343+
     IN const nfs41_file_info *info,
326-
 #endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
344+
     OUT PFILE_NETWORK_OPEN_INFORMATION std_out);
327-
     } else {
345+
+void nfs41_file_info_cpy(
328-
         nfs41_file_info createattrs = { 0 };
346+
+    OUT nfs41_file_info *dest,
347+
+    IN const nfs41_file_info *src);
329351
diff --git a/sys/nfs41_build_features.h b/sys/nfs41_build_features.h
330352
index 93ee7a9..d43334a 100644
331353
--- a/sys/nfs41_build_features.h
332354
+++ b/sys/nfs41_build_features.h
333355
@@ -32,19 +32,19 @@
334356
 /*
335357
  * NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES - return local uid/gid values
336358
  */
337359
-// #define NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES 1
338360
+#define NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES 1
339361
340362
 /*
341363
  * NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID - give NFS
342364
  * files which do not map to a local account a SID in the
343365
  * Unix_User+x/Unix_Group+x range
344366
  */
345367
-// #define NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID 1
346368
+#define NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID 1
347369
348370
 /*
349371
  * NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN - use Cygwin /usr/bin/getent
350372
  * as "name service"
351373
  */
352374
-// #define NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN 1
353375
+#define NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN 1
354376
355377
 #endif /* !_NFS41_DRIVER_BUILDFEATURES_ */
356378

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.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at