diff --git a/tests/nwfs/nwfs_ncpfs_dirquota.c b/tests/nwfs/nwfs_ncpfs_dirquota.c index 433bbd4..daca664 100644 --- a/tests/nwfs/nwfs_ncpfs_dirquota.c +++ b/tests/nwfs/nwfs_ncpfs_dirquota.c @@ -35,6 +35,8 @@ int main(int argc, char **argv) char volpath[1000]; char remote[2000]; unsigned char nwpath[1000]; + NWDIR_HANDLE dirhandle = 0; + NWVOL_NUM volnum = 0; const char *override_path = NULL; const char *mounted_path; unsigned long limit = 0; @@ -103,18 +105,29 @@ int main(int argc, char **argv) return 1; } + err = ncp_ns_alloc_short_dir_handle(conn, NW_NS_DOS, NCP_DIRSTYLE_NOHANDLE, + 0, 0, nwpath, len, + NCP_ALLOC_TEMPORARY, &dirhandle, &volnum); + if (err) { + fprintf(stderr, "cannot obtain directory handle for %s: %s\n", + mounted_path, strnwerror(err)); + ncp_close(conn); + return 1; + } + { struct ncp_dos_info info; memset(&info, 0, sizeof(info)); info.MaximumSpace = limit; err = ncp_ns_modify_entry_dos_info(conn, NW_NS_DOS, SA_ALL, - NCP_DIRSTYLE_NOHANDLE, - 0, 0, nwpath, len, + NCP_DIRSTYLE_HANDLE, + volnum, dirhandle, NULL, 0, DM_MAXIMUM_SPACE, &info); } if (err) { - fprintf(stderr, "cannot set directory quota on %s: %s\n", mounted_path, strnwerror(err)); + fprintf(stderr, "cannot set directory quota on %s (vol=%u handle=0x%02x): %s\n", + mounted_path, (unsigned)volnum, (unsigned)dirhandle, strnwerror(err)); ncp_close(conn); return 1; }