diff --git a/src/driver/toks_amain.c b/src/driver/toks_amain.c index 45739e1..c02e19e 100644 --- a/src/driver/toks_amain.c +++ b/src/driver/toks_amain.c @@ -61,6 +61,7 @@ int toks_main(char ** argv, char ** envp) { int ret; struct toks_driver_ctx * dctx; + struct toks_token_string toks; if ((ret = toks_init())) return ret; @@ -74,10 +75,16 @@ int toks_main(char ** argv, char ** envp) if ((toks_version(dctx)) < 0) return toks_exit(dctx,2); - if (dctx->cctx->drvflags & TOKS_DRIVER_ACTION_ACQUIRE) + if (dctx->cctx->drvflags & TOKS_DRIVER_ACTION_ACQUIRE) { ret = toks_client_acquire(dctx) ? 2 : 0; + if (ret == 0) { + toks_client_token_to_str(dctx,&toks); + toks_dprintf(STDOUT_FILENO,"%s\n",toks.token); + } + } + return (dctx->cctx->drvflags & TOKS_DRIVER_MODE_SERVER) ? NT_STATUS_SERVICE_NOTIFICATION : toks_exit(dctx,ret);