docs: audit direct lifecycle and buffer endpoints

This commit is contained in:
Mario Fetka
2026-06-02 05:32:34 +00:00
parent bfcb2e178f
commit 9be855ec7b
4 changed files with 100 additions and 14 deletions

View File

@@ -2946,11 +2946,26 @@ static void handle_fxx(int gelen, int func)
break;
} /* switch */
} else if (func == 0x18) { /* End of Job */
/* Forwarded direct NCP 0x2222/24 cleanup after nwconn releases local handles. */
/*
* Forwarded direct NCP 0x2222/24 End of Job.
*
* handle_fxx() does not consume a grouped subfunction header for this
* direct function: requestdata points at the empty post-FunctionCode
* payload. nwconn has already released task-local handles; nwbind only
* closes the matching print jobs and returns a normal empty reply.
*/
if (!(entry8_flags&0x200)) /* pcz: 14-Apr-00 */
nw_close_connection_jobs(act_connection, ncprequest->task); /* close print jobs */
} else if (func == 0x19) { /* logout */
/* Forwarded direct NCP 0x2222/25 logout cleanup after nwconn resets connection state. */
/*
* Forwarded direct NCP 0x2222/25 Logout.
*
* handle_fxx() does not consume a grouped subfunction header for this
* direct function: requestdata points at the empty post-FunctionCode
* payload. nwconn has already released local queue/file/user state;
* nwbind closes any remaining print jobs, records logout state, clears
* bindery identity, and returns a normal empty reply.
*/
nw_close_connection_jobs(act_connection, -1); /* close all print jobs */
write_utmp(0, act_connection, act_c->pid_nwconn, &(act_c->client_adr), NULL);
act_c->object_id = 0; /* not LOGIN */

View File

@@ -5569,11 +5569,14 @@ static int handle_ncp_serv(void)
case 0x18 : /* End of Job */
/*
* Direct NCP 0x2222/24 End of Job has no nested payload.
* nwconn releases local file/task handles first, then
* forwards to nwbind so the bindery/queue side can close
* print jobs for this task. Document further behavior in
* nwbind.c if this endpoint is audited later.
* Direct NCP 0x2222/24 End of Job.
*
* SDK request payload: none after FunctionCode 24. There
* is no reply payload; the completion code reports success.
*
* MARS-NWE handoff: nwconn first frees task-local file and
* job resources, then returns -1 so nwbind can close the
* connection/task print jobs before sending the final reply.
*/
if (!(entry8_flags&0x200)) /* pcz: 14-Apr-00 */
free_connection_task_jobs(ncprequest->task);
@@ -5583,10 +5586,15 @@ static int handle_ncp_serv(void)
case 0x19 : /* logout, some of this call is handled in ncpserv. */
/*
* Direct NCP 0x2222/25 Logout has no nested payload. The
* connection state is cleared here and nwbind performs the
* remaining bindery/queue logout cleanup, so endpoint docs
* must cover both sides when this call is audited.
* Direct NCP 0x2222/25 Logout.
*
* SDK request payload: none after FunctionCode 25. There
* is no reply payload; the completion code reports success.
*
* MARS-NWE handoff: nwconn releases local queue/file/user
* state, then returns -1 so nwbind can close all remaining
* print jobs, clear bindery identity fields, and send the
* final reply.
*/
free_queue_jobs();
nw_free_handles(-1);
@@ -5744,6 +5752,19 @@ static int handle_ncp_serv(void)
return(-1); /* handled by nwbind */
case 0x21 : { /* Negotiate Buffer Size, Packetsize */
/*
* Direct NCP 0x2222/33 Negotiate Buffer Size.
*
* SDK request payload:
* word ProposedBufferSize (Hi-Lo)
* SDK reply payload:
* word AcceptedBufferSize (Hi-Lo)
*
* The parser/reply match the documented Hi-Lo wire order.
* MARS-NWE clamps valid proposals to LOC_RW_BUFFERSIZE;
* a proposal below 512 is ignored and the previously
* negotiated/default rw_buffer_size is returned.
*/
uint8 *getsize=responsedata;
int buffer_size = (int) (GET_BE16((uint8*)requestdata));
/* Der Novell-Client der PAM's Net/E-Ethernetkarte