authorgravatar for 43040593+dantecatalfamo@users.noreply.github.comDante Catalfamo <43040593+dantecatalfamo@users.noreply.github.com> 2021-12-22 00:59:53-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-12-31 14:21:22-07:00
log4d9377923d26ffa662612c75262849eda67d50fe
tree8425aed5716376e0f158dd4e47a512536fbcd97c
parentcfc00e743e272e6c44d45f2e965f96c1656d59f3

Add BSD Authentication constants (#10376)


1 files changed, 41 insertions(+), 1 deletions(-)

lib/std/c/openbsd.zig+41-1
......@@ -703,8 +703,48 @@ pub const T = struct {
703703 pub const IOCXMTFRAME = 0x80087444;
704704};
705705
706// BSD Authentication
707pub const auth_item_t = c_int;
708
709pub const AUTHV = struct {
710 pub const ALL: auth_item_t = 0;
711 pub const CHALLENGE: auth_item_t = 1;
712 pub const CLASS: auth_item_t = 2;
713 pub const NAME: auth_item_t = 3;
714 pub const SERVICE: auth_item_t = 4;
715 pub const STYLE: auth_item_t = 5;
716 pub const INTERACTIVE: auth_item_t = 6;
717};
718
719pub const BI = struct {
720 pub const AUTH = "authorize"; // Accepted authentication
721 pub const REJECT = "reject"; // Rejected authentication
722 pub const CHALLENGE = "reject challenge"; // Reject with a challenge
723 pub const SILENT = "reject silent"; // Reject silently
724 pub const REMOVE = "remove"; // remove file on error
725 pub const ROOTOKAY = "authorize root"; // root authenticated
726 pub const SECURE = "authorize secure"; // okay on non-secure line
727 pub const SETENV = "setenv"; // set environment variable
728 pub const UNSETENV = "unsetenv"; // unset environment variable
729 pub const VALUE = "value"; // set local variable
730 pub const EXPIRED = "reject expired"; // account expired
731 pub const PWEXPIRED = "reject pwexpired"; // password expired
732 pub const FDPASS = "fd"; // child is passing an fd
733};
734
735pub const AUTH = struct {
736 pub const OKAY: c_int = 0x01; // user authenticated
737 pub const ROOTOKAY: c_int = 0x02; // authenticated as root
738 pub const SECURE: c_int = 0x04; // secure login
739 pub const SILENT: c_int = 0x08; // silent rejection
740 pub const CHALLENGE: c_int = 0x10; // a challenge was given
741 pub const EXPIRED: c_int = 0x20; // account expired
742 pub const PWEXPIRED: c_int = 0x40; // password expired
743 pub const ALLOW: c_int = (OKAY | ROOTOKAY | SECURE);
744};
745
706746// Term
707const V = struct {
747pub const V = struct {
708748 pub const EOF = 0; // ICANON
709749 pub const EOL = 1; // ICANON
710750 pub const EOL2 = 2; // ICANON