Using Solaris pkg to list all setuid or setgid programs
- by darrenm
$ pkg contents -a mode=4??? -a mode=2??? -t file -o pkg.name,path,mode
We can also add a package name on the end to restrict it to just that single package eg:
$ pkg contents -a mode=4??? -a mode=2??? -t file -o pkg.name,path,mode core-os
PKG.NAME PATH MODE
system/core-os usr/bin/amd64/newtask 4555
system/core-os usr/bin/amd64/uptime 4555
system/core-os usr/bin/at 4755
system/core-os usr/bin/atq 4755
system/core-os usr/bin/atrm 4755
system/core-os usr/bin/crontab 4555
system/core-os usr/bin/mail 2511
system/core-os usr/bin/mailx 2511
system/core-os usr/bin/newgrp 4755
system/core-os usr/bin/pfedit 4755
system/core-os usr/bin/su 4555
system/core-os usr/bin/tip 4511
system/core-os usr/bin/write 2555
system/core-os usr/lib/utmp_update 4555
system/core-os usr/sbin/amd64/prtconf 2555
system/core-os usr/sbin/amd64/swap 2555
system/core-os usr/sbin/amd64/sysdef 2555
system/core-os usr/sbin/amd64/whodo 4555
system/core-os usr/sbin/prtdiag 2755
system/core-os usr/sbin/quota 4555
system/core-os usr/sbin/wall 2555