Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #235352

Re: Restoring sticky bits after accidentally moving /usr directory

From Greg Wooledge <greg@wooledge.org>
Newsgroups linux.debian.user
Subject Re: Restoring sticky bits after accidentally moving /usr directory
Date 2021-05-19 05:50 +0200
Message-ID <Cglnz-3p9-1@gated-at.bofh.it> (permalink)
References <CggnT-vt-1@gated-at.bofh.it> <CghDj-19q-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, May 18, 2021 at 11:46:38PM +0000, Andy Smith wrote:
> I can't think of an easy way if you don't have backups. If you have
> another system you could get a list of all its permissions like so:
> 
> # find /usr -xdev -printf '%p %m\0' | sort -z > good-perms
> 
> Then on your suspect machine:
> 
> # find /usr -xdev -printf '%p %m\0' | sort -z > suspect-perms
> 
> And then run this perl script:
> 
>     https://gist.github.com/grifferz/1c478ea5eb789b2a1d1a3e49d2a9345c

The serialization format you're using (pathname followed by mode) is
not ideal for parsing.  I'd suggest putting the mode *first*, because it's
in a known, fixed format, and then the pathname second.  Obviously this
would require changing the script that's doing the parsing, as well as
the sort command (e.g. sort -z -k2), but it should be easier that way.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Restoring sticky bits after accidentally moving /usr directory Steve Dondley <s@dondley.com> - 2021-05-19 00:30 +0200
  Re: Restoring sticky bits after accidentally moving /usr directory Andy Smith <andy@strugglers.net> - 2021-05-19 01:50 +0200
    Re: Restoring sticky bits after accidentally moving /usr directory s@dondley.com - 2021-05-19 02:10 +0200
    Re: Restoring sticky bits after accidentally moving /usr directory Greg Wooledge <greg@wooledge.org> - 2021-05-19 05:50 +0200
      Re: Restoring sticky bits after accidentally moving /usr directory Andy Smith <andy@strugglers.net> - 2021-05-19 13:00 +0200
  Re: Restoring sticky bits after accidentally moving /usr directory David <bouncingcats@gmail.com> - 2021-05-19 02:20 +0200
  Re: Restoring sticky bits after accidentally moving /usr directory songbird <songbird@anthive.com> - 2021-05-19 02:30 +0200
    Re: Restoring sticky bits after accidentally moving /usr directory Tixy <tixy@yxit.co.uk> - 2021-05-19 08:50 +0200
      Re: Restoring sticky bits after accidentally moving /usr directory Tixy <tixy@yxit.co.uk> - 2021-05-19 09:00 +0200
  Re: Restoring sticky bits after accidentally moving /usr directory Andrei POPESCU <andreimpopescu@gmail.com> - 2021-05-19 09:30 +0200
  Re: Restoring sticky bits after accidentally moving /usr directory Hans <hans.ullrich@loop.de> - 2021-05-19 12:40 +0200
    Re: Restoring sticky bits after accidentally moving /usr directory Steve Dondley <s@dondley.com> - 2021-05-19 19:20 +0200
      Re: Restoring sticky bits after accidentally moving /usr directory songbird <songbird@anthive.com> - 2021-05-19 20:00 +0200

csiph-web