Revert changed ownership of files under /usr, Void Linux












1














Having lost my mind I did chown -R root:root /usr on a Void Linux system



Would someone be so nice as to mail me the results of ls -lR /usr on a Void system. I'll go over the changes, make everything work again, and post my findings here in this question.



Based on the reply by msp9011, and realizing I need the info for an xfce4, networkmanager system, please post the results from:



find /usr/ (  -perm -4000 )  -exec ls -l {} +


and



find /usr/ ( ! -group root )  -exec ls -l {} +


Could you share the results somewhere ?



P.S. just reinstalling Void is a pain, because I'm on an extended road trip, and my internet access is generally by cellular, or bad wifi.










share|improve this question





























    1














    Having lost my mind I did chown -R root:root /usr on a Void Linux system



    Would someone be so nice as to mail me the results of ls -lR /usr on a Void system. I'll go over the changes, make everything work again, and post my findings here in this question.



    Based on the reply by msp9011, and realizing I need the info for an xfce4, networkmanager system, please post the results from:



    find /usr/ (  -perm -4000 )  -exec ls -l {} +


    and



    find /usr/ ( ! -group root )  -exec ls -l {} +


    Could you share the results somewhere ?



    P.S. just reinstalling Void is a pain, because I'm on an extended road trip, and my internet access is generally by cellular, or bad wifi.










    share|improve this question



























      1












      1








      1


      1





      Having lost my mind I did chown -R root:root /usr on a Void Linux system



      Would someone be so nice as to mail me the results of ls -lR /usr on a Void system. I'll go over the changes, make everything work again, and post my findings here in this question.



      Based on the reply by msp9011, and realizing I need the info for an xfce4, networkmanager system, please post the results from:



      find /usr/ (  -perm -4000 )  -exec ls -l {} +


      and



      find /usr/ ( ! -group root )  -exec ls -l {} +


      Could you share the results somewhere ?



      P.S. just reinstalling Void is a pain, because I'm on an extended road trip, and my internet access is generally by cellular, or bad wifi.










      share|improve this question















      Having lost my mind I did chown -R root:root /usr on a Void Linux system



      Would someone be so nice as to mail me the results of ls -lR /usr on a Void system. I'll go over the changes, make everything work again, and post my findings here in this question.



      Based on the reply by msp9011, and realizing I need the info for an xfce4, networkmanager system, please post the results from:



      find /usr/ (  -perm -4000 )  -exec ls -l {} +


      and



      find /usr/ ( ! -group root )  -exec ls -l {} +


      Could you share the results somewhere ?



      P.S. just reinstalling Void is a pain, because I'm on an extended road trip, and my internet access is generally by cellular, or bad wifi.







      chown void-linux






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 27 '18 at 12:04







      bart van deenen

















      asked Dec 27 '18 at 10:58









      bart van deenenbart van deenen

      64




      64






















          3 Answers
          3






          active

          oldest

          votes


















          1














          hope this is what you require,



          [root@localhost usr]# find /usr/ (  ! -group root )  -exec ls -l {} +
          -rwx--s--x. 1 root slocate 38464 Mar 12 2015 /usr/bin/locate
          -rwxr-sr-x. 1 root nobody 141384 Aug 31 2017 /usr/bin/ssh-agent
          ---s--x---. 1 root stapusr 183072 Jun 19 2018 /usr/bin/staprun
          -r-xr-sr-x. 1 root tty 15224 Jul 24 2015 /usr/bin/wall
          -rwxr-sr-x. 1 root tty 12016 Jan 26 2018 /usr/bin/write
          -rwx--s--x. 1 root utmp 17160 May 9 2018 /usr/lib64/vte/gnome-pty-helper
          -rwx--s--x. 1 root utmp 9808 Aug 18 2010 /usr/libexec/utempter/utempter
          -rwx--s--x. 1 root lock 15808 Aug 19 2010 /usr/sbin/lockdev
          -rwxr-sr-x. 1 root postdrop 189000 Mar 23 2017 /usr/sbin/postdrop
          -rwxr-sr-x. 1 root postdrop 217832 Mar 23 2017 /usr/sbin/postqueue
          -r-s--x---. 1 root apache 13984 Jun 19 2018 /usr/sbin/suexec

          /usr/libexec/utempter:
          total 12
          -rwx--s--x. 1 root utmp 9808 Aug 18 2010 utempter





          share|improve this answer























          • Thanks! I'm running xfce, which includes stuff like dbus and gvfs, and am also running NetworkManager. I managed to get network-manager to run again via this: cd /usr/libexec chgrp dbus dbus-daemon-launch-helper chmod 4754 dbus-daemon-launch-helper So while I appreciate your reply, I'm not out of the woods yet!
            – bart van deenen
            Dec 27 '18 at 11:42





















          1














          You can just reinstall the affected packages using xbps-install -f, it will preserve the configuration files unless you specify -f twice.



           -f, --force
          Force downgrade installation (if package version in repos is less
          than installed version), or reinstallation (if package version in
          repos is the same) to the target PKG, overwriting regular package
          files and symlinks (if they have been modified) but preserving
          configuration files. If -f is specified twice all files will be
          unpacked, even configuration files.


          xbps-pkgdb(1) is able to detect many issues with package files, but sadly not owner/modes at the moment, but that would be a nice feature to add.






          share|improve this answer





















          • Note that this will set the packages to manually installed, which may not be what you want. To correct this, run xbps-pkgdb -m auto [PACKAGE...] for any package which should not be set to manually installed. You can get a list of packages that are currently set to manually installed using xbps-query -m.
            – CameronNemo
            Dec 29 '18 at 4:44





















          0














          I restored the permissions via an Void live usb stick!
          I did a find /usr -printf "0%m %u:%g %pn" > permissions-all to generate a file with all the permissions in /usr.
          Then booting from the borked install I used a simple bash script to restore all permissions.
          The xbps-install -f is problematic if you have very poor connectivity and you want restore large parts of your system like xfce4.
          Thank you all for thinking along and I learned a lot!



          head of /usr/permissions-all



          0755 root:root /usr
          0755 root:root /usr/lib
          0755 root:root /usr/lib/libimobiledevice.so.6.0.0
          0777 root:root /usr/lib/libsoxr.so.0
          0777 root:root /usr/lib/libXvMCr600.so.1.0
          0777 root:root /usr/lib/libwebpmux.so.3
          0755 root:root /usr/lib/audit
          0755 root:root /usr/lib/audit/sotruss-lib.so
          0777 root:root /usr/lib/libfontenc.so.1
          0755 root:root /usr/lib/libvulkan_radeon.so
          0755 root:root /usr/lib/libthunarx-3.so.0.0.0
          0777 root:root /usr/lib/libturbojpeg.so.0


          script restore-permissions.sh



          #!/bin/bash
          set -e
          while read p ug f
          do
          if [ -e "$f" ] ; then
          ug_=$(find "$f" -maxdepth 0 -printf "%u:%g")
          p_=$(find "$f" -maxdepth 0 -printf "0%m")
          if [ "$ug_" != "$ug" ] ; then
          echo "$f wrong ug $ug_ should be $ug, fixing"
          chown $ug "$f"
          fi
          if [ "$p_" != "$p" ] ; then
          echo "$f wrong perms $p_ should be $p, fixing"
          chmod $p "$f"
          fi
          fi
          done < permissions-all


          I've added my permissions-all and the restore-script to a public google-drive folder so anyone that has the same problem can try it. The file is from the most recent void xfce4 live disk.
          Here google-drive is the data.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f491105%2frevert-changed-ownership-of-files-under-usr-void-linux%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            hope this is what you require,



            [root@localhost usr]# find /usr/ (  ! -group root )  -exec ls -l {} +
            -rwx--s--x. 1 root slocate 38464 Mar 12 2015 /usr/bin/locate
            -rwxr-sr-x. 1 root nobody 141384 Aug 31 2017 /usr/bin/ssh-agent
            ---s--x---. 1 root stapusr 183072 Jun 19 2018 /usr/bin/staprun
            -r-xr-sr-x. 1 root tty 15224 Jul 24 2015 /usr/bin/wall
            -rwxr-sr-x. 1 root tty 12016 Jan 26 2018 /usr/bin/write
            -rwx--s--x. 1 root utmp 17160 May 9 2018 /usr/lib64/vte/gnome-pty-helper
            -rwx--s--x. 1 root utmp 9808 Aug 18 2010 /usr/libexec/utempter/utempter
            -rwx--s--x. 1 root lock 15808 Aug 19 2010 /usr/sbin/lockdev
            -rwxr-sr-x. 1 root postdrop 189000 Mar 23 2017 /usr/sbin/postdrop
            -rwxr-sr-x. 1 root postdrop 217832 Mar 23 2017 /usr/sbin/postqueue
            -r-s--x---. 1 root apache 13984 Jun 19 2018 /usr/sbin/suexec

            /usr/libexec/utempter:
            total 12
            -rwx--s--x. 1 root utmp 9808 Aug 18 2010 utempter





            share|improve this answer























            • Thanks! I'm running xfce, which includes stuff like dbus and gvfs, and am also running NetworkManager. I managed to get network-manager to run again via this: cd /usr/libexec chgrp dbus dbus-daemon-launch-helper chmod 4754 dbus-daemon-launch-helper So while I appreciate your reply, I'm not out of the woods yet!
              – bart van deenen
              Dec 27 '18 at 11:42


















            1














            hope this is what you require,



            [root@localhost usr]# find /usr/ (  ! -group root )  -exec ls -l {} +
            -rwx--s--x. 1 root slocate 38464 Mar 12 2015 /usr/bin/locate
            -rwxr-sr-x. 1 root nobody 141384 Aug 31 2017 /usr/bin/ssh-agent
            ---s--x---. 1 root stapusr 183072 Jun 19 2018 /usr/bin/staprun
            -r-xr-sr-x. 1 root tty 15224 Jul 24 2015 /usr/bin/wall
            -rwxr-sr-x. 1 root tty 12016 Jan 26 2018 /usr/bin/write
            -rwx--s--x. 1 root utmp 17160 May 9 2018 /usr/lib64/vte/gnome-pty-helper
            -rwx--s--x. 1 root utmp 9808 Aug 18 2010 /usr/libexec/utempter/utempter
            -rwx--s--x. 1 root lock 15808 Aug 19 2010 /usr/sbin/lockdev
            -rwxr-sr-x. 1 root postdrop 189000 Mar 23 2017 /usr/sbin/postdrop
            -rwxr-sr-x. 1 root postdrop 217832 Mar 23 2017 /usr/sbin/postqueue
            -r-s--x---. 1 root apache 13984 Jun 19 2018 /usr/sbin/suexec

            /usr/libexec/utempter:
            total 12
            -rwx--s--x. 1 root utmp 9808 Aug 18 2010 utempter





            share|improve this answer























            • Thanks! I'm running xfce, which includes stuff like dbus and gvfs, and am also running NetworkManager. I managed to get network-manager to run again via this: cd /usr/libexec chgrp dbus dbus-daemon-launch-helper chmod 4754 dbus-daemon-launch-helper So while I appreciate your reply, I'm not out of the woods yet!
              – bart van deenen
              Dec 27 '18 at 11:42
















            1












            1








            1






            hope this is what you require,



            [root@localhost usr]# find /usr/ (  ! -group root )  -exec ls -l {} +
            -rwx--s--x. 1 root slocate 38464 Mar 12 2015 /usr/bin/locate
            -rwxr-sr-x. 1 root nobody 141384 Aug 31 2017 /usr/bin/ssh-agent
            ---s--x---. 1 root stapusr 183072 Jun 19 2018 /usr/bin/staprun
            -r-xr-sr-x. 1 root tty 15224 Jul 24 2015 /usr/bin/wall
            -rwxr-sr-x. 1 root tty 12016 Jan 26 2018 /usr/bin/write
            -rwx--s--x. 1 root utmp 17160 May 9 2018 /usr/lib64/vte/gnome-pty-helper
            -rwx--s--x. 1 root utmp 9808 Aug 18 2010 /usr/libexec/utempter/utempter
            -rwx--s--x. 1 root lock 15808 Aug 19 2010 /usr/sbin/lockdev
            -rwxr-sr-x. 1 root postdrop 189000 Mar 23 2017 /usr/sbin/postdrop
            -rwxr-sr-x. 1 root postdrop 217832 Mar 23 2017 /usr/sbin/postqueue
            -r-s--x---. 1 root apache 13984 Jun 19 2018 /usr/sbin/suexec

            /usr/libexec/utempter:
            total 12
            -rwx--s--x. 1 root utmp 9808 Aug 18 2010 utempter





            share|improve this answer














            hope this is what you require,



            [root@localhost usr]# find /usr/ (  ! -group root )  -exec ls -l {} +
            -rwx--s--x. 1 root slocate 38464 Mar 12 2015 /usr/bin/locate
            -rwxr-sr-x. 1 root nobody 141384 Aug 31 2017 /usr/bin/ssh-agent
            ---s--x---. 1 root stapusr 183072 Jun 19 2018 /usr/bin/staprun
            -r-xr-sr-x. 1 root tty 15224 Jul 24 2015 /usr/bin/wall
            -rwxr-sr-x. 1 root tty 12016 Jan 26 2018 /usr/bin/write
            -rwx--s--x. 1 root utmp 17160 May 9 2018 /usr/lib64/vte/gnome-pty-helper
            -rwx--s--x. 1 root utmp 9808 Aug 18 2010 /usr/libexec/utempter/utempter
            -rwx--s--x. 1 root lock 15808 Aug 19 2010 /usr/sbin/lockdev
            -rwxr-sr-x. 1 root postdrop 189000 Mar 23 2017 /usr/sbin/postdrop
            -rwxr-sr-x. 1 root postdrop 217832 Mar 23 2017 /usr/sbin/postqueue
            -r-s--x---. 1 root apache 13984 Jun 19 2018 /usr/sbin/suexec

            /usr/libexec/utempter:
            total 12
            -rwx--s--x. 1 root utmp 9808 Aug 18 2010 utempter






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Dec 27 '18 at 11:32

























            answered Dec 27 '18 at 11:24









            msp9011msp9011

            3,82843863




            3,82843863












            • Thanks! I'm running xfce, which includes stuff like dbus and gvfs, and am also running NetworkManager. I managed to get network-manager to run again via this: cd /usr/libexec chgrp dbus dbus-daemon-launch-helper chmod 4754 dbus-daemon-launch-helper So while I appreciate your reply, I'm not out of the woods yet!
              – bart van deenen
              Dec 27 '18 at 11:42




















            • Thanks! I'm running xfce, which includes stuff like dbus and gvfs, and am also running NetworkManager. I managed to get network-manager to run again via this: cd /usr/libexec chgrp dbus dbus-daemon-launch-helper chmod 4754 dbus-daemon-launch-helper So while I appreciate your reply, I'm not out of the woods yet!
              – bart van deenen
              Dec 27 '18 at 11:42


















            Thanks! I'm running xfce, which includes stuff like dbus and gvfs, and am also running NetworkManager. I managed to get network-manager to run again via this: cd /usr/libexec chgrp dbus dbus-daemon-launch-helper chmod 4754 dbus-daemon-launch-helper So while I appreciate your reply, I'm not out of the woods yet!
            – bart van deenen
            Dec 27 '18 at 11:42






            Thanks! I'm running xfce, which includes stuff like dbus and gvfs, and am also running NetworkManager. I managed to get network-manager to run again via this: cd /usr/libexec chgrp dbus dbus-daemon-launch-helper chmod 4754 dbus-daemon-launch-helper So while I appreciate your reply, I'm not out of the woods yet!
            – bart van deenen
            Dec 27 '18 at 11:42















            1














            You can just reinstall the affected packages using xbps-install -f, it will preserve the configuration files unless you specify -f twice.



             -f, --force
            Force downgrade installation (if package version in repos is less
            than installed version), or reinstallation (if package version in
            repos is the same) to the target PKG, overwriting regular package
            files and symlinks (if they have been modified) but preserving
            configuration files. If -f is specified twice all files will be
            unpacked, even configuration files.


            xbps-pkgdb(1) is able to detect many issues with package files, but sadly not owner/modes at the moment, but that would be a nice feature to add.






            share|improve this answer





















            • Note that this will set the packages to manually installed, which may not be what you want. To correct this, run xbps-pkgdb -m auto [PACKAGE...] for any package which should not be set to manually installed. You can get a list of packages that are currently set to manually installed using xbps-query -m.
              – CameronNemo
              Dec 29 '18 at 4:44


















            1














            You can just reinstall the affected packages using xbps-install -f, it will preserve the configuration files unless you specify -f twice.



             -f, --force
            Force downgrade installation (if package version in repos is less
            than installed version), or reinstallation (if package version in
            repos is the same) to the target PKG, overwriting regular package
            files and symlinks (if they have been modified) but preserving
            configuration files. If -f is specified twice all files will be
            unpacked, even configuration files.


            xbps-pkgdb(1) is able to detect many issues with package files, but sadly not owner/modes at the moment, but that would be a nice feature to add.






            share|improve this answer





















            • Note that this will set the packages to manually installed, which may not be what you want. To correct this, run xbps-pkgdb -m auto [PACKAGE...] for any package which should not be set to manually installed. You can get a list of packages that are currently set to manually installed using xbps-query -m.
              – CameronNemo
              Dec 29 '18 at 4:44
















            1












            1








            1






            You can just reinstall the affected packages using xbps-install -f, it will preserve the configuration files unless you specify -f twice.



             -f, --force
            Force downgrade installation (if package version in repos is less
            than installed version), or reinstallation (if package version in
            repos is the same) to the target PKG, overwriting regular package
            files and symlinks (if they have been modified) but preserving
            configuration files. If -f is specified twice all files will be
            unpacked, even configuration files.


            xbps-pkgdb(1) is able to detect many issues with package files, but sadly not owner/modes at the moment, but that would be a nice feature to add.






            share|improve this answer












            You can just reinstall the affected packages using xbps-install -f, it will preserve the configuration files unless you specify -f twice.



             -f, --force
            Force downgrade installation (if package version in repos is less
            than installed version), or reinstallation (if package version in
            repos is the same) to the target PKG, overwriting regular package
            files and symlinks (if they have been modified) but preserving
            configuration files. If -f is specified twice all files will be
            unpacked, even configuration files.


            xbps-pkgdb(1) is able to detect many issues with package files, but sadly not owner/modes at the moment, but that would be a nice feature to add.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Dec 28 '18 at 23:31









            DuncaenDuncaen

            112




            112












            • Note that this will set the packages to manually installed, which may not be what you want. To correct this, run xbps-pkgdb -m auto [PACKAGE...] for any package which should not be set to manually installed. You can get a list of packages that are currently set to manually installed using xbps-query -m.
              – CameronNemo
              Dec 29 '18 at 4:44




















            • Note that this will set the packages to manually installed, which may not be what you want. To correct this, run xbps-pkgdb -m auto [PACKAGE...] for any package which should not be set to manually installed. You can get a list of packages that are currently set to manually installed using xbps-query -m.
              – CameronNemo
              Dec 29 '18 at 4:44


















            Note that this will set the packages to manually installed, which may not be what you want. To correct this, run xbps-pkgdb -m auto [PACKAGE...] for any package which should not be set to manually installed. You can get a list of packages that are currently set to manually installed using xbps-query -m.
            – CameronNemo
            Dec 29 '18 at 4:44






            Note that this will set the packages to manually installed, which may not be what you want. To correct this, run xbps-pkgdb -m auto [PACKAGE...] for any package which should not be set to manually installed. You can get a list of packages that are currently set to manually installed using xbps-query -m.
            – CameronNemo
            Dec 29 '18 at 4:44













            0














            I restored the permissions via an Void live usb stick!
            I did a find /usr -printf "0%m %u:%g %pn" > permissions-all to generate a file with all the permissions in /usr.
            Then booting from the borked install I used a simple bash script to restore all permissions.
            The xbps-install -f is problematic if you have very poor connectivity and you want restore large parts of your system like xfce4.
            Thank you all for thinking along and I learned a lot!



            head of /usr/permissions-all



            0755 root:root /usr
            0755 root:root /usr/lib
            0755 root:root /usr/lib/libimobiledevice.so.6.0.0
            0777 root:root /usr/lib/libsoxr.so.0
            0777 root:root /usr/lib/libXvMCr600.so.1.0
            0777 root:root /usr/lib/libwebpmux.so.3
            0755 root:root /usr/lib/audit
            0755 root:root /usr/lib/audit/sotruss-lib.so
            0777 root:root /usr/lib/libfontenc.so.1
            0755 root:root /usr/lib/libvulkan_radeon.so
            0755 root:root /usr/lib/libthunarx-3.so.0.0.0
            0777 root:root /usr/lib/libturbojpeg.so.0


            script restore-permissions.sh



            #!/bin/bash
            set -e
            while read p ug f
            do
            if [ -e "$f" ] ; then
            ug_=$(find "$f" -maxdepth 0 -printf "%u:%g")
            p_=$(find "$f" -maxdepth 0 -printf "0%m")
            if [ "$ug_" != "$ug" ] ; then
            echo "$f wrong ug $ug_ should be $ug, fixing"
            chown $ug "$f"
            fi
            if [ "$p_" != "$p" ] ; then
            echo "$f wrong perms $p_ should be $p, fixing"
            chmod $p "$f"
            fi
            fi
            done < permissions-all


            I've added my permissions-all and the restore-script to a public google-drive folder so anyone that has the same problem can try it. The file is from the most recent void xfce4 live disk.
            Here google-drive is the data.






            share|improve this answer




























              0














              I restored the permissions via an Void live usb stick!
              I did a find /usr -printf "0%m %u:%g %pn" > permissions-all to generate a file with all the permissions in /usr.
              Then booting from the borked install I used a simple bash script to restore all permissions.
              The xbps-install -f is problematic if you have very poor connectivity and you want restore large parts of your system like xfce4.
              Thank you all for thinking along and I learned a lot!



              head of /usr/permissions-all



              0755 root:root /usr
              0755 root:root /usr/lib
              0755 root:root /usr/lib/libimobiledevice.so.6.0.0
              0777 root:root /usr/lib/libsoxr.so.0
              0777 root:root /usr/lib/libXvMCr600.so.1.0
              0777 root:root /usr/lib/libwebpmux.so.3
              0755 root:root /usr/lib/audit
              0755 root:root /usr/lib/audit/sotruss-lib.so
              0777 root:root /usr/lib/libfontenc.so.1
              0755 root:root /usr/lib/libvulkan_radeon.so
              0755 root:root /usr/lib/libthunarx-3.so.0.0.0
              0777 root:root /usr/lib/libturbojpeg.so.0


              script restore-permissions.sh



              #!/bin/bash
              set -e
              while read p ug f
              do
              if [ -e "$f" ] ; then
              ug_=$(find "$f" -maxdepth 0 -printf "%u:%g")
              p_=$(find "$f" -maxdepth 0 -printf "0%m")
              if [ "$ug_" != "$ug" ] ; then
              echo "$f wrong ug $ug_ should be $ug, fixing"
              chown $ug "$f"
              fi
              if [ "$p_" != "$p" ] ; then
              echo "$f wrong perms $p_ should be $p, fixing"
              chmod $p "$f"
              fi
              fi
              done < permissions-all


              I've added my permissions-all and the restore-script to a public google-drive folder so anyone that has the same problem can try it. The file is from the most recent void xfce4 live disk.
              Here google-drive is the data.






              share|improve this answer


























                0












                0








                0






                I restored the permissions via an Void live usb stick!
                I did a find /usr -printf "0%m %u:%g %pn" > permissions-all to generate a file with all the permissions in /usr.
                Then booting from the borked install I used a simple bash script to restore all permissions.
                The xbps-install -f is problematic if you have very poor connectivity and you want restore large parts of your system like xfce4.
                Thank you all for thinking along and I learned a lot!



                head of /usr/permissions-all



                0755 root:root /usr
                0755 root:root /usr/lib
                0755 root:root /usr/lib/libimobiledevice.so.6.0.0
                0777 root:root /usr/lib/libsoxr.so.0
                0777 root:root /usr/lib/libXvMCr600.so.1.0
                0777 root:root /usr/lib/libwebpmux.so.3
                0755 root:root /usr/lib/audit
                0755 root:root /usr/lib/audit/sotruss-lib.so
                0777 root:root /usr/lib/libfontenc.so.1
                0755 root:root /usr/lib/libvulkan_radeon.so
                0755 root:root /usr/lib/libthunarx-3.so.0.0.0
                0777 root:root /usr/lib/libturbojpeg.so.0


                script restore-permissions.sh



                #!/bin/bash
                set -e
                while read p ug f
                do
                if [ -e "$f" ] ; then
                ug_=$(find "$f" -maxdepth 0 -printf "%u:%g")
                p_=$(find "$f" -maxdepth 0 -printf "0%m")
                if [ "$ug_" != "$ug" ] ; then
                echo "$f wrong ug $ug_ should be $ug, fixing"
                chown $ug "$f"
                fi
                if [ "$p_" != "$p" ] ; then
                echo "$f wrong perms $p_ should be $p, fixing"
                chmod $p "$f"
                fi
                fi
                done < permissions-all


                I've added my permissions-all and the restore-script to a public google-drive folder so anyone that has the same problem can try it. The file is from the most recent void xfce4 live disk.
                Here google-drive is the data.






                share|improve this answer














                I restored the permissions via an Void live usb stick!
                I did a find /usr -printf "0%m %u:%g %pn" > permissions-all to generate a file with all the permissions in /usr.
                Then booting from the borked install I used a simple bash script to restore all permissions.
                The xbps-install -f is problematic if you have very poor connectivity and you want restore large parts of your system like xfce4.
                Thank you all for thinking along and I learned a lot!



                head of /usr/permissions-all



                0755 root:root /usr
                0755 root:root /usr/lib
                0755 root:root /usr/lib/libimobiledevice.so.6.0.0
                0777 root:root /usr/lib/libsoxr.so.0
                0777 root:root /usr/lib/libXvMCr600.so.1.0
                0777 root:root /usr/lib/libwebpmux.so.3
                0755 root:root /usr/lib/audit
                0755 root:root /usr/lib/audit/sotruss-lib.so
                0777 root:root /usr/lib/libfontenc.so.1
                0755 root:root /usr/lib/libvulkan_radeon.so
                0755 root:root /usr/lib/libthunarx-3.so.0.0.0
                0777 root:root /usr/lib/libturbojpeg.so.0


                script restore-permissions.sh



                #!/bin/bash
                set -e
                while read p ug f
                do
                if [ -e "$f" ] ; then
                ug_=$(find "$f" -maxdepth 0 -printf "%u:%g")
                p_=$(find "$f" -maxdepth 0 -printf "0%m")
                if [ "$ug_" != "$ug" ] ; then
                echo "$f wrong ug $ug_ should be $ug, fixing"
                chown $ug "$f"
                fi
                if [ "$p_" != "$p" ] ; then
                echo "$f wrong perms $p_ should be $p, fixing"
                chmod $p "$f"
                fi
                fi
                done < permissions-all


                I've added my permissions-all and the restore-script to a public google-drive folder so anyone that has the same problem can try it. The file is from the most recent void xfce4 live disk.
                Here google-drive is the data.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Dec 29 '18 at 15:58

























                answered Dec 29 '18 at 14:50









                bart van deenenbart van deenen

                64




                64






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f491105%2frevert-changed-ownership-of-files-under-usr-void-linux%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    List directoties down one level, excluding some named directories and files

                    list processes belonging to a network namespace

                    list systemd RuntimeDirectory mounts