pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS

Difference between
modified post c1222afa by Anonymous on Wed 7th Feb 2024 14:33
original post 3bf by Anonymous on Wed 7th Feb 2024 12:21
Download diff
Show old version | new version | both versions

    
1-
21c4: handle_open('\bigdisk\tmp\chmodtest_cp3'): stat: owner=197608/'roland_mainz', owner_group=197121/'Kein'
1+
diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
2-
21c4: writing downcall: xid=417 opcode=NFS41_OPEN status=0 get_last_error=0
2+
index 07c1dd5..a6e4f88 100644
3-
240c: parsing NFS41_ACL_SET: info_class=7 sec_desc_len=128
3+
--- a/cygwin/devel/msnfs41client.bash
4-
240c: map_current_user_to_ids: mapping user roland_mainz
4+
+++ b/cygwin/devel/msnfs41client.bash
5-
240c: handle_setacl: OWNER_SECURITY_INFORMATION
5+
@@ -140,7 +140,7 @@ function nfsclient_rundeamon
86
9-
7+
 	typeset -a nfsd_args=(
10-
8+
 		'nfsd_debug.exe'
11-
9+
-		'-d' '0'
12-
10+
+		'-d' '1'
13-
11+
 		'--noldap'
14-
12+
 		#'--numworkerthreads' '512'
15-
13+
 		#'--gid' '1616' '--uid' '1616'
16-
14+
diff --git a/daemon/acl.c b/daemon/acl.c
17-
15+
index e4fb02e..d4f4c1a 100644
18-
16+
--- a/daemon/acl.c
19-
17+
+++ b/daemon/acl.c
20-
18+
@@ -36,7 +36,7 @@
21-
19+
 #include "sid.h"
2220
23-
21+
 //#define DEBUG_ACLS
24-
22+
-#define ACLLVL 2 /* dprintf level for acl logging */
25-
23+
+#define ACLLVL 1 /* dprintf level for acl logging */
2624
27-
25+
 static int parse_getacl(unsigned char *buffer, uint32_t length,
28-
26+
                         nfs41_upcall *upcall)
29-
27+
@@ -287,6 +287,7 @@ static int handle_getacl(void *daemon_context, nfs41_upcall *upcall)
30-
28+
     args->sec_desc_len = 0;
31-
29+
     status = MakeSelfRelativeSD(&sec_desc, args->sec_desc, &args->sec_desc_len);
32-
30+
     if (status) {
33-
31+
+        dprintf(1, "handle_getacl: MakeSelfRelativeSD() failed.\n");
34-
32+
         status = ERROR_INTERNAL_ERROR;
35-
33+
         goto out;
36-
34+
     }
37-
35+
@@ -462,6 +463,7 @@ static int map_nfs4ace_who(PSID sid, PSID owner_sid, PSID group_sid, char *who_o
38-
36+
     DWORD size = 0, tmp_size = 0;
39-
37+
     SID_NAME_USE sid_type;
40-
38+
     LPSTR tmp_buf = NULL, who = NULL;
41-
39+
+    LPSTR sidstr = NULL;
4240
43-
41+
     /* for ace mapping, we want to map owner's sid into "owner@"
44-
42+
      * but for set_owner attribute we want to map owner into a user name
45-
43+
@@ -492,6 +494,85 @@ static int map_nfs4ace_who(PSID sid, PSID owner_sid, PSID group_sid, char *who_o
46-
44+
             return ERROR_SUCCESS;
47-
45+
     }
4846
49-
47+
+#ifdef NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID
50-
48+
+    if (!ConvertSidToStringSidA(sid, &sidstr)) {
51-
49+
+        status = GetLastError();
52-
50+
+        eprintf("map_nfs4ace_who: ConvertSidToStringSidA() failed, "
53-
51+
+            "error=%d\n", status);
54-
52+
+        goto out;
55-
53+
+    }
56-
54+
+
57-
55+
+    dprintf(ACLLVL, "map_nfs4ace_who: Looking up SID '%s'\n", sidstr);
58-
56+
+
59-
57+
+    /*
60-
58+
+     * Handle special "Unix_User+<uid>"-SIDs
61-
59+
+     */
62-
60+
+    if (!strncmp(sidstr, UNIXUSERSID_PREFIX, strlen(UNIXUSERSID_PREFIX))) {
63-
61+
+        const char *uidstr = sidstr+strlen(UNIXUSERSID_PREFIX);
64-
62+
+        uid_t uid;
65-
63+
+        char tmpwho[NFS4_OPAQUE_LIMIT+1];
66-
64+
+
67-
65+
+        uid = (uid_t)atol(uidstr);
68-
66+
+        dprintf(ACLLVL, "map_nfs4ace_who: uidstr='%s', uid=%u\n",
69-
67+
+            uidstr, (unsigned int)uid);
70-
68+
+
71-
69+
+        /* fixme! */
72-
70+
+        extern nfs41_daemon_globals nfs41_dg;
73-
71+
+
74-
72+
+        status = nfs41_idmap_uid_to_name(nfs41_dg.idmapper, uid,
75-
73+
+            tmpwho, sizeof(tmpwho));
76-
74+
+        if (status) {
77-
75+
+            dprintf(ACLLVL, "map_nfs4ace_who: "
78-
76+
+                "nfs41_idmap_uid_to_name() failed, status=%d\n",
79-
77+
+                status);
80-
78+
+            goto out;
81-
79+
+        }
82-
80+
+
83-
81+
+        (void)snprintf(who_out, NFS4_OPAQUE_LIMIT, "%s@%s", tmpwho, domain);
84-
82+
+
85-
83+
+        dprintf(ACLLVL, "map_nfs4ace_who: returning Unix_User+ who='%s'\n", who_out);
86-
84+
+
87-
85+
+        goto out;
88-
86+
+    }
89-
87+
+    else {
90-
88+
+        dprintf(ACLLVL, "map_nfs4ace_who: Not an Unix_User+ SID\n");
91-
89+
+    }
92-
90+
+
93-
91+
+    /*
94-
92+
+     * Handle special "Unix_Group+<gid>"-SIDs
95-
93+
+     */
96-
94+
+    if (!strncmp(sidstr, UNIXGROUPSID_PREFIX, strlen(UNIXGROUPSID_PREFIX))) {
97-
95+
+        const char *gidstr = sidstr+strlen(UNIXGROUPSID_PREFIX);
98-
96+
+        gid_t gid;
99-
97+
+        char tmpwho[NFS4_OPAQUE_LIMIT+1];
100-
98+
+
101-
99+
+        gid = (uid_t)atol(gidstr);
102-
100+
+        dprintf(ACLLVL, "map_nfs4ace_who: gidstr='%s', gid=%u\n",
103-
101+
+            gidstr, (unsigned int)gid);
104-
102+
+
105-
103+
+        /* fixme! */
106-
104+
+        extern nfs41_daemon_globals nfs41_dg;
107-
105+
+
108-
106+
+        status = nfs41_idmap_gid_to_group(nfs41_dg.idmapper, gid,
109-
107+
+            tmpwho, sizeof(tmpwho));
110-
108+
+        if (status) {
111-
109+
+            dprintf(ACLLVL, "map_nfs4ace_who: "
112-
110+
+                "nfs41_idmap_gid_to_group() failed, status=%d\n",
113-
111+
+                status);
114-
112+
+            goto out;
115-
113+
+        }
116-
114+
+
117-
115+
+        (void)snprintf(who_out, NFS4_OPAQUE_LIMIT, "%s@%s", tmpwho, domain);
118-
116+
+
119-
117+
+        dprintf(ACLLVL, "map_nfs4ace_who: returning Unix_Group+ who='%s'\n", who_out);
120-
118+
+
121-
119+
+        goto out;
122-
120+
+    }
123-
121+
+    else {
124-
122+
+        dprintf(ACLLVL, "map_nfs4ace_who: Not an Unix_Group+ SID\n");
125-
123+
+    }
126-
124+
+#endif /* NFS41_DRIVER_FEATURE_MAP_UNMAPPED_USER_TO_UNIXUSER_SID */
127-
125+
+
128-
126+
     status = LookupAccountSidA(NULL, sid, who, &size, tmp_buf,
129-
127+
         &tmp_size, &sid_type);
130-
128+
     dprintf(ACLLVL, "map_nfs4ace_who: LookupAccountSid returned %d GetLastError "
131-
129+
@@ -526,6 +607,8 @@ add_domain:
132-
130+
     if (who) free(who);
133-
131+
     status = ERROR_SUCCESS;
134-
132+
 out:
135-
133+
+    if (sidstr)
136-
134+
+        LocalFree(sidstr);
137-
135+
     return status;
138-
136+
 out_free_who:
139-
137+
     free(who);
140-
138+
diff --git a/daemon/sid.h b/daemon/sid.h
141-
139+
index e6d87c5..232e456 100644
142-
140+
--- a/daemon/sid.h
143-
141+
+++ b/daemon/sid.h
144-
142+
@@ -27,6 +27,10 @@
145-
143+
 #include "nfs41_build_features.h"
146-
144+
 #include "nfs41_daemon.h"
147145
148-
146+
+#define UNIXUSERSID_PREFIX  "S-1-22-1-"
149-
147+
+#define UNIXGROUPSID_PREFIX "S-1-22-2-"
150-
148+
+
151-
149+
+
152-
150+
 /* prototypes */
153-
151+
 int create_unknownsid(WELL_KNOWN_SID_TYPE type, PSID *sid, DWORD *sid_len);
154-
152+
 void sidcache_init(void);
155-
153+
diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c
156-
154+
index b3cf06c..d496497 100644
157-
155+
--- a/sys/nfs41_driver.c
158-
156+
+++ b/sys/nfs41_driver.c
159-
157+
@@ -2643,8 +2643,10 @@ NTSTATUS map_mount_errors(
160-
158+
     case ERROR_BAD_NET_RESP:    return STATUS_UNEXPECTED_NETWORK_ERROR;
161-
159+
     case ERROR_BAD_NET_NAME:    return STATUS_BAD_NETWORK_NAME;
162-
160+
     case ERROR_BAD_NETPATH:     return STATUS_BAD_NETWORK_PATH;
163-
161+
+    case ERROR_INTERNAL_ERROR:  return STATUS_INTERNAL_ERROR;
164-
162+
     default:
165-
163+
-        print_error("failed to map windows error %d to NTSTATUS; "
166-
164+
+        print_error("map_mount_errors: "
167-
165+
+            "failed to map windows ERROR_%d to NTSTATUS; "
168-
166+
             "defaulting to STATUS_INSUFFICIENT_RESOURCES\n", status);
169-
167+
         return STATUS_INSUFFICIENT_RESOURCES;
170-
168+
     }
171-
169+
@@ -3604,8 +3606,9 @@ NTSTATUS map_open_errors(
172-
170+
     case ERROR_TOO_MANY_LINKS:          return STATUS_TOO_MANY_LINKS;
173-
171+
     case ERROR_DIRECTORY:               return STATUS_FILE_IS_A_DIRECTORY;
174-
172+
     case ERROR_BAD_FILE_TYPE:           return STATUS_NOT_A_DIRECTORY;
175-
173+
+    case ERROR_INTERNAL_ERROR:          return STATUS_INTERNAL_ERROR;
176-
174+
     default:
177-
175+
-        print_error("[ERROR] nfs41_Create: upcall returned %d returning "
178-
176+
+        print_error("[ERROR] nfs41_Create: upcall returned ERROR_%d returning "
179-
177+
             "STATUS_INSUFFICIENT_RESOURCES\n", status);
180-
178+
     case ERROR_OUTOFMEMORY:             return STATUS_INSUFFICIENT_RESOURCES;
181-
179+
     }
182-
180+
@@ -4215,7 +4218,8 @@ NTSTATUS map_close_errors(
183-
181+
     case ERROR_NOT_EMPTY:       return STATUS_DIRECTORY_NOT_EMPTY;
184-
182+
     case ERROR_FILE_INVALID:    return STATUS_FILE_INVALID;
185-
183+
     default:
186-
184+
-        print_error("failed to map windows error %d to NTSTATUS; "
187-
185+
+        print_error("map_close_errors: "
188-
186+
+            "failed to map windows ERROR_%d to NTSTATUS; "
189-
187+
             "defaulting to STATUS_INTERNAL_ERROR\n", status);
190-
188+
     case ERROR_INTERNAL_ERROR:  return STATUS_INTERNAL_ERROR;
191-
189+
     }
192-
190+
@@ -4345,8 +4349,10 @@ NTSTATUS map_querydir_errors(
193-
191+
     case ERROR_NO_MORE_FILES:       return STATUS_NO_MORE_FILES;
194-
192+
     case ERROR_OUTOFMEMORY:         return STATUS_INSUFFICIENT_RESOURCES;
195-
193+
     case ERROR_FILENAME_EXCED_RANGE: return STATUS_NAME_TOO_LONG;
196-
194+
+    case ERROR_INTERNAL_ERROR:      return STATUS_INTERNAL_ERROR;
197-
195+
     default:
198-
196+
-        print_error("failed to map windows error %d to NTSTATUS; "
199-
197+
+        print_error("map_querydir_errors: "
200-
198+
+            "failed to map windows ERROR_%d to NTSTATUS; "
201-
199+
             "defaulting to STATUS_INVALID_NETWORK_RESPONSE\n", status);
202-
200+
     case ERROR_BAD_NET_RESP:        return STATUS_INVALID_NETWORK_RESPONSE;
203-
201+
     }
204-
202+
@@ -4489,8 +4495,10 @@ NTSTATUS map_volume_errors(
205-
203+
     case ERROR_NETNAME_DELETED:     return STATUS_NETWORK_NAME_DELETED;
206-
204+
     case ERROR_INVALID_PARAMETER:   return STATUS_INVALID_PARAMETER;
207-
205+
     case ERROR_OUTOFMEMORY:         return STATUS_INSUFFICIENT_RESOURCES;
208-
206+
+    case ERROR_INTERNAL_ERROR:      return STATUS_INTERNAL_ERROR;
209-
207+
     default:
210-
208+
-        print_error("failed to map windows error %d to NTSTATUS; "
211-
209+
+        print_error("map_volume_errors: "
212-
210+
+            "failed to map windows ERROR_%d to NTSTATUS; "
213-
211+
             "defaulting to STATUS_INVALID_NETWORK_RESPONSE\n", status);
214-
212+
     case ERROR_BAD_NET_RESP:        return STATUS_INVALID_NETWORK_RESPONSE;
215-
213+
     }
216-
214+
@@ -4769,8 +4777,10 @@ NTSTATUS map_setea_error(
217-
215+
     case ERROR_INVALID_EA_HANDLE:       return STATUS_NONEXISTENT_EA_ENTRY;
218-
216+
     case ERROR_NO_MORE_FILES:           return STATUS_NO_MORE_EAS;
219-
217+
     case ERROR_EA_FILE_CORRUPT:         return STATUS_EA_CORRUPT_ERROR;
220-
218+
+    case ERROR_INTERNAL_ERROR:          return STATUS_INTERNAL_ERROR;
221-
219+
     default:
222-
220+
-        print_error("failed to map windows error %d to NTSTATUS; "
223-
221+
+        print_error("map_setea_error: "
224-
222+
+            "failed to map windows ERROR_%d to NTSTATUS; "
225-
223+
             "defaulting to STATUS_INVALID_PARAMETER\n", error);
226-
224+
     case ERROR_INVALID_PARAMETER:       return STATUS_INVALID_PARAMETER;
227-
225+
     }
228-
226+
@@ -5185,8 +5195,10 @@ NTSTATUS map_query_acl_error(
229-
227+
     case ERROR_ACCESS_DENIED:       return STATUS_ACCESS_DENIED;
230-
228+
     case ERROR_FILE_NOT_FOUND:      return STATUS_OBJECT_NAME_NOT_FOUND;
231-
229+
     case ERROR_INVALID_PARAMETER:   return STATUS_INVALID_PARAMETER;
232-
230+
+    case ERROR_INTERNAL_ERROR:      return STATUS_INTERNAL_ERROR;
233-
231+
     default:
234-
232+
-        print_error("failed to map windows error %d to NTSTATUS; "
235-
233+
+        print_error("map_query_acl_error: "
236-
234+
+            "failed to map windows ERROR_%d to NTSTATUS; "
237-
235+
             "defaulting to STATUS_INVALID_NETWORK_RESPONSE\n", error);
238-
236+
     case ERROR_BAD_NET_RESP:        return STATUS_INVALID_NETWORK_RESPONSE;
239-
237+
     }
240-
238+
@@ -5449,8 +5461,10 @@ NTSTATUS map_queryfile_error(
241-
239+
     case ERROR_ACCESS_DENIED:       return STATUS_ACCESS_DENIED;
242-
240+
     case ERROR_NETNAME_DELETED:     return STATUS_NETWORK_NAME_DELETED;
243-
241+
     case ERROR_INVALID_PARAMETER:   return STATUS_INVALID_PARAMETER;
244-
242+
+    case ERROR_INTERNAL_ERROR:      return STATUS_INTERNAL_ERROR;
245-
243+
     default:
246-
244+
-        print_error("failed to map windows error %d to NTSTATUS; "
247-
245+
+        print_error("map_queryfile_error: "
248-
246+
+            "failed to map windows ERROR_%d to NTSTATUS; "
249-
247+
             "defaulting to STATUS_INVALID_NETWORK_RESPONSE\n", error);
250-
248+
     case ERROR_BAD_NET_RESP:        return STATUS_INVALID_NETWORK_RESPONSE;
251-
249+
     }
252-
250+
@@ -5634,8 +5648,10 @@ NTSTATUS map_setfile_error(
253-
251+
     case ERROR_NETWORK_ACCESS_DENIED:   return STATUS_NETWORK_ACCESS_DENIED;
254-
252+
     case ERROR_NETNAME_DELETED:         return STATUS_NETWORK_NAME_DELETED;
255-
253+
     case ERROR_BUFFER_OVERFLOW:         return STATUS_INSUFFICIENT_RESOURCES;
256-
254+
+    case ERROR_INTERNAL_ERROR:          return STATUS_INTERNAL_ERROR;
257-
255+
     default:
258-
256+
-        print_error("failed to map windows error %d to NTSTATUS; "
259-
257+
+        print_error("map_setfile_error: "
260-
258+
+            "failed to map windows ERROR_%d to NTSTATUS; "
261-
259+
             "defaulting to STATUS_INVALID_PARAMETER\n", error);
262-
260+
     case ERROR_INVALID_PARAMETER:       return STATUS_INVALID_PARAMETER;
263-
261+
     }
264-
262+
@@ -6022,8 +6038,10 @@ NTSTATUS map_readwrite_errors(
265-
263+
     case ERROR_LOCK_VIOLATION:          return STATUS_FILE_LOCK_CONFLICT;
266-
264+
     case ERROR_NETWORK_ACCESS_DENIED:   return STATUS_NETWORK_ACCESS_DENIED;
267-
265+
     case ERROR_NETNAME_DELETED:         return STATUS_NETWORK_NAME_DELETED;
268-
266+
+    case ERROR_INTERNAL_ERROR:          return STATUS_INTERNAL_ERROR;
269-
267+
     default:
270-
268+
-        print_error("failed to map windows error %d to NTSTATUS; "
271-
269+
+        print_error("map_readwrite_errors: "
272-
270+
+            "failed to map windows ERROR_%d to NTSTATUS; "
273-
271+
             "defaulting to STATUS_NET_WRITE_FAULT\n", status);
274-
272+
     case ERROR_NET_WRITE_FAULT:         return STATUS_NET_WRITE_FAULT;
275-
273+
     }
276-
274+
@@ -6301,8 +6319,10 @@ NTSTATUS map_lock_errors(
277-
275+
     /* if we return ERROR_INVALID_PARAMETER, Windows translates that to
278-
276+
      * success!! */
279-
277+
     case ERROR_INVALID_PARAMETER:   return STATUS_LOCK_NOT_GRANTED;
280-
278+
+    case ERROR_INTERNAL_ERROR:      return STATUS_INTERNAL_ERROR;
281-
279+
     default:
282-
280+
-        print_error("failed to map windows error %d to NTSTATUS; "
283-
281+
+        print_error("map_lock_errors: "
284-
282+
+            "failed to map windows ERROR_%d to NTSTATUS; "
285-
283+
             "defaulting to STATUS_INVALID_NETWORK_RESPONSE\n", status);
286-
284+
     case ERROR_BAD_NET_RESP:        return STATUS_INVALID_NETWORK_RESPONSE;
287-
285+
     }
288-
286+
@@ -6521,8 +6541,10 @@ NTSTATUS map_symlink_errors(
289-
287+
     case ERROR_INSUFFICIENT_BUFFER: return STATUS_BUFFER_TOO_SMALL;
290-
288+
     case STATUS_BUFFER_TOO_SMALL:
291-
289+
     case ERROR_BUFFER_OVERFLOW:     return STATUS_BUFFER_OVERFLOW;
292-
290+
+    case ERROR_INTERNAL_ERROR:      return STATUS_INTERNAL_ERROR;
293-
291+
     default:
294-
292+
-        print_error("failed to map windows error %d to NTSTATUS; "
295-
293+
+        print_error("map_symlink_errors: "
296-
294+
+            "failed to map windows ERROR_%d to NTSTATUS; "
297-
295+
             "defaulting to STATUS_INVALID_NETWORK_RESPONSE\n", status);
298-
296+
     case ERROR_BAD_NET_RESP:        return STATUS_INVALID_NETWORK_RESPONSE;
299-
297+
     }
300298
301299

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