X-Git-Url: http://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=tests%2Fauth%2Fsuperuser-t.c;h=dd53b980d2410b6a78b57b485db8049d41f707da;hp=bc46fab09a2486ed8777238b9d592509ae18d13f;hb=954aa2338ce3fbaee81defe45a4d99da69d0baf7;hpb=1bc528d008fe11c43da6f6eef4210561bab33cbc diff --git a/tests/auth/superuser-t.c b/tests/auth/superuser-t.c index bc46fab..dd53b98 100644 --- a/tests/auth/superuser-t.c +++ b/tests/auth/superuser-t.c @@ -38,6 +38,7 @@ #include #include +#define HC_DEPRECATED #include #include @@ -123,7 +124,7 @@ startClient(char *configPath) struct hostent *he; afs_uint32 addr; afs_int32 result; - char *string; + char *string = NULL; plan(63); @@ -255,6 +256,8 @@ startClient(char *configPath) is_int(0, code, "Can get identity back"); is_string("", string, "Forged token is super user"); + xdr_free((xdrproc_t)xdr_string, &string); + /* Throw away this connection and security class */ rx_DestroyConnection(conn); rxs_Release(class); @@ -275,9 +278,11 @@ startClient(char *configPath) is_int(EPERM, code, "Running new interface RPC as non-super user fails as expected"); code = TEST_WhoAmI(conn, &string); + xdr_free((xdrproc_t)xdr_string, &string); is_int(EPERM, code, "Running RPC returning string fails as expected"); code = TEST_NewWhoAmI(conn, &string); + xdr_free((xdrproc_t)xdr_string, &string); is_int(EPERM, code, "Running new interface RPC returning string fails as expected"); ok(afsconf_AddUser(dir, "rpctest") == 0, @@ -289,9 +294,11 @@ startClient(char *configPath) code = TEST_WhoAmI(conn, &string); is_int(0, code, "Running RPC returning string as %s works", "rpctest"); is_string("rpctest", string, "Returned user string matches"); + xdr_free((xdrproc_t)xdr_string, &string); code = TEST_NewWhoAmI(conn, &string); is_int(0, code, "Running new RPC returning string as %s works", "rpctest"); is_string("rpctest", string, "Returned user string for new interface matches"); + xdr_free((xdrproc_t)xdr_string, &string); rx_DestroyConnection(conn); rxs_Release(class); @@ -310,9 +317,11 @@ startClient(char *configPath) is_int(EPERM, code, "Running new interface RPC as non-super user fails as expected"); code = TEST_WhoAmI(conn, &string); + xdr_free((xdrproc_t)xdr_string, &string); is_int(EPERM, code, "Running RPC returning string fails as expected"); code = TEST_NewWhoAmI(conn, &string); + xdr_free((xdrproc_t)xdr_string, &string); is_int(EPERM, code, "Running new interface RPC returning string fails as expected"); @@ -326,11 +335,13 @@ startClient(char *configPath) code = TEST_WhoAmI(conn, &string); is_int(0, code, "Running RPC returning string as %s works", "rpctest/admin"); is_string("rpctest.admin", string, "Returned user string matches"); + xdr_free((xdrproc_t)xdr_string, &string); code = TEST_NewWhoAmI(conn, &string); is_int(0, code, "Running new interface RPC returning string as %s works", "rpctest/admin"); is_string("rpctest.admin", string, "Returned user string from new interface matches"); + xdr_free((xdrproc_t)xdr_string, &string); rx_DestroyConnection(conn); rxs_Release(class); @@ -410,7 +421,7 @@ startServer(char *configPath) exit(1); } - afsconf_BuildServerSecurityObjects(globalDir, 0, &classes, &numClasses); + afsconf_BuildServerSecurityObjects(globalDir, &classes, &numClasses); service = rx_NewService(0, TEST_SERVICE_ID, "test", classes, numClasses, TEST_ExecuteRequest); if (service == NULL) { @@ -426,7 +437,6 @@ int main(int argc, char **argv) struct afsconf_dir *dir; char *dirname; int serverPid, clientPid, waited, stat; - char keymaterial[]="\x19\x17\xff\xe6\xbb\x77\x2e\xfc"; int code; /* Start the client and the server if requested */ @@ -447,7 +457,7 @@ int main(int argc, char **argv) /* Otherwise, do the basic configuration, then start the client and * server */ - dirname = buildTestConfig(); + dirname = afstest_BuildTestConfig(); dir = afsconf_Open(dirname); if (dir == NULL) { @@ -455,10 +465,7 @@ int main(int argc, char **argv) exit(1); } - DES_set_odd_parity((DES_cblock *)keymaterial); - - /* Add a key to it so we can use it for connection tests */ - code = afsconf_AddKey(dir, 1, keymaterial, 1); + code = afstest_AddDESKeyFile(dir); if (code) { afs_com_err("superuser-t", code, "while adding new key\n"); exit(1);