mirror of
https://github.com/slicer69/doas
synced 2024-10-04 15:10:15 +00:00
commit
66519077d6
4
Makefile
4
Makefile
|
@ -26,6 +26,10 @@ ifeq ($(UNAME_S),FreeBSD)
|
|||
CFLAGS+=-DHAVE_LOGIN_CAP_H
|
||||
LDFLAGS+=-lutil
|
||||
endif
|
||||
ifeq ($(UNAME_S),MidnightBSD)
|
||||
CFLAGS+=-DHAVE_LOGIN_CAP_H
|
||||
LDFLAGS+=-lutil
|
||||
endif
|
||||
ifeq ($(UNAME_S),NetBSD)
|
||||
CFLAGS+=-DHAVE_LOGIN_CAP_H -D_OPENBSD_SOURCE
|
||||
OBJECTS=doas.o env.o y.tab.o
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# doas
|
||||
A port of OpenBSD's doas which runs on FreeBSD, Linux, NetBSD, illumos and macOS.
|
||||
A port of OpenBSD's doas which runs on FreeBSD, Linux, NetBSD, illumos, macOS and MidnightBSD.
|
||||
|
||||
The doas utility is a program originally written for OpenBSD which allows a user to run a command as though they were another user. Typically doas is used to allow non-privileged users to run commands as though they were the root user. The doas program acts as an alternative to sudo, which is a popular method in the Linux community for granting admin access to specific users.
|
||||
|
||||
|
@ -27,6 +27,9 @@ The doas command is in FreeBSD's ports collection and may be installed by simply
|
|||
|
||||
pkg install doas
|
||||
|
||||
The doas command may be installed from MidnightBSD's mports collection with:
|
||||
|
||||
mport install doas
|
||||
|
||||
## Installing build tools
|
||||
|
||||
|
@ -64,7 +67,7 @@ The doas command is in FreeBSD's ports collection and may be installed by simply
|
|||
|
||||
make
|
||||
|
||||
#### FreeBSD, NetBSD and macOS
|
||||
#### FreeBSD, MidnightBSD, NetBSD and macOS
|
||||
|
||||
gmake
|
||||
|
||||
|
@ -98,7 +101,7 @@ following lines:
|
|||
After you save this file you may need to reboot in order for the change to take effect.
|
||||
|
||||
|
||||
#### FreeBSD and NetBSD
|
||||
#### FreeBSD, MidnightBSD and NetBSD
|
||||
|
||||
gmake install
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ closefrom(int lowfd)
|
|||
int i;
|
||||
|
||||
/* Use /proc/self/fd (or /dev/fd on FreeBSD) if it exists. */
|
||||
# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__)
|
||||
# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) || defined(__MidnightBSD__)
|
||||
path = "/dev/fd";
|
||||
# else
|
||||
path = "/proc/self/fd";
|
||||
|
|
6
doas.c
6
doas.c
|
@ -199,7 +199,7 @@ checkconfig(const char *confpath, int argc, char **argv,
|
|||
struct rule *rule;
|
||||
int status;
|
||||
|
||||
#if defined(__linux__) || defined(__FreeBSD__)
|
||||
#if defined(__linux__) || defined(__FreeBSD__) || defined(__MidnightBSD__)
|
||||
status = setresuid(uid, uid, uid);
|
||||
#else
|
||||
status = setreuid(uid, uid);
|
||||
|
@ -526,7 +526,7 @@ main(int argc, char **argv)
|
|||
LOGIN_SETUSER) != 0)
|
||||
errx(1, "failed to set user context for target");
|
||||
#else
|
||||
#if defined(__linux__) || defined(__FreeBSD__)
|
||||
#if defined(__linux__) || defined(__FreeBSD__) || defined(__MidnightBSD__)
|
||||
if (setresgid(target_pw->pw_gid, target_pw->pw_gid, target_pw->pw_gid) == -1)
|
||||
err(1, "setresgid");
|
||||
#else
|
||||
|
@ -535,7 +535,7 @@ main(int argc, char **argv)
|
|||
#endif
|
||||
if (initgroups(target_pw->pw_name, target_pw->pw_gid) == -1)
|
||||
err(1, "initgroups");
|
||||
#if defined(__linux__) || defined(__FreeBSD__)
|
||||
#if defined(__linux__) || defined(__FreeBSD__) || defined(__MidnightBSD__)
|
||||
if (setresuid(target, target, target) == -1)
|
||||
err(1, "setresuid");
|
||||
#else
|
||||
|
|
2
env.c
2
env.c
|
@ -102,7 +102,7 @@ copyenvpw(struct passwd *my_static)
|
|||
new_pw->pw_passwd = strdup(my_static->pw_passwd);
|
||||
new_pw->pw_uid = my_static->pw_uid;
|
||||
new_pw->pw_gid = my_static->pw_gid;
|
||||
#if defined(__FreeBSD__)
|
||||
#if defined(__FreeBSD__) || defined(__MidnightBSD__)
|
||||
new_pw->pw_class = strdup(my_static->pw_class);
|
||||
#endif
|
||||
new_pw->pw_gecos = strdup(my_static->pw_gecos);
|
||||
|
|
Loading…
Reference in a new issue