Navigation

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

    File permissons

    Development
    2
    6
    1143
    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.
    • ?
      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
      • jimp
        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
        • ?
          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
          • jimp
            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
            • ?
              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
              • jimp
                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