pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS

Difference between
modified post ebbb3 by Anonymous on Wed 25th Jun 2025 18:30
original post 210ffd556 by Anonymous on Mon 23rd Jun 2025 20:24
Download diff
Show old version | new version | both versions

    
11
diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
22
index 4a391dd..8c7bfa4 100755
33
--- a/cygwin/devel/msnfs41client.bash
44
+++ b/cygwin/devel/msnfs41client.bash
55
@@ -467,7 +467,7 @@ function nfsclient_rundeamon
66
 			"${nfsd_args[@]}"
77
 		)
88
 		"${nfsd_args[@]}"
99
-	elif false ; then
1010
+	elif true ; then
1111
 		export _NT_ALT_SYMBOL_PATH="$(cygpath -w "$PWD");srv*https://msdl.microsoft.com/download/symbols"
1212
 		#
1313
 		# Useful cdb cmds:
1414
@@ -601,7 +601,7 @@ function nfsclient_system_rundeamon
1515
 		)
1616
1717
 		"${nfsd_args[@]}"
1818
-	elif false ; then
1919
+	elif true ; then
2020
 		export _NT_ALT_SYMBOL_PATH="$(cygpath -w "$PWD");srv*https://msdl.microsoft.com/download/symbols"
2121
 		# - heap tests (eats lots of memory):
2222
 		# '-c' '!gflag +full;g' for heap tests
2323
diff --git a/daemon/acl.c b/daemon/acl.c
24-
index 370f2d3..4e3c0f9 100644
24+
index 370f2d3..c655b3f 100644
2525
--- a/daemon/acl.c
2626
+++ b/daemon/acl.c
27-
@@ -331,8 +331,53 @@ static int handle_getacl(void *daemon_context, nfs41_upcall *upcall)
27+
@@ -326,62 +326,49 @@ static int handle_getacl(void *daemon_context, nfs41_upcall *upcall)
28-
     DPRINTF(ACLLVL1, ("--> handle_getacl(state->path.path='%s')\n",
28+
     PSID osid = NULL, gsid = NULL;
29-
         state->path.path));
29+
     DWORD sid_len;
30+
     char owner[NFS4_FATTR4_OWNER_LIMIT+1], group[NFS4_FATTR4_OWNER_LIMIT+1];
3037
31-
-    if (args->query & DACL_SECURITY_INFORMATION) {
38+
     DPRINTF(ACLLVL1, ("--> handle_getacl(state->path.path='%s')\n",
39+
         state->path.path));
3242
-use_nfs41_getattr:
33-
+    (void)memset(&info, 0, sizeof(nfs41_file_info));
43+
-        bitmap4 attr_request = { 0 };
34-
+    info.owner = owner;
44+
-        (void)memset(&info, 0, sizeof(nfs41_file_info));
35-
+    info.owner_group = group;
45+
-        info.owner = owner;
36-
+    info.acl = &acl;
46+
-        info.owner_group = group;
37-
+
47+
-
38-
+    status = nfs41_cached_getattr(state->session, &state->file, &info);
48+
-        attr_request.count = 2;
39-
+    if (status) {
49+
-        attr_request.arr[0] = FATTR4_WORD0_ACL;
40-
+        eprintf("handle_getacl: nfs41_cached_getattr() failed with %d\n",
50+
-        attr_request.arr[1] = FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP;
41-
+            status);
51+
-        info.acl = &acl;
42-
+        goto out;
52+
-        status = nfs41_getattr(state->session, &state->file, &attr_request, &info);
43-
+    }
53+
-        if (status) {
44-
+
54+
-            eprintf("handle_getacl: nfs41_getattr() failed with %d\n",
45-
+    EASSERT(info.attrmask.count > 1);
55+
-                status);
46-
+    bool do_full_lookup = false;
56+
-            goto out;
47-
+
57+
-        }
48-
+    /*
58+
+        owner_group_acl_bitmap.arr[0] |= FATTR4_WORD0_ACL;
49-
+     * In rare cases owner/owner_group are not in the cache
59+
     }
50-
+     * (usually for new files). In this case do a full
60+
-    else {
51-
+     * roundtrip to the NFS server to get the data...
61+
-        (void)memset(&info, 0, sizeof(nfs41_file_info));
52-
+     */
62+
-        info.owner = owner;
53-
+    if ((bitmap_isset(&info.attrmask, 1,
63+
-        info.owner_group = group;
54-
+            FATTR4_WORD1_OWNER) == false) ||
64+
55-
+        (bitmap_isset(&info.attrmask, 1,
65+
-        status = nfs41_cached_getattr(state->session, &state->file, &info);
56-
+            FATTR4_WORD1_OWNER_GROUP) == false)) {
66+
-        if (status) {
57-
+        DPRINTF(ACLLVL2,
67+
-            eprintf("handle_getacl: nfs41_cached_getattr() failed with %d\n",
58-
+            ("handle_getattr: "
68+
-                status);
59-
+            "owner/owner_group not in cache, doing full lookup...\n"));
69+
-            goto out;
60-
+        do_full_lookup = true;
70+
-        }
61-
+    }
71+
+    (void)memset(&info, 0, sizeof(nfs41_file_info));
62-
+
72+
+    info.owner = owner;
63-
+    if ((args->query & DACL_SECURITY_INFORMATION) &&
73+
+    info.owner_group = group;
64-
+        (bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_ACL) == false)) {
74+
+    info.acl = &acl;
65-
+        DPRINTF(0,
75+
66-
+            ("handle_getattr: "
76+
-        EASSERT(info.attrmask.count > 1);
67-
+            "ACL information not in cache, doing full lookup...\n"));
77+
-
68-
+        do_full_lookup = true;
78+
-        /*
69-
+    }
79+
-         * In rare cases owner/owner_group are not in the cache
70-
+
80+
-         * (usually for new files). In this case do a full
71-
+#if 1
81+
-         * roundtrip to the NFS server to get the data...
72-
+    /* debug */
82+
-         */
73-
+    if ((args->query & DACL_SECURITY_INFORMATION) &&
83+
-        if ((bitmap_isset(&info.attrmask, 1,
74-
+        (do_full_lookup == false)) {
84+
-                FATTR4_WORD1_OWNER) == false) ||
75-
+        DPRINTF(0, ("handle_getacl: cached ACL used\n"));
85+
-            (bitmap_isset(&info.attrmask, 1,
76-
+    }
86+
-                FATTR4_WORD1_OWNER_GROUP) == false)) {
77-
+#endif
87+
-            DPRINTF(ACLLVL2, ("handle_getattr: owner/owner_group not in cache, doing full lookup...\n"));
78-
+
88+
-            goto use_nfs41_getattr;
79-
+    if (do_full_lookup) {
89+
-        }
80-
         bitmap4 attr_request = { 0 };
90+
+    /*
81-
         (void)memset(&info, 0, sizeof(nfs41_file_info));
91+
+     * |nfs41_cached_getattr()| will first try to get all information from
82-
         info.owner = owner;
92+
+     * the cache. But if bits are missing (e.g. |FATTR4_WORD0_ACL|, because
83-
@@ -349,40 +394,11 @@ use_nfs41_getattr:
93+
+     * either not cached in the name cache, or name cache entry for ACLs
84-
             goto out;
94+
+     * expired...), then this will do a server roundtrip to get the missing
95+
+     * data
85103
         }
104+

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