Bug 98032 - [PATCH] sysutils/portmanager dumps core if not run as root
Summary: [PATCH] sysutils/portmanager dumps core if not run as root
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: Pav Lucistnik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-27 19:30 UTC by marko
Modified: 2006-05-28 21:42 UTC (History)
0 users

See Also:


Attachments
portmanager.c.diff (408 bytes, patch)
2006-05-27 19:30 UTC, marko
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description marko freebsd_committer freebsd_triage 2006-05-27 19:30:20 UTC
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}%

Fix: Apply the following patch
	
How-To-Repeat: Run portmanager as a non-root user
Comment 1 Pav Lucistnik freebsd_committer freebsd_triage 2006-05-28 13:16:42 UTC
State Changed
From-To: open->feedback

Wouldn't it be better to check permissions on that file and bail out 
only when the permissions are not met? 


Comment 2 Pav Lucistnik freebsd_committer freebsd_triage 2006-05-28 13:16:42 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pav

Track
Comment 3 marko freebsd_committer freebsd_triage 2006-05-28 18:39:11 UTC
I thought about that, but since you need to be root to use the ports 
system it seems to make sense to only allow portmanager to run as root.
Comment 4 Pav Lucistnik freebsd_committer freebsd_triage 2006-05-28 20:56:49 UTC
State Changed
From-To: feedback->open

Feedback received
Comment 5 Pav Lucistnik freebsd_committer freebsd_triage 2006-05-28 21:42:07 UTC
State Changed
From-To: open->closed

Committed, thanks!