Bug 56614 - Maintainer update: security/op (1.11) -- security fix
Summary: Maintainer update: security/op (1.11) -- security fix
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Sergey A. Osokin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-09 01:00 UTC by Cyrille Lefevre
Modified: 2003-09-11 07:20 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (1.58 KB, patch)
2003-09-09 01:00 UTC, Cyrille Lefevre
no flags Details | Diff
file.diff (1.63 KB, patch)
2003-09-09 01:00 UTC, Cyrille Lefevre
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cyrille Lefevre 2003-09-09 01:00:22 UTC
	Makefile
		PORTREVISION bumped
		PLIST_SUB added (CONF_DIR)
		NOPORTSDOC -> NOPORTDOCS
	pkg-plist
		etc -> %%CONF_DIR%%
		share/doc/op -> %%DOCSDIR%%
	files/patch-main.c
		setuid misplaced (security fix)
		thx to cyrill@econ.krasnoyarsk.su for submitting this patch.

Fix: take care, this patch is in two parts,
	the first one is a diff against /dev/null
	and the second one a cvs diff.
How-To-Repeat: 	n/a
Comment 1 Sergey A. Osokin freebsd_committer freebsd_triage 2003-09-09 16:41:43 UTC
Responsible Changed
From-To: freebsd-ports-bugs->osa

I'll handle this.
Comment 2 Sergey A. Osokin freebsd_committer freebsd_triage 2003-09-09 16:53:04 UTC
State Changed
From-To: open->closed

Committed with little modifications, thanks!
Comment 3 Andre.Albsmeier 2003-09-11 07:19:11 UTC
One more patch:

--- main.c.ORI	Thu Sep 11 07:47:14 2003
+++ main.c	Thu Sep 11 08:06:49 2003
@@ -460,6 +460,8 @@
 		for (cp=GetField(cp, str); cp!=NULL; cp=GetField(cp, str)) {
 			if ((gr = getgrnam(str)) != NULL)
 				gidset[ngroups++] = gr->gr_gid;
+			else
+				gidset[ngroups++] = atoi(str);
 		}
 		if (ngroups == 0) 
 			fatal("Unable to setgid to any group");
@@ -529,7 +531,7 @@
 		if ((pw = getpwnam(cp)) == NULL) {
 			if (setuid(atoi(cp)) < 0)
 				fatal("Unable to set uid to %s", cp);
-		}
+		} else
 		if (setuid(pw->pw_uid) < 0)
 			fatal("Unable to set uid to %s", cp);
 	}


The first part fixes numerical gids, the second one numerical
uids. Without the second one, op dumps core when a numerical
uid is specified.

	-Andre

-- 
Failure is not an option -- it comes bundled with Windows.