ncpapi: use protocol names for NCP wrapper functions
Rename the public NCP wrapper functions in c32ncp.c/c32ncp.h from c32_ncp* implementation-oriented names to protocol-oriented ncpXX_YY_* names. This prepares the code for a later c32ncp.c/c32ncp.h -> ncpapi.c/ncpapi.h file rename while keeping the current file names unchanged for now. The new names keep the NCP function/subfunction visible and describe the operation performed by each wrapper. Update all callers to use the new names. Transport-specific helpers such as c32_get_ncp_handle() are left unchanged. No behavior change.
This commit is contained in:
38
c32ncp.c
38
c32ncp.c
@@ -18,14 +18,14 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Purpose: Client32 and raw NCP helper implementation used by the NetWare DOS tools.
|
||||
* Depends on: net.h, c32ncp.h, kern_wasm.asm/kern.asm for Client32 probe entry points, and netcall.c for shared requester state.
|
||||
* Purpose: Namespace and file-system NCP API helper implementation used by the NetWare DOS tools.
|
||||
* Depends on: net.h, c32ncp.h, kern_wasm.asm/kern.asm for Client32 probe entry points, and netcall.c for shared requester state. This file is planned to become ncpapi.c.
|
||||
*/
|
||||
|
||||
#include "net.h"
|
||||
#include "c32ncp.h"
|
||||
|
||||
/* c32ncp.c - Client32 NCP helpers for mars-dosutils */
|
||||
/* c32ncp.c - namespace/file-system NCP API helpers for mars-dosutils */
|
||||
static void c32_put_word_lh(uint8 *p, uint16 v)
|
||||
{
|
||||
p[0] = (uint8)(v & 0xff);
|
||||
@@ -285,7 +285,7 @@ static void c32_copy_open_reply_to_handle6(C32_NWFILE_HANDLE6 *dst,
|
||||
memcpy(dst->h, src, 6);
|
||||
}
|
||||
|
||||
int c32_ncp87_open_create_file(const char *path_name,
|
||||
int ncp87_01_open_create_entry(const char *path_name,
|
||||
uint16 dir_handle,
|
||||
uint8 open_create_mode,
|
||||
uint32 create_attrs,
|
||||
@@ -336,7 +336,7 @@ int c32_ncp87_open_create_file(const char *path_name,
|
||||
* word DesiredAccessRights (Lo-Hi)
|
||||
* NWHandlePathStruct
|
||||
*
|
||||
* Existing C32_NCP87_Raw5_Probe users in this file send the subfunction
|
||||
* The Client32 Raw5 requester path sends the subfunction
|
||||
* header as fragment 0 and the NWHandlePathStruct as fragment 1.
|
||||
*/
|
||||
memset(hdr, 0, sizeof(hdr));
|
||||
@@ -385,7 +385,7 @@ int c32_ncp87_open_create_file(const char *path_name,
|
||||
return(0);
|
||||
}
|
||||
|
||||
int c32_ncp74_file_server_copy(const C32_NWFILE_HANDLE6 *src,
|
||||
int ncp74_file_server_copy(const C32_NWFILE_HANDLE6 *src,
|
||||
const C32_NWFILE_HANDLE6 *dst,
|
||||
uint32 src_offset,
|
||||
uint32 dst_offset,
|
||||
@@ -432,7 +432,7 @@ int c32_ncp74_file_server_copy(const C32_NWFILE_HANDLE6 *src,
|
||||
return(0);
|
||||
}
|
||||
|
||||
int c32_ncp66_close_file(const C32_NWFILE_HANDLE6 *handle)
|
||||
int ncp66_close_file(const C32_NWFILE_HANDLE6 *handle)
|
||||
{
|
||||
struct {
|
||||
uint8 len;
|
||||
@@ -459,7 +459,7 @@ int c32_ncp66_close_file(const C32_NWFILE_HANDLE6 *handle)
|
||||
}
|
||||
|
||||
|
||||
int c32_ncp87_obtain_rim_attributes(const char *name,
|
||||
int ncp87_06_obtain_rim_attributes(const char *name,
|
||||
uint16 dir_handle,
|
||||
uint32 *attr_out,
|
||||
uint16 *actual_out,
|
||||
@@ -532,7 +532,7 @@ int c32_ncp87_obtain_rim_attributes(const char *name,
|
||||
}
|
||||
|
||||
|
||||
int c32_ncp87_obtain_ndir_info(const char *path_name,
|
||||
int ncp87_06_obtain_ndir_info(const char *path_name,
|
||||
uint16 dir_handle,
|
||||
C32_NDIR_INFO *info_out,
|
||||
uint16 *actual_out,
|
||||
@@ -647,7 +647,7 @@ int c32_ncp87_obtain_ndir_info(const char *path_name,
|
||||
|
||||
|
||||
|
||||
int c32_ncp87_modify_dos_info(const char *name,
|
||||
int ncp87_07_modify_dos_info(const char *name,
|
||||
uint16 dir_handle,
|
||||
uint32 change_mask,
|
||||
C32_DOS_MODIFY_INFO *info,
|
||||
@@ -755,7 +755,7 @@ int c32_ncp87_modify_dos_info(const char *name,
|
||||
return(0);
|
||||
}
|
||||
|
||||
int c32_ncp87_modify_dos_attributes(char *name,
|
||||
int ncp87_07_modify_dos_attributes(char *name,
|
||||
uint16 dir_handle,
|
||||
uint32 attrs,
|
||||
uint16 *actual_out,
|
||||
@@ -773,13 +773,13 @@ int c32_ncp87_modify_dos_attributes(char *name,
|
||||
* leaves high attribute bits such as Delete/Rename Inhibit unchanged or
|
||||
* cleared on some servers/clients.
|
||||
*/
|
||||
return(c32_ncp87_modify_dos_info(name, dir_handle, 0x00000002UL,
|
||||
return(ncp87_07_modify_dos_info(name, dir_handle, 0x00000002UL,
|
||||
&info, actual_out,
|
||||
handle_lo_out, handle_hi_out));
|
||||
}
|
||||
|
||||
|
||||
int c32_ncp87_get_effective_rights(const char *path_name,
|
||||
int ncp87_1d_get_effective_rights(const char *path_name,
|
||||
uint16 dir_handle,
|
||||
uint16 *rights_out,
|
||||
uint16 *actual_out,
|
||||
@@ -873,7 +873,7 @@ int c32_ncp87_get_effective_rights(const char *path_name,
|
||||
}
|
||||
|
||||
|
||||
int c32_ncp87_get_effective_rights_by_dirent(uint8 vol_number,
|
||||
int ncp87_1d_get_effective_rights_by_dirent(uint8 vol_number,
|
||||
uint32 dos_dir_number,
|
||||
uint16 *rights_out,
|
||||
uint16 *actual_out,
|
||||
@@ -1000,7 +1000,7 @@ static int c32_build_ncp22_trustee_path(char *out, const char *path_name, int ma
|
||||
return(0);
|
||||
}
|
||||
|
||||
int c32_ncp22_set_trustee_rights(const char *path_name,
|
||||
int ncp22_27_set_trustee_rights(const char *path_name,
|
||||
uint16 dir_handle,
|
||||
uint32 object_id,
|
||||
uint16 rights)
|
||||
@@ -1047,7 +1047,7 @@ int c32_ncp22_set_trustee_rights(const char *path_name,
|
||||
}
|
||||
|
||||
|
||||
int c32_ncp22_delete_trustee_rights(const char *path_name,
|
||||
int ncp22_2b_delete_trustee_rights(const char *path_name,
|
||||
uint16 dir_handle,
|
||||
uint32 object_id)
|
||||
{
|
||||
@@ -1092,7 +1092,7 @@ int c32_ncp22_delete_trustee_rights(const char *path_name,
|
||||
return(0);
|
||||
}
|
||||
|
||||
int c32_ncp87_add_trustee_rights(const char *path_name,
|
||||
int ncp87_0a_add_trustee_rights(const char *path_name,
|
||||
uint16 dir_handle,
|
||||
uint32 object_id,
|
||||
uint16 rights,
|
||||
@@ -1199,7 +1199,7 @@ int c32_ncp87_add_trustee_rights(const char *path_name,
|
||||
|
||||
|
||||
|
||||
int c32_ncp87_find_trustee_rights(const char *path_name,
|
||||
int ncp87_05_find_trustee_rights(const char *path_name,
|
||||
uint16 dir_handle,
|
||||
uint32 object_id,
|
||||
uint16 *rights_out,
|
||||
@@ -1299,7 +1299,7 @@ int c32_ncp87_find_trustee_rights(const char *path_name,
|
||||
return(0xff); /* no trustee found / no more entries */
|
||||
}
|
||||
|
||||
int c32_ncp87_delete_trustee_rights(const char *path_name,
|
||||
int ncp87_0b_delete_trustee_rights(const char *path_name,
|
||||
uint16 dir_handle,
|
||||
uint32 object_id,
|
||||
uint16 *actual_out,
|
||||
|
||||
34
c32ncp.h
34
c32ncp.h
@@ -18,12 +18,12 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Purpose: Public declarations for Client32 and raw NCP helper routines.
|
||||
* Depends on: net.h data types and c32ncp.c implementation.
|
||||
* Purpose: Public declarations for namespace and file-system NCP API helpers.
|
||||
* Depends on: net.h data types and c32ncp.c implementation; this file is planned to become ncpapi.h.
|
||||
*/
|
||||
|
||||
|
||||
/* c32ncp.h - minimal Client32 NCP helpers for mars-dosutils */
|
||||
/* c32ncp.h - namespace/file-system NCP API helpers for mars-dosutils */
|
||||
|
||||
#ifndef C32NCP_H
|
||||
#define C32NCP_H
|
||||
@@ -44,7 +44,7 @@ typedef struct c32_nwfile_handle6 {
|
||||
#define C32_DAR_DENY_WRITE 0x0008
|
||||
#define C32_DAR_COMPAT 0x0010
|
||||
|
||||
int c32_ncp87_open_create_file(const char *path_name,
|
||||
int ncp87_01_open_create_entry(const char *path_name,
|
||||
uint16 dir_handle,
|
||||
uint8 open_create_mode,
|
||||
uint32 create_attrs,
|
||||
@@ -57,17 +57,17 @@ int c32_ncp87_open_create_file(const char *path_name,
|
||||
uint16 *handle_lo_out,
|
||||
uint16 *handle_hi_out);
|
||||
|
||||
int c32_ncp74_file_server_copy(const C32_NWFILE_HANDLE6 *src,
|
||||
int ncp74_file_server_copy(const C32_NWFILE_HANDLE6 *src,
|
||||
const C32_NWFILE_HANDLE6 *dst,
|
||||
uint32 src_offset,
|
||||
uint32 dst_offset,
|
||||
uint32 count,
|
||||
uint32 *copied_out);
|
||||
|
||||
int c32_ncp66_close_file(const C32_NWFILE_HANDLE6 *handle);
|
||||
int ncp66_close_file(const C32_NWFILE_HANDLE6 *handle);
|
||||
|
||||
|
||||
int c32_ncp87_obtain_rim_attributes(const char *name,
|
||||
int ncp87_06_obtain_rim_attributes(const char *name,
|
||||
uint16 dir_handle,
|
||||
uint32 *attr_out,
|
||||
uint16 *actual_out,
|
||||
@@ -120,7 +120,7 @@ typedef struct c32_ndir_info {
|
||||
char name[256];
|
||||
} C32_NDIR_INFO;
|
||||
|
||||
int c32_ncp87_obtain_ndir_info(const char *path_name,
|
||||
int ncp87_06_obtain_ndir_info(const char *path_name,
|
||||
uint16 dir_handle,
|
||||
C32_NDIR_INFO *info_out,
|
||||
uint16 *actual_out,
|
||||
@@ -128,14 +128,14 @@ int c32_ncp87_obtain_ndir_info(const char *path_name,
|
||||
uint16 *handle_hi_out);
|
||||
|
||||
|
||||
int c32_ncp87_modify_dos_attributes(char *name,
|
||||
int ncp87_07_modify_dos_attributes(char *name,
|
||||
uint16 dir_handle,
|
||||
uint32 attrs,
|
||||
uint16 *actual_out,
|
||||
uint16 *handle_lo_out,
|
||||
uint16 *handle_hi_out);
|
||||
|
||||
int c32_ncp87_modify_dos_info(const char *name,
|
||||
int ncp87_07_modify_dos_info(const char *name,
|
||||
uint16 dir_handle,
|
||||
uint32 change_mask,
|
||||
C32_DOS_MODIFY_INFO *info,
|
||||
@@ -143,7 +143,7 @@ int c32_ncp87_modify_dos_info(const char *name,
|
||||
uint16 *handle_lo_out,
|
||||
uint16 *handle_hi_out);
|
||||
|
||||
int c32_ncp87_get_effective_rights(const char *path,
|
||||
int ncp87_1d_get_effective_rights(const char *path,
|
||||
uint16 dir_handle,
|
||||
uint16 *rights_out,
|
||||
uint16 *actual_out,
|
||||
@@ -151,14 +151,14 @@ int c32_ncp87_get_effective_rights(const char *path,
|
||||
uint16 *handle_hi_out);
|
||||
|
||||
|
||||
int c32_ncp87_get_effective_rights_by_dirent(uint8 vol_number,
|
||||
int ncp87_1d_get_effective_rights_by_dirent(uint8 vol_number,
|
||||
uint32 dos_dir_number,
|
||||
uint16 *rights_out,
|
||||
uint16 *actual_out,
|
||||
uint16 *handle_lo_out,
|
||||
uint16 *handle_hi_out);
|
||||
|
||||
int c32_ncp87_add_trustee_rights(const char *path_name,
|
||||
int ncp87_0a_add_trustee_rights(const char *path_name,
|
||||
uint16 dir_handle,
|
||||
uint32 object_id,
|
||||
uint16 rights,
|
||||
@@ -167,16 +167,16 @@ int c32_ncp87_add_trustee_rights(const char *path_name,
|
||||
uint16 *handle_lo_out,
|
||||
uint16 *handle_hi_out);
|
||||
|
||||
int c32_ncp22_set_trustee_rights(const char *path_name,
|
||||
int ncp22_27_set_trustee_rights(const char *path_name,
|
||||
uint16 dir_handle,
|
||||
uint32 object_id,
|
||||
uint16 rights);
|
||||
|
||||
int c32_ncp22_delete_trustee_rights(const char *path_name,
|
||||
int ncp22_2b_delete_trustee_rights(const char *path_name,
|
||||
uint16 dir_handle,
|
||||
uint32 object_id);
|
||||
|
||||
int c32_ncp87_find_trustee_rights(const char *path_name,
|
||||
int ncp87_05_find_trustee_rights(const char *path_name,
|
||||
uint16 dir_handle,
|
||||
uint32 object_id,
|
||||
uint16 *rights_out,
|
||||
@@ -184,7 +184,7 @@ int c32_ncp87_find_trustee_rights(const char *path_name,
|
||||
uint16 *handle_lo_out,
|
||||
uint16 *handle_hi_out);
|
||||
|
||||
int c32_ncp87_delete_trustee_rights(const char *path_name,
|
||||
int ncp87_0b_delete_trustee_rights(const char *path_name,
|
||||
uint16 dir_handle,
|
||||
uint32 object_id,
|
||||
uint16 *actual_out,
|
||||
|
||||
@@ -425,7 +425,7 @@ static int show_info(char *name, uint8 dhandle)
|
||||
char rights_text[12];
|
||||
|
||||
memset(&info, 0, sizeof(info));
|
||||
rc = c32_ncp87_obtain_ndir_info(tool_is_current_path(name) ? "" : name,
|
||||
rc = ncp87_06_obtain_ndir_info(tool_is_current_path(name) ? "" : name,
|
||||
(uint16)dhandle,
|
||||
&info,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
4
flag.c
4
flag.c
@@ -104,7 +104,7 @@ static int flag_ncp87_obtain_attrs(char *name, uint32 *attrs)
|
||||
* Prefer the verified Client32 NCP87 path. If it is not available,
|
||||
* fall back to the historical INT 21h/Net_Call path below.
|
||||
*/
|
||||
if (c32_ncp87_obtain_rim_attributes(name, (uint16)dhandle,
|
||||
if (ncp87_06_obtain_rim_attributes(name, (uint16)dhandle,
|
||||
attrs, NULL, NULL, NULL) == 0)
|
||||
return(0);
|
||||
|
||||
@@ -275,7 +275,7 @@ static int flag_ncp87_modify_attrs(char *name, uint32 attrs)
|
||||
uint16 actual = 0;
|
||||
uint16 hlo = 0;
|
||||
uint16 hhi = 0;
|
||||
if (!c32_ncp87_modify_dos_attributes(name, (uint16)dhandle, attrs,
|
||||
if (!ncp87_07_modify_dos_attributes(name, (uint16)dhandle, attrs,
|
||||
&actual, &hlo, &hhi))
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -407,7 +407,7 @@ static int fd_obtain(char *path, uint8 dhandle, uint32 *attrs)
|
||||
if (!fd_ncp22_1e_obtain_attrs(path, attrs))
|
||||
return(0);
|
||||
|
||||
if (c32_ncp87_obtain_rim_attributes(path, (uint16)dhandle,
|
||||
if (ncp87_06_obtain_rim_attributes(path, (uint16)dhandle,
|
||||
attrs, NULL, NULL, NULL) == 0)
|
||||
return(0);
|
||||
return(-1);
|
||||
@@ -418,7 +418,7 @@ static int fd_modify(char *path, uint8 dhandle, uint32 attrs)
|
||||
if (!fd_ncp22_25_modify_attrs(path, attrs))
|
||||
return(0);
|
||||
|
||||
if (c32_ncp87_modify_dos_attributes(path, (uint16)dhandle, attrs,
|
||||
if (ncp87_07_modify_dos_attributes(path, (uint16)dhandle, attrs,
|
||||
NULL, NULL, NULL) == 0)
|
||||
return(0);
|
||||
return(-1);
|
||||
|
||||
4
grant.c
4
grant.c
@@ -235,9 +235,9 @@ static int grant_set_one(char *path, uint16 dhandle,
|
||||
/* Novell GRANT uses the old NCP22/27 SetTrustee path. Prefer that
|
||||
* path and keep the NCP87 add-trustee call only as a compatibility
|
||||
* fallback for clients/servers that do not accept the old call. */
|
||||
rc = c32_ncp22_set_trustee_rights(path, dhandle, object_id, rights);
|
||||
rc = ncp22_27_set_trustee_rights(path, dhandle, object_id, rights);
|
||||
if (rc) {
|
||||
rc = c32_ncp87_add_trustee_rights(path,
|
||||
rc = ncp87_0a_add_trustee_rights(path,
|
||||
dhandle,
|
||||
object_id,
|
||||
rights,
|
||||
|
||||
22
ncopy.c
22
ncopy.c
@@ -430,7 +430,7 @@ static int ncopy_copy_data_c32_server(char *src, char *dst, unsigned long size)
|
||||
/* Best effort: use source NetWare attributes when creating the target.
|
||||
* If this fails, still try the server-side copy with normal attributes;
|
||||
* ncopy_copy_one() will restore DOS date/time and low DOS attributes. */
|
||||
if (!c32_ncp87_obtain_ndir_info(srcname, src_dhandle,
|
||||
if (!ncp87_06_obtain_ndir_info(srcname, src_dhandle,
|
||||
&sinfo, NULL, NULL, NULL)) {
|
||||
create_attrs = sinfo.attributes;
|
||||
ncopy_debug_ul("c32-server-copy source attrs", create_attrs);
|
||||
@@ -438,7 +438,7 @@ static int ncopy_copy_data_c32_server(char *src, char *dst, unsigned long size)
|
||||
|
||||
_dos_setfileattr(dst, _A_NORMAL);
|
||||
|
||||
rc = c32_ncp87_open_create_file(srcname,
|
||||
rc = ncp87_01_open_create_entry(srcname,
|
||||
src_dhandle,
|
||||
C32_OC_MODE_OPEN,
|
||||
0,
|
||||
@@ -457,7 +457,7 @@ static int ncopy_copy_data_c32_server(char *src, char *dst, unsigned long size)
|
||||
src_open = 1;
|
||||
ncopy_debug_handle6("c32 source handle", &sh);
|
||||
|
||||
rc = c32_ncp87_open_create_file(dstname,
|
||||
rc = ncp87_01_open_create_entry(dstname,
|
||||
dst_dhandle,
|
||||
C32_OC_MODE_OPEN |
|
||||
C32_OC_MODE_TRUNCATE |
|
||||
@@ -505,7 +505,7 @@ static int ncopy_copy_data_c32_server(char *src, char *dst, unsigned long size)
|
||||
ncopy_debug_ul("c32-server-copy offset", off);
|
||||
ncopy_debug_ul("c32-server-copy todo", todo);
|
||||
|
||||
rc = c32_ncp74_file_server_copy(&sh, &dh, off, off, todo, &done);
|
||||
rc = ncp74_file_server_copy(&sh, &dh, off, off, todo, &done);
|
||||
if (rc || done == 0) {
|
||||
ncopy_debug_rc("c32 copy chunk NCP74", rc ? rc : -1);
|
||||
goto fail;
|
||||
@@ -516,18 +516,18 @@ static int ncopy_copy_data_c32_server(char *src, char *dst, unsigned long size)
|
||||
}
|
||||
|
||||
if (dst_open)
|
||||
c32_ncp66_close_file(&dh);
|
||||
ncp66_close_file(&dh);
|
||||
if (src_open)
|
||||
c32_ncp66_close_file(&sh);
|
||||
ncp66_close_file(&sh);
|
||||
|
||||
ncopy_debug_msg("c32-ncp87/ncp74 server-copy success");
|
||||
return(0);
|
||||
|
||||
fail:
|
||||
if (dst_open)
|
||||
c32_ncp66_close_file(&dh);
|
||||
ncp66_close_file(&dh);
|
||||
if (src_open)
|
||||
c32_ncp66_close_file(&sh);
|
||||
ncp66_close_file(&sh);
|
||||
if (dst_allocated)
|
||||
dealloc_dir_handle(dst_dhandle);
|
||||
if (src_allocated)
|
||||
@@ -735,7 +735,7 @@ static int ncopy_copy_data_direct_ncp87(char *src, char *dst, unsigned long size
|
||||
|
||||
if (!ncopy_split_dir_name(src, srcdir, srcname) &&
|
||||
!ncopy_alloc_parent_handle(src, &src_dhandle, &src_allocated)) {
|
||||
if (!c32_ncp87_obtain_ndir_info(srcname, src_dhandle,
|
||||
if (!ncp87_06_obtain_ndir_info(srcname, src_dhandle,
|
||||
&sinfo, NULL, NULL, NULL))
|
||||
create_attrs = sinfo.attributes;
|
||||
if (src_allocated)
|
||||
@@ -1342,12 +1342,12 @@ static void ncopy_restore_netware_attrs(char *src, char *dst, unsigned fallback_
|
||||
|
||||
attrs = (uint32)(fallback_attr & (_A_RDONLY | _A_HIDDEN |
|
||||
_A_SYSTEM | _A_ARCH));
|
||||
rc = c32_ncp87_obtain_ndir_info(srcname, src_dhandle,
|
||||
rc = ncp87_06_obtain_ndir_info(srcname, src_dhandle,
|
||||
&sinfo, NULL, NULL, NULL);
|
||||
if (!rc)
|
||||
attrs = sinfo.attributes;
|
||||
|
||||
rc = c32_ncp87_modify_dos_attributes(dstname, dst_dhandle, attrs,
|
||||
rc = ncp87_07_modify_dos_attributes(dstname, dst_dhandle, attrs,
|
||||
NULL, NULL, NULL);
|
||||
ncopy_debug_rc("restore NetWare attrs NCP87/07", rc);
|
||||
ncopy_debug_ul("restore NetWare attrs", attrs);
|
||||
|
||||
4
ndir.c
4
ndir.c
@@ -571,7 +571,7 @@ static int ndir_get_ncp_info(char *path, C32_NDIR_INFO *info)
|
||||
if (tool_current_dhandle(&connid, &dhandle))
|
||||
return(1);
|
||||
|
||||
return(c32_ncp87_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
return(ncp87_06_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
info,
|
||||
NULL, NULL, NULL));
|
||||
@@ -619,7 +619,7 @@ static void ndir_effective_rights(char *path, char *out)
|
||||
* entry, fall back to the older directory-handle effective-rights path
|
||||
* that RIGHTS also uses.
|
||||
*/
|
||||
if (!c32_ncp87_get_effective_rights(tool_is_current_path(path) ? "" : path,
|
||||
if (!ncp87_1d_get_effective_rights(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&ncp_rights,
|
||||
NULL, NULL, NULL)) {
|
||||
|
||||
48
nwtests.c
48
nwtests.c
@@ -353,7 +353,7 @@ static int tests_read_attr_by_ncp87(uint8 dhandle, char *path, uint8 *attr_out)
|
||||
if (attr_out)
|
||||
*attr_out = 0;
|
||||
|
||||
rc = c32_ncp87_obtain_rim_attributes(tool_is_current_path(path) ? "" : path,
|
||||
rc = ncp87_06_obtain_rim_attributes(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&attr,
|
||||
NULL, NULL, NULL);
|
||||
@@ -1089,7 +1089,7 @@ static int tests_ncp2225time(char *path, char *date_arg, char *time_arg)
|
||||
return(1);
|
||||
}
|
||||
|
||||
rc = c32_ncp87_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
rc = ncp87_06_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&before,
|
||||
NULL, NULL, NULL);
|
||||
@@ -1118,7 +1118,7 @@ static int tests_ncp2225time(char *path, char *date_arg, char *time_arg)
|
||||
if (rc)
|
||||
return(rc);
|
||||
|
||||
rc = c32_ncp87_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
rc = ncp87_06_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&after,
|
||||
NULL, NULL, NULL);
|
||||
@@ -1141,7 +1141,7 @@ static int tests_ncp2225time(char *path, char *date_arg, char *time_arg)
|
||||
if (rc)
|
||||
return(rc);
|
||||
|
||||
rc = c32_ncp87_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
rc = ncp87_06_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&restored,
|
||||
NULL, NULL, NULL);
|
||||
@@ -1180,7 +1180,7 @@ static int tests_ncp2225adate(char *path, char *date_arg)
|
||||
return(1);
|
||||
}
|
||||
|
||||
rc = c32_ncp87_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
rc = ncp87_06_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&before,
|
||||
NULL, NULL, NULL);
|
||||
@@ -1208,7 +1208,7 @@ static int tests_ncp2225adate(char *path, char *date_arg)
|
||||
if (rc)
|
||||
return(rc);
|
||||
|
||||
rc = c32_ncp87_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
rc = ncp87_06_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&after,
|
||||
NULL, NULL, NULL);
|
||||
@@ -1237,7 +1237,7 @@ static int tests_ncp2225adate(char *path, char *date_arg)
|
||||
if (rc)
|
||||
return(rc);
|
||||
|
||||
rc = c32_ncp87_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
rc = ncp87_06_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&restored,
|
||||
NULL, NULL, NULL);
|
||||
@@ -1334,7 +1334,7 @@ static int tests_ncp2225modid(char *path, char *id_arg)
|
||||
return(1);
|
||||
}
|
||||
|
||||
rc = c32_ncp87_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
rc = ncp87_06_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&before,
|
||||
NULL, NULL, NULL);
|
||||
@@ -1358,7 +1358,7 @@ static int tests_ncp2225modid(char *path, char *id_arg)
|
||||
if (rc)
|
||||
return(rc);
|
||||
|
||||
rc = c32_ncp87_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
rc = ncp87_06_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&after,
|
||||
NULL, NULL, NULL);
|
||||
@@ -1381,7 +1381,7 @@ static int tests_ncp2225modid(char *path, char *id_arg)
|
||||
if (rc)
|
||||
return(rc);
|
||||
|
||||
rc = c32_ncp87_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
rc = ncp87_06_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&restored,
|
||||
NULL, NULL, NULL);
|
||||
@@ -1427,7 +1427,7 @@ static int tests_ncp2225create(char *path, char *date_arg, char *time_arg, char
|
||||
return(1);
|
||||
}
|
||||
|
||||
rc = c32_ncp87_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
rc = ncp87_06_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&before,
|
||||
NULL, NULL, NULL);
|
||||
@@ -1461,7 +1461,7 @@ static int tests_ncp2225create(char *path, char *date_arg, char *time_arg, char
|
||||
if (rc)
|
||||
return(rc);
|
||||
|
||||
rc = c32_ncp87_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
rc = ncp87_06_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&after,
|
||||
NULL, NULL, NULL);
|
||||
@@ -1487,7 +1487,7 @@ static int tests_ncp2225create(char *path, char *date_arg, char *time_arg, char
|
||||
if (rc)
|
||||
return(rc);
|
||||
|
||||
rc = c32_ncp87_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
rc = ncp87_06_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&restored,
|
||||
NULL, NULL, NULL);
|
||||
@@ -1537,7 +1537,7 @@ static int tests_ncp2225arch(char *path, char *date_arg, char *time_arg, char *i
|
||||
return(1);
|
||||
}
|
||||
|
||||
rc = c32_ncp87_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
rc = ncp87_06_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&before,
|
||||
NULL, NULL, NULL);
|
||||
@@ -1571,7 +1571,7 @@ static int tests_ncp2225arch(char *path, char *date_arg, char *time_arg, char *i
|
||||
if (rc)
|
||||
return(rc);
|
||||
|
||||
rc = c32_ncp87_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
rc = ncp87_06_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&after,
|
||||
NULL, NULL, NULL);
|
||||
@@ -1597,7 +1597,7 @@ static int tests_ncp2225arch(char *path, char *date_arg, char *time_arg, char *i
|
||||
if (rc)
|
||||
return(rc);
|
||||
|
||||
rc = c32_ncp87_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
rc = ncp87_06_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&restored,
|
||||
NULL, NULL, NULL);
|
||||
@@ -1836,7 +1836,7 @@ static int tests_read_irm_by_ncp87(uint8 dhandle, char *path, uint8 *mask_out)
|
||||
if (mask_out)
|
||||
*mask_out = 0;
|
||||
|
||||
rc = c32_ncp87_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
rc = ncp87_06_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&info,
|
||||
NULL, NULL, NULL);
|
||||
@@ -1910,7 +1910,7 @@ static int tests_ncp87c32attr(void)
|
||||
return(1);
|
||||
}
|
||||
|
||||
rc = c32_ncp87_obtain_rim_attributes("LOGIN.EXE",
|
||||
rc = ncp87_06_obtain_rim_attributes("LOGIN.EXE",
|
||||
(uint16)dhandle,
|
||||
&attr,
|
||||
&actual,
|
||||
@@ -2174,7 +2174,7 @@ static int tests_ncp23map(char *path)
|
||||
}
|
||||
|
||||
memset(&info, 0, sizeof(info));
|
||||
rc = c32_ncp87_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
rc = ncp87_06_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&info,
|
||||
NULL, NULL, NULL);
|
||||
@@ -2518,7 +2518,7 @@ static int tests_effright(char *path)
|
||||
}
|
||||
}
|
||||
|
||||
rc = c32_ncp87_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
rc = ncp87_06_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&info,
|
||||
NULL, NULL, NULL);
|
||||
@@ -2536,7 +2536,7 @@ static int tests_effright(char *path)
|
||||
|
||||
tests_print_eff_header("Effective rights matrix:");
|
||||
|
||||
rc = c32_ncp87_get_effective_rights(tool_is_current_path(path) ? "" : path,
|
||||
rc = ncp87_1d_get_effective_rights(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&ncp_rights,
|
||||
NULL, NULL, NULL);
|
||||
@@ -2544,11 +2544,11 @@ static int tests_effright(char *path)
|
||||
mask = tests_map_ncp_mask(ncp_rights);
|
||||
tests_print_eff_row("ncp87 path", rc, mask, ncp_rights, !rc);
|
||||
|
||||
if (!c32_ncp87_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
if (!ncp87_06_obtain_ndir_info(tool_is_current_path(path) ? "" : path,
|
||||
(uint16)dhandle,
|
||||
&info,
|
||||
NULL, NULL, NULL)) {
|
||||
rc = c32_ncp87_get_effective_rights_by_dirent((uint8)info.vol_number,
|
||||
rc = ncp87_1d_get_effective_rights_by_dirent((uint8)info.vol_number,
|
||||
info.dos_dir_num,
|
||||
&ncp_rights,
|
||||
NULL, NULL, NULL);
|
||||
@@ -2556,7 +2556,7 @@ static int tests_effright(char *path)
|
||||
mask = tests_map_ncp_mask(ncp_rights);
|
||||
tests_print_eff_row("ncp87 dosDir", rc, mask, ncp_rights, !rc);
|
||||
|
||||
rc = c32_ncp87_get_effective_rights_by_dirent((uint8)info.vol_number,
|
||||
rc = ncp87_1d_get_effective_rights_by_dirent((uint8)info.vol_number,
|
||||
info.dir_ent_num,
|
||||
&ncp_rights,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
6
remove.c
6
remove.c
@@ -74,7 +74,7 @@ static int remove_one(char *path, uint16 dhandle, uint32 object_id,
|
||||
* if the specified path cannot be located. */
|
||||
is_dir = forced_is_file ? 0 : 1;
|
||||
|
||||
rc = c32_ncp87_find_trustee_rights(path, dhandle, object_id, &old_rights,
|
||||
rc = ncp87_05_find_trustee_rights(path, dhandle, object_id, &old_rights,
|
||||
NULL, NULL, NULL);
|
||||
remove_last_rc = rc;
|
||||
if (rc) {
|
||||
@@ -85,9 +85,9 @@ static int remove_one(char *path, uint16 dhandle, uint32 object_id,
|
||||
return(1);
|
||||
}
|
||||
|
||||
rc = c32_ncp22_delete_trustee_rights(path, dhandle, object_id);
|
||||
rc = ncp22_2b_delete_trustee_rights(path, dhandle, object_id);
|
||||
if (rc)
|
||||
rc = c32_ncp87_delete_trustee_rights(path, dhandle, object_id,
|
||||
rc = ncp87_0b_delete_trustee_rights(path, dhandle, object_id,
|
||||
NULL, NULL, NULL);
|
||||
remove_last_rc = rc;
|
||||
if (rc) {
|
||||
|
||||
10
revoke.c
10
revoke.c
@@ -97,7 +97,7 @@ static int revoke_one(char *path, uint16 dhandle, uint32 object_id,
|
||||
* if the path cannot be located. */
|
||||
is_dir = forced_is_file ? 0 : 1;
|
||||
|
||||
rc = c32_ncp87_find_trustee_rights(path, dhandle, object_id, &old_rights,
|
||||
rc = ncp87_05_find_trustee_rights(path, dhandle, object_id, &old_rights,
|
||||
NULL, NULL, NULL);
|
||||
revoke_last_rc = rc;
|
||||
if (rc) {
|
||||
@@ -113,9 +113,9 @@ static int revoke_one(char *path, uint16 dhandle, uint32 object_id,
|
||||
if (new_rights == 0) {
|
||||
/* Novell REVOKE removes the trustee through the old NCP22 trustee path.
|
||||
* Keep the Client32/NCP87 delete call as a compatibility fallback. */
|
||||
rc = c32_ncp22_delete_trustee_rights(path, dhandle, object_id);
|
||||
rc = ncp22_2b_delete_trustee_rights(path, dhandle, object_id);
|
||||
if (rc)
|
||||
rc = c32_ncp87_delete_trustee_rights(path, dhandle, object_id,
|
||||
rc = ncp87_0b_delete_trustee_rights(path, dhandle, object_id,
|
||||
NULL, NULL, NULL);
|
||||
revoke_last_rc = rc;
|
||||
if (rc) {
|
||||
@@ -126,9 +126,9 @@ static int revoke_one(char *path, uint16 dhandle, uint32 object_id,
|
||||
/* Updating the remaining trustee mask is the same old SetTrustee flow
|
||||
* used by GRANT. Fall back to NCP87 add-trustee if a server/client
|
||||
* does not accept NCP22/27. */
|
||||
rc = c32_ncp22_set_trustee_rights(path, dhandle, object_id, new_rights);
|
||||
rc = ncp22_27_set_trustee_rights(path, dhandle, object_id, new_rights);
|
||||
if (rc)
|
||||
rc = c32_ncp87_add_trustee_rights(path, dhandle, object_id, new_rights,
|
||||
rc = ncp87_0a_add_trustee_rights(path, dhandle, object_id, new_rights,
|
||||
0xffff, NULL, NULL, NULL);
|
||||
revoke_last_rc = rc;
|
||||
if (rc) {
|
||||
|
||||
4
rights.c
4
rights.c
@@ -125,7 +125,7 @@ static int rights_get_ncp_info(char *path, C32_NDIR_INFO *info)
|
||||
return(1);
|
||||
|
||||
rights_ncp_path(npath, path, sizeof(npath));
|
||||
return(c32_ncp87_obtain_ndir_info(npath, (uint16)dhandle,
|
||||
return(ncp87_06_obtain_ndir_info(npath, (uint16)dhandle,
|
||||
info, NULL, NULL, NULL));
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ static int rights_effective_mask(char *path, int is_dir, uint8 *mask)
|
||||
* itself instead of mapping files to their parent directory.
|
||||
*/
|
||||
rights_ncp_path(usepath, path, sizeof(usepath));
|
||||
if (!c32_ncp87_get_effective_rights(usepath,
|
||||
if (!ncp87_1d_get_effective_rights(usepath,
|
||||
(uint16)dhandle,
|
||||
&ncp_rights,
|
||||
NULL, NULL, NULL)) {
|
||||
|
||||
Reference in New Issue
Block a user