diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-10 10:26:28 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-10 10:26:28 -0600 |
commit | db92bd35807305e6daec5ec40bd67cbc43fe88ee (patch) | |
tree | 8458933923545c87632e953a1c10a215efa78a0c /lib9p/9p.c | |
parent | bb5afed7a0eeaf361be1e29b3a3ab8ace2865b39 (diff) |
lib9p: Implemnt Topen, add permission checks in Twalk
Diffstat (limited to 'lib9p/9p.c')
-rw-r--r-- | lib9p/9p.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -14,6 +14,8 @@ #include "internal.h" int lib9p_error(struct lib9p_ctx *ctx, uint32_t linux_errno, char const *msg) { + if (lib9p_ctx_has_error(ctx)) + return -1; strncpy(ctx->err_msg, msg, sizeof(ctx->err_msg)); ctx->err_msg[sizeof(ctx->err_msg)-1] = '\0'; ctx->err_num = linux_errno; @@ -24,6 +26,8 @@ int lib9p_errorf(struct lib9p_ctx *ctx, uint32_t linux_errno, char const *fmt, . int n; va_list args; + if (lib9p_ctx_has_error(ctx)) + return -1; va_start(args, fmt); n = vsnprintf(ctx->err_msg, sizeof(ctx->err_msg), fmt, args); va_end(args); |