tests: require login for AFP smoke test
All checks were successful
Source release / source-package (push) Successful in 47s
All checks were successful
Source release / source-package (push) Successful in 47s
Open the libncp connection with login_necessary set to true. ncpfs/libncp does not block individual NCP endpoints here. The problem was that ncp_initialize(..., 0, ...) deliberately clears the user name even when -S/-U/-P were supplied, leaving the connection unauthenticated. mars_nwe then rejects directory-handle allocation for non-login paths with Invalid Path before the AFP NCP 0x23/0x0c request is ever sent. The AFP Entry ID smoke test needs normal file-service path access in order to allocate or use a directory handle before issuing the AFP request. Require a logged-in connection, while still allowing no-password test users via libncp's existing -n option. This changes only the Linux smoke test; server AFP protocol behavior is unchanged.
This commit is contained in:
@@ -177,9 +177,17 @@ int main(int argc, char **argv)
|
||||
return 2;
|
||||
}
|
||||
|
||||
conn = ncp_initialize(&argc, argv, 0, &init_err);
|
||||
/*
|
||||
* The smoke test needs normal file-service path access before it can send
|
||||
* AFP 0x0c: it has to allocate/use a directory handle for the supplied
|
||||
* VOL:PATH. ncp_initialize(..., 0, ...) intentionally clears the user
|
||||
* name even if -U/-P were supplied, so mars_nwe treats the connection as
|
||||
* unauthenticated and rejects non-login paths before the AFP request is
|
||||
* reached. Require a login here; no-password users can still use -n.
|
||||
*/
|
||||
conn = ncp_initialize(&argc, argv, 1, &init_err);
|
||||
if (!conn) {
|
||||
fprintf(stderr, "ncp_initialize failed: %ld\n", init_err);
|
||||
fprintf(stderr, "ncp_initialize/login failed: %ld\n", init_err);
|
||||
usage(argv[0]);
|
||||
return 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user