Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    File permissons

    Scheduled Pinned Locked Moved Development
    6 Posts 2 Posters 1.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ? This user is from outside of this forum
      Guest
      last edited by

      Hi
      I want to know how file permission are determined after installation, for example rc.initial have -rwxr-xr-x.
      How can i change some permissions in my custom installation  iso?

      1 Reply Last reply Reply Quote 0
      • jimpJ Offline
        jimp Rebel Alliance Developer Netgate
        last edited by

        On 2.1 there is an mtree file/database that is used to set/check permissions on install and upgrade. Grep through the source for mtree and you'll find the code.

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          Dear Jim,
          there are many 'mtree'  word in /usr/pfSensesrc directory . in /usr/pfSensesrc/src/etc/mtree , bsd files exist. Can you be more specific?

          1 Reply Last reply Reply Quote 0
          • jimpJ Offline
            jimp Rebel Alliance Developer Netgate
            last edited by

            In the pfSense git repos, not the FreeBSD source/builder filesystem.

            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

            1 Reply Last reply Reply Quote 0
            • ? This user is from outside of this forum
              Guest
              last edited by

              I found only these things in pfsensegitrepo:

              etc\rc.firmware(62): /usr/sbin/mtree -Pcp /${files} | bzip2 -9 > /tmp/chflags.dist.${files}.bz2 2>> /conf/upgrade_log.txt 
              etc\rc.firmware(69): cd / && /usr/bin/bzcat /tmp/chflags.dist.${files}.bz2 | /usr/sbin/mtree -PU -p /${files} >> /conf/upgrade_log.txt 2>&1
              tmp\post_upgrade_command(119): MTREECHKDIR=/tmp/${1}/
              tmp\post_upgrade_command(121): MTREECHKDIR=/
              tmp\post_upgrade_command(123): if [ -f ${MTREECHKDIR}etc/installed_filesystem.mtree ]; then
              tmp\post_upgrade_command(124): /usr/sbin/mtree -U -e -q -f ${MTREECHKDIR}etc/installed_filesystem.mtree -p ${MTREECHKDIR} > /conf/mtree.log;
              
              1 Reply Last reply Reply Quote 0
              • jimpJ Offline
                jimp Rebel Alliance Developer Netgate
                last edited by

                Yep, and now you can see where the .mtree file is and how it sets the permissions (the last line)

                Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                Need help fast? Netgate Global Support!

                Do not Chat/PM for help!

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.