ports/98032: [PATCH] sysutils/portmanager dumps core if not run as root
Mark Ovens
marko at FreeBSD.org
Sat May 27 18:30:51 UTC 2006
>Number: 98032
>Category: ports
>Synopsis: [PATCH] sysutils/portmanager dumps core if not run as root
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat May 27 18:30:20 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Mark Ovens
>Release: FreeBSD 6.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD redshift 6.1-RC FreeBSD 6.1-RC #0: Mon May 1 14:05:04 BST 2006 root at redshift:/usr/obj/usr/src/sys/REDSHIFT i386
>Description:
If portmanager is run as a user other than root it dumps core because the user does not have write perms for /usr/local/share/portmanager/ignore.db. This is not very graceful!
/home/mark{4}% portmanager
touch: /usr/local/share/portmanager/ignore.db: Permission denied
MGdbCreate error, lstat of /usr/local/share/portmanager/ignore.db failed
lstat: No such file or directory
Assertion failed: (0), function MGdbCreate, file MGdbCreate.c, line 64.
Abort (core dumped)
/home/mark{5}%
>How-To-Repeat:
Run portmanager as a non-root user
>Fix:
Apply the following patch
--- portmanager.c.diff begins here ---
--- portmanager/portmanager.c.orig Tue Dec 13 00:20:58 2005
+++ portmanager/portmanager.c Sat May 27 18:08:32 2006
@@ -34,7 +34,13 @@
int main( int argc, char** argv, char** argp)
{
int errorCode = 0;
-
+
+ if ( getuid() != 0 )
+ {
+ fprintf( stderr, "%s must be run as root\n", argv[0] );
+ exit( 1 );
+ }
+
errorCode = MGPMrCommandLine( argc, (char**)argv, (char**)argp );
exit( errorCode );
}
--- portmanager.c.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list