nwconn: enable Lock File Set
All checks were successful
Source release / source-package (push) Successful in 47s
All checks were successful
Source release / source-package (push) Successful in 47s
Wire NCP 0x04 Lock File Set and NCP 0x6a Lock File Set to the existing file-set lock path. The Novell SDK documents NCP 0x2222/04 as the old Lock File Set call and NCP 0x2222/106 as its replacement. Both calls lock all files logged by the calling client's current task. The request carries a 2-byte Lock Timeout in 1/18 second units, the reply carries no data, and completion reports success, timeout, or lock error. MARS-NWE already records file-set members through Log File and already routes Release File Set and Clear File Set through share_handle_lock_sets(). Use the same set handler for Lock File Set with lock_flag 0 so the handler locks the logged entries using each entry's recorded lock directive, defaulting to exclusive when no directive was logged. Enable the previously disabled old endpoint, add support for the SDK replacement endpoint, add the SDK request/reply semantics to the inline endpoint comment, and remove the corresponding TODO entry. This enables the documented endpoint path; timeout handling remains limited to the existing underlying share implementation.
This commit is contained in:
2
TODO.md
2
TODO.md
@@ -65,8 +65,6 @@ Follow-up:
|
||||
|
||||
- Implement or deliberately reject the following endpoints after client evidence
|
||||
or direct protocol tests:
|
||||
- `NCP 0x04 Lock File Set`: lock the current task's logged file set; related
|
||||
release/clear set calls already use `share_handle_lock_sets()`.
|
||||
- `NCP 0x16/0x18 Restore Directory Handle`: verify the exact SDK
|
||||
request/reply layout, then implement the documented function 22 /
|
||||
subfunction 24 directory-handle semantics.
|
||||
|
||||
33
src/nwconn.c
33
src/nwconn.c
@@ -439,23 +439,34 @@ static int handle_ncp_serv(void)
|
||||
}
|
||||
break;
|
||||
|
||||
#if 0
|
||||
case 0x4 : { /* Lock File Set */
|
||||
case 0x4 : /* Lock File Set (old) */
|
||||
case 0x6a : { /* Lock File Set */
|
||||
/*
|
||||
* TODO(ncp-compat): Implement NCP 0x04 Lock File Set.
|
||||
* NCP 0x2222/04 Lock File Set (old) and NCP 0x2222/106 Lock
|
||||
* File Set lock all files logged by the calling client's current
|
||||
* task.
|
||||
*
|
||||
* SDK context: locks every file previously entered in this task's
|
||||
* file log table by Log File (0x03). This is the set-oriented
|
||||
* companion of Release File Set (0x06) and Clear File Set (0x08),
|
||||
* which are already wired through share_handle_lock_sets().
|
||||
* SDK request: 2-byte Lock Timeout, in units of 1/18 second;
|
||||
* 0 means No Wait.
|
||||
* SDK reply: no reply data.
|
||||
* SDK completion: 0x00 success, 0xfe timeout, 0xff lock error.
|
||||
*
|
||||
* Compatibility note: preserve NetWare's logged-set semantics; this
|
||||
* is not the same as locking one pathname supplied by the request.
|
||||
* The newer 0x6a call replaces the old 0x04 call but has the same
|
||||
* request layout for the file set lock itself. MARS-NWE records
|
||||
* file-set members through Log File (0x03), then uses the shared
|
||||
* set handler for Lock/Release/Clear File Set operations.
|
||||
*/
|
||||
|
||||
struct INPUT {
|
||||
uint8 header[7]; /* Requestheader */
|
||||
uint8 timeout[2]; /* HI LO */
|
||||
} *input = (struct INPUT *) (ncprequest);
|
||||
int result = share_handle_lock_sets(
|
||||
1, /* File Set */
|
||||
0, /* Lock logged entries */
|
||||
GET_BE16(input->timeout));
|
||||
if (result) completition = (uint8) -result;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
case 0x5 : /* Release File */
|
||||
case 0x7 : { /* Clear File, removes file from logset */
|
||||
|
||||
Reference in New Issue
Block a user