mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
Print a warning if not setuid root.
Document the need for the setuid bit and how to set it. Explain why it isn't set by default, and suggest simply adding users to groups instead. PR: docs/167741 MFC after: 3 weeks
This commit is contained in:
parent
5b2acfeca5
commit
30c4fc7cf9
2 changed files with 13 additions and 3 deletions
|
|
@ -24,7 +24,7 @@
|
|||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd May 23, 2002
|
||||
.Dd February 8, 2013
|
||||
.Dt NEWGRP 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
|
@ -90,6 +90,15 @@ A
|
|||
utility appeared in
|
||||
.At v6 .
|
||||
.Sh BUGS
|
||||
For security reasons, the
|
||||
.Nm
|
||||
utility is normally installed without the setuid bit.
|
||||
To enable it, run the following command:
|
||||
.Bd -literal -offset indent
|
||||
chmod u+s /usr/bin/newgrp
|
||||
.Ed
|
||||
.Pp
|
||||
Group passwords are inherently insecure as there is no way to stop
|
||||
users obtaining the crypted passwords from the group database.
|
||||
users obtaining the password hash from the group database.
|
||||
Their use is discouraged.
|
||||
Instead, users should simply be added to the necessary groups.
|
||||
|
|
|
|||
|
|
@ -73,7 +73,8 @@ main(int argc, char *argv[])
|
|||
{
|
||||
int ch, login;
|
||||
|
||||
euid = geteuid();
|
||||
if ((euid = geteuid()) != 0)
|
||||
warnx("need root permissions to function properly, check setuid bit");
|
||||
if (seteuid(getuid()) < 0)
|
||||
err(1, "seteuid");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue