Submitted 15-May-00 by Chmouel Boudjnah:
| Jason Brown <[EMAIL PROTECTED]> writes:
| 
| > The Device3dfx also needs to create a /dev/3dfx device.  That needs to be
| > added to the rpm.
| 
| can someone give the major/minor number of the device and i add it to
| dev package.
| 

Besides, the package already does create one, just not as an "officially
owned" file.  Perhaps mknod in the %install and then add to %files?

Also, potential security hole in %postun.  What if some disgruntled does
ln -s /etc/passwd /etc/conf.modules.tmp

Yes, such an exploit would require root access to set up, but. . .


[anton@bladehawke anton]$ rpm -q Device3Dfx && rpm -q --scripts Device3Dfx
Device3Dfx-2.3.4-7mdk
preinstall script (through /bin/sh):
groupadd tdfx >& /dev/null
postinstall script (through /bin/sh):
if [ "$1" = 1 ]; then
        if [ ! -c /dev/3dfx ]; then
            mknod /dev/3dfx c 107 0
            chown root.tdfx /dev/3dfx
            chmod 660 /dev/3dfx
    fi
        
    if [[ -f /etc/conf.modules ]]; then
          if ! grep     -q 3dfx /etc/conf.modules; then
                echo alias char-major-107 3dfx >> /etc/conf.modules
          fi
    fi

    if [[ -f  /etc/modules.conf ]]; then
          if ! grep -q 3dfx /etc/modules.conf; then
                echo alias char-major-107 3dfx >> /etc/modules.conf
          fi
    fi
fi
if [ "$DURING_INSTALL" = "" ]; then
    /sbin/depmod -a > /dev/null
fi
postuninstall script (through /bin/sh):
if [ "$1" = 0 ]; then
        if [[ -f /etc/conf.modules ]]; then
            grep -v 3dfx /etc/conf.modules > /etc/conf.modules.tmp
            mv /etc/conf.modules.tmp /etc/conf.modules
        fi
                
        if [[ -f /etc/modules.conf ]]; then
            grep -v     3dfx/etc/modules.conf > /etc/modules.conf.tmp
            mv /etc/modules.conf.tmp /etc/modules.conf
        fi
                
        if [ -c /dev/3dfx ]; then
            rm -f /dev/3dfx
        fi
                
        # Delete the 3dfx group.
        groupdel tdfx >& /dev/null
fi

/sbin/depmod -a > /dev/null
verify script:
inconf=`grep 'alias char-major-107 3dfx' /etc/conf.modules`
if [ "x$inconf" = "x" ]; then
        echo "3dfx entry not included in /etc/conf.modules"                            
                                                                                       
                                                  >                                    
                             >>         fi
fi
#%files -f modules-file-list
#%attr (-,root,tdfx) /dev/3dfx
        
-- 
       _
     _|_|_
      ( )   *    Anton Graham
      /v\  /     <[EMAIL PROTECTED]>
    /(   )X
     (m_m)       GPG ID: 18F78541
Penguin Powered!

Reply via email to