aboutsummaryrefslogtreecommitdiff
path: root/security/op
diff options
context:
space:
mode:
authorKirill Ponomarev <krion@FreeBSD.org>2003-12-23 21:54:31 +0000
committerKirill Ponomarev <krion@FreeBSD.org>2003-12-23 21:54:31 +0000
commitc2bca8fd8137770131843197509c4b0828328070 (patch)
treeee77fe568f8ce219dcf1ec52e1eac2d0599b81a9 /security/op
parentaae018f32717eb181242935546bf011b35f906a2 (diff)
downloadports-c2bca8fd8137770131843197509c4b0828328070.tar.gz
ports-c2bca8fd8137770131843197509c4b0828328070.zip
- Give maintainership to Steve Simmons <scs@umich.edu>
- Setgid added in addition to setgroups PR: 60516 Submitted by: maintainer
Notes
Notes: svn path=/head/; revision=96495
Diffstat (limited to 'security/op')
-rw-r--r--security/op/Makefile4
-rw-r--r--security/op/files/patch-main.c37
2 files changed, 31 insertions, 10 deletions
diff --git a/security/op/Makefile b/security/op/Makefile
index 6b56dc3ede80..49da45a21863 100644
--- a/security/op/Makefile
+++ b/security/op/Makefile
@@ -7,7 +7,7 @@
PORTNAME= op
PORTVERSION= 1.11
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= security
MASTER_SITES= ftp://ftp.cerias.purdue.edu/pub/tools/%SUBDIR%/ \
ftp://ftp.rge.com/pub/security/cerias/tools/%SUBDIR%/ \
@@ -15,7 +15,7 @@ MASTER_SITES= ftp://ftp.cerias.purdue.edu/pub/tools/%SUBDIR%/ \
ftp://ftp.nask.pl/pub/mirror/coast.cs.purdue.edu/%SUBDIR%/
MASTER_SITE_SUBDIR= unix/sysutils/${PORTNAME}
-MAINTAINER= cyrille.lefevre@laposte.net
+MAINTAINER= scs@umich.edu
COMMENT= Allow others to run commands as root (like sudo but different)
# Global variables
diff --git a/security/op/files/patch-main.c b/security/op/files/patch-main.c
index 5d449b8b439f..a7bff8d77e9e 100644
--- a/security/op/files/patch-main.c
+++ b/security/op/files/patch-main.c
@@ -1,5 +1,5 @@
---- main.c.orig Wed Oct 15 05:58:41 2003
-+++ main.c Wed Oct 15 06:02:22 2003
+--- main.c.orig Mon Dec 22 23:26:47 2003
++++ main.c Mon Dec 22 23:27:23 2003
@@ -9,7 +9,7 @@
/* +-------------------------------------------------------------------+ */
@@ -9,7 +9,15 @@
#include <syslog.h>
#include <pwd.h>
#include <grp.h>
-@@ -170,14 +170,11 @@
+@@ -51,6 +51,7 @@
+ extern char *getpass(), *crypt();
+
+ char *Progname;
++int fatal(char *s, ...);
+ char *format_cmd();
+ char *GetCode();
+ cmd_t *Find();
+@@ -170,14 +171,11 @@
return Go(new, num, argc, argv);
}
@@ -26,7 +34,7 @@
vfprintf(stderr, s, ap);
fputc('\n', stderr);
va_end(ap);
-@@ -448,29 +445,17 @@
+@@ -448,35 +446,28 @@
char *cp, *np;
struct passwd *pw;
struct group *gr;
@@ -50,15 +58,29 @@
- }
-
if ((cp = FindOpt(cmd, "gid")) == NULL) {
- ; /* don't have a default */
+- ; /* don't have a default */
++ if (setgid(0) < 0)
++ fatal("Unable to set gid to default", cp);
} else {
for (cp=GetField(cp, str); cp!=NULL; cp=GetField(cp, str)) {
- if ((gr = getgrnam(cp)) != NULL)
+ if ((gr = getgrnam(str)) != NULL)
gidset[ngroups++] = gr->gr_gid;
++ else
++ gidset[ngroups++] = atoi(str);
}
if (ngroups == 0)
-@@ -533,6 +518,18 @@
+- fatal("Unable to setgid to any group");
++ fatal("Unable to set gid to any group");
+ if (setgroups(ngroups, gidset) < 0)
+- fatal("Set group failed");
++ fatal("Unable to set auxiliary groups");
++ if (setgid(gidset[0]) < 0)
++ fatal("Unable to set gid to %s", gidset[0]);
+ }
+
+ if ((cp = FindOpt(cmd, "umask")) == NULL) {
+@@ -533,6 +524,17 @@
new_envp[curenv++] = environ[i];
}
new_envp[curenv] = NULL;
@@ -70,8 +92,7 @@
+ if ((pw = getpwnam(cp)) == NULL) {
+ if (setuid(atoi(cp)) < 0)
+ fatal("Unable to set uid to %s", cp);
-+ }
-+ if (setuid(pw->pw_uid) < 0)
++ } else if (setuid(pw->pw_uid) < 0)
+ fatal("Unable to set uid to %s", cp);
+ }