DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 16th February 2015
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 314
Default Building ports with USE_SYSTRACE=Yes

I followed the FAQ - Configuration of the ports system including the USE_SYSTRACE=Yes (just curious/tinkering) and I noticed several reports like:
Code:
 mkdir -p '/usr/ports/pobj/squid-3.HEAD-20140626-r13480/fake-i386/usr/local/share/squid/icons/silk'
systrace: deny user: root, prog: /bin/mkdir, pid: 12743(0)[13804], policy: /usr/bin/env, filters: 246, syscall: native-fswrite(136), filename: /usr
systrace: deny user: root, prog: /bin/mkdir, pid: 12743(0)[13804], policy: /usr/bin/env, filters: 246, syscall: native-fswrite(136), filename: /usr/ports
systrace: deny user: root, prog: /bin/mkdir, pid: 12743(0)[13804], policy: /usr/bin/env, filters: 246, syscall: native-fswrite(136), filename: /usr/ports/pobj
It's a fresh 5.6-stable i386 system with nothing unusual except maybe /usr/ports/pobj is on its own disk partition. Could that be the problem?
Reply With Quote
  #2   (View Single Post)  
Old 16th February 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

I think so, yes.

$USE_SYSTRACE is really helpful for port development, because it can indicate if there are any issues with scripts and makefiles. It's one of those variables I enable when developing a new port, and do not use when building packages of established ports. The OpenBSD Porter's Handbook discusses this knob in Chapters 2 and 4.

Last edited by jggimi; 16th February 2015 at 09:52 PM. Reason: thinko.
Reply With Quote
  #3   (View Single Post)  
Old 17th February 2015
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 314
Default

I'm beginning to think this is how systrace responds to 'mkdir -p' and 'install -d'. I did a $ sudo umount /usr/ports/pobj and tried a test by building the unzip package:

$ cd /usr/ports/archivers/unzip
$ make package
and got:
Code:
===>  Faking installation for unzip-6.0p5
install -d -o root -g bin -m 755 /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/bin
systrace: deny user: root, prog: /usr/bin/install, pid: 3283(0)[4291], policy: /usr/bin/env, filters: 246, syscall: native-fswrite(136), filename: /usr
systrace: deny user: root, prog: /usr/bin/install, pid: 3283(0)[4291], policy: /usr/bin/env, filters: 246, syscall: native-fswrite(136), filename: /usr/ports
systrace: deny user: root, prog: /usr/bin/install, pid: 3283(0)[4291], policy: /usr/bin/env, filters: 246, syscall: native-fswrite(136), filename: /usr/ports/pobj
install -c -s -o root -g bin -m 555 unzip funzip unzipsfx /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/bin
install -c -o root -g bin -m 555 unix/zipgrep /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/bin
rm -f /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/bin/zipinfo
ln -sf /usr/local/bin/unzip /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/bin/zipinfo
install -d -o root -g bin -m 755 /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/man/man1
systrace: deny user: root, prog: /usr/bin/install, pid: 10058(0)[4291], policy: /usr/bin/env, filters: 246, syscall: native-fswrite(136), filename: /usr
systrace: deny user: root, prog: /usr/bin/install, pid: 10058(0)[4291], policy: /usr/bin/env, filters: 246, syscall: native-fswrite(136), filename: /usr/ports
systrace: deny user: root, prog: /usr/bin/install, pid: 10058(0)[4291], policy: /usr/bin/env, filters: 246, syscall: native-fswrite(136), filename: /usr/ports/pobj
install -c -o root -g bin -m 444 man/funzip.1 /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/man/man1/funzip.1
install -c -o root -g bin -m 444 man/unzip.1 /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/man/man1/unzip.1
install -c -o root -g bin -m 444 man/unzipsfx.1 /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/man/man1/unzipsfx.1
install -c -o root -g bin -m 444 man/zipgrep.1 /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/man/man1/zipgrep.1
install -c -o root -g bin -m 444 man/zipinfo.1 /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/man/man1/zipinfo.1
install -d -o root -g bin -m 755 /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/share/doc/unzip
systrace: deny user: root, prog: /usr/bin/install, pid: 1993(0)[5716], policy: /usr/bin/make, filters: 246, syscall: native-fswrite(136), filename: /usr
systrace: deny user: root, prog: /usr/bin/install, pid: 1993(0)[5716], policy: /usr/bin/make, filters: 246, syscall: native-fswrite(136), filename: /usr/ports
systrace: deny user: root, prog: /usr/bin/install, pid: 1993(0)[5716], policy: /usr/bin/make, filters: 246, syscall: native-fswrite(136), filename: /usr/ports/pobj
cd /usr/ports/pobj/unzip-6.0/unzip60; install -c -o root -g bin -m 444 COPYING.OLD LICENSE README WHERE /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/share/doc/unzip
===>  Building package for unzip-6.0p5
Create /usr/ports/packages/i386/all/unzip-6.0p5.tgz
Link to /usr/ports/packages/i386/ftp/unzip-6.0p5.tgz
Link to /usr/ports/packages/i386/cdrom/unzip-6.0p5.tgz
Which is the same response as with /usr/ports/pobj mounted on its own partition.

I modified the systrace policy file for the ports system /usr/ports/infrastructure/db/systrace.filter to include rules for $WRKOBJDIR (which is set to /usr/ports/pobj in /etc/mk.conf) then:

$ sudo mount /usr/ports/pobj
$ cd /usr/ports/archivers/unzip
$ make package
and got:
Code:
===>  Faking installation for unzip-6.0p5
install -d -o root -g bin -m 755 /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/bin
systrace: deny user: root, prog: /usr/bin/install, pid: 24801(0)[25430], policy: /usr/bin/env, filters: 274, syscall: native-fswrite(136), filename: /usr
systrace: deny user: root, prog: /usr/bin/install, pid: 24801(0)[25430], policy: /usr/bin/env, filters: 274, syscall: native-fswrite(136), filename: /usr/ports
install -c -s -o root -g bin -m 555 unzip funzip unzipsfx /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/bin
install -c -o root -g bin -m 555 unix/zipgrep /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/bin
rm -f /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/bin/zipinfo
ln -sf /usr/local/bin/unzip /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/bin/zipinfo
install -d -o root -g bin -m 755 /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/man/man1
systrace: deny user: root, prog: /usr/bin/install, pid: 12752(0)[25430], policy: /usr/bin/env, filters: 274, syscall: native-fswrite(136), filename: /usr
systrace: deny user: root, prog: /usr/bin/install, pid: 12752(0)[25430], policy: /usr/bin/env, filters: 274, syscall: native-fswrite(136), filename: /usr/ports
install -c -o root -g bin -m 444 man/funzip.1 /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/man/man1/funzip.1
install -c -o root -g bin -m 444 man/unzip.1 /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/man/man1/unzip.1
install -c -o root -g bin -m 444 man/unzipsfx.1 /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/man/man1/unzipsfx.1
install -c -o root -g bin -m 444 man/zipgrep.1 /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/man/man1/zipgrep.1
install -c -o root -g bin -m 444 man/zipinfo.1 /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/man/man1/zipinfo.1
install -d -o root -g bin -m 755 /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/share/doc/unzip
systrace: deny user: root, prog: /usr/bin/install, pid: 20634(0)[7099], policy: /usr/bin/make, filters: 274, syscall: native-fswrite(136), filename: /usr
systrace: deny user: root, prog: /usr/bin/install, pid: 20634(0)[7099], policy: /usr/bin/make, filters: 274, syscall: native-fswrite(136), filename: /usr/ports
cd /usr/ports/pobj/unzip-6.0/unzip60; install -c -o root -g bin -m 444 COPYING.OLD LICENSE README WHERE /usr/ports/pobj/unzip-6.0/fake-i386/usr/local/share/doc/unzip
===>  Building package for unzip-6.0p5
Create /usr/ports/packages/i386/all/unzip-6.0p5.tgz
Link to /usr/ports/packages/i386/ftp/unzip-6.0p5.tgz
Link to /usr/ports/packages/i386/cdrom/unzip-6.0p5.tgz
Slightly different - no denials on /usr/ports/pobj, just the two parent directories. The -d option on install(1) and the -p option on mkdir(1) seem to trigger systrace.

Last edited by hanzer; 17th February 2015 at 02:22 AM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Got my ports tree deleted after attempting ports update bsdnotbdsm FreeBSD Ports and Packages 2 18th May 2014 01:58 PM
FreeBSD Complete ports thaw after ports freeze for 7.3 Release J65nko News 0 24th March 2010 11:46 PM
Building a New System, Ideas ninjatux General Hardware 19 20th May 2009 09:54 AM
Problem Building Openoffice-3 Alphalutra1 FreeBSD Ports and Packages 1 1st May 2009 04:22 AM
Failed building pkg_install Graaf_van_Vlaanderen NetBSD Package System (pkgsrc) 2 18th April 2009 12:26 PM


All times are GMT. The time now is 05:06 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick