Skip to content

Commit 4751a4d

Browse files
committed
Make a ttydev parse error non-fatal for now
This is new for sudo 1.9.16 so we don't want to break sudo if there ends up being a bug in formatting dev_t from the front-end.
1 parent 6a5a8f5 commit 4751a4d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

plugins/sudoers/policy.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,14 +469,16 @@ sudoers_policy_deserialize_info(struct sudoers_context *ctx, void *v,
469469
long long llval;
470470

471471
/*
472-
* dev_t is unsigned but sudo_strtonum() deals with signed values.
473-
* This is not a problem in practice since we allow the full range.
472+
* dev_t can be signed or unsigned. The front-end formats it
473+
* as long long (signed). We allow the full range of values
474+
* which should work with either signed or unsigned dev_t.
474475
*/
475476
p = *cur + sizeof("ttydev=") - 1;
476477
llval = sudo_strtonum(p, LLONG_MIN, LLONG_MAX, &errstr);
477478
if (errstr != NULL) {
479+
/* Front end bug? Not a fatal error. */
478480
INVALID("ttydev=");
479-
goto bad;
481+
continue;
480482
}
481483
ctx->user.ttydev = (dev_t)llval;
482484
continue;

0 commit comments

Comments
 (0)