summaryrefslogtreecommitdiff
path: root/lib9p/srv.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-04-19 09:14:20 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-04-19 12:53:42 -0600
commitb85e0bd570de1245afa2738057925320789601c5 (patch)
tree865061c13a9b256c2b0cd66e0530d9cf951c981a /lib9p/srv.c
parent0a700d5e8e5feec3fc07316924a00b2b7cab6050 (diff)
lib9p_idl: Clean up struct stat and numeric user IDs
Diffstat (limited to 'lib9p/srv.c')
-rw-r--r--lib9p/srv.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib9p/srv.c b/lib9p/srv.c
index 0196a0e..b5455e0 100644
--- a/lib9p/srv.c
+++ b/lib9p/srv.c
@@ -170,7 +170,7 @@ static inline bool srv_check_perm(struct srv_req *ctx, struct lib9p_stat *stat,
assert(action);
/* TODO actually check user and group instead of just assuming "other". */
- uint8_t mode = (uint8_t)(stat->file_mode & 07);
+ uint8_t mode = (uint8_t)(stat->mode & 07);
return mode & action;
}
@@ -800,7 +800,7 @@ static void handle_Tauth(struct srv_req *ctx,
goto tauth_return;
}
- ctx->user = srv_userid_new(req->uname, req->n_uid);
+ ctx->user = srv_userid_new(req->uname, req->unum);
srv->auth(ctx, req->aname);
@@ -839,10 +839,10 @@ static void handle_Tattach(struct srv_req *ctx,
afid->user->name.len, afid->user->name.utf8,
req->uname.len, req->uname.utf8);
#if CONFIG_9P_ENABLE_9P2000_u || CONFIG_9P_ENABLE_9P2000_L
- else if (afid->user->num != req->n_uid)
+ else if (afid->user->num != req->unum)
lib9p_errorf(&ctx->basectx,
LIB9P_ERRNO_L_EACCES, "FID provided as auth-file is for user=%"PRIu32" and cannot be used for user=%"PRIu32,
- afid->user->num, req->n_uid);
+ afid->user->num, req->unum);
#endif
else if (!lib9p_str_eq(afid->auth.aname, req->aname))
lib9p_errorf(&ctx->basectx,
@@ -861,7 +861,7 @@ static void handle_Tattach(struct srv_req *ctx,
LIB9P_ERRNO_L_EACCES, "FID provided as auth-file, but no auth-file is required");
goto tattach_return;
}
- ctx->user = srv_userid_new(req->uname, req->n_uid);
+ ctx->user = srv_userid_new(req->uname, req->unum);
}
/* 1. File object */
@@ -1047,12 +1047,12 @@ static void handle_Topen(struct srv_req *ctx,
if (lib9p_ctx_has_error(&ctx->basectx))
goto topen_return;
lib9p_stat_assert(stat);
- if ((stat.file_mode & LIB9P_DM_EXCL) && pathinfo->io_refcount) {
+ if ((stat.mode & LIB9P_DM_EXCL) && pathinfo->io_refcount) {
lib9p_error(&ctx->basectx,
LIB9P_ERRNO_L_EEXIST, "exclusive file is already opened");
goto topen_return;
}
- if (stat.file_mode & LIB9P_DM_APPEND) {
+ if (stat.mode & LIB9P_DM_APPEND) {
fidflags |= FIDFLAG_APPEND;
reqmode = reqmode & ~LIB9P_O_TRUNC;
}