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


Groups > linux.debian.user > #235343

Re: Restoring sticky bits after accidentally moving /usr directory

From s@dondley.com
Newsgroups linux.debian.user
Subject Re: Restoring sticky bits after accidentally moving /usr directory
Date 2021-05-19 02:10 +0200
Message-ID <CghWF-1v4-7@gated-at.bofh.it> (permalink)
References <CghDj-19q-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

>> are not working because the sticky bits for many files /usr/bin/* were lost.
>> For example, I can't send email with exim because of this error:
>> 
>> Failed to create spool file /var/spool/exim4//input//1lj87g-0002tS-5J-D:
>> Permission denied
> 
> I'm guessing you actually mean setuid/setgid bit, not sticky bit.

Sorry yeah. Setuid/gid. 

> 
>> Is there an easy way to ensure I set all the permissions back to where they
>> were before I move /usr?
> 
> 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 "find" and the "sort" are using NULL-separated strings so that
> your filenames can contain newlines. Although I don't expect you
> have any such paths under /usr.
> 
> The perl script will print out a chmod for any differences, it will
> tell you about paths you have which your "good" host does not, and
> it will say nothing about paths that match permissions both sides.
> It doesn't actually do anything, it just prints suggested chmod
> actions. You maybe want to capture the output to a file.

Yes, comparing it to a known good install was something I contemplated but I wasn’t relishing the thought of actually doing it. This will definitely help ease the pain. Thanks!


> 
> If you don't have another working system, well, perhaps you can tell
> us which Debian release this is and someone can provide a list of
> paths and permissions from their machine.
> 
> Good luck!
> 
> Cheers,
> Andy
> 
> -- 
> https://bitfolk.com/ -- No-nonsense VPS hosting
> 

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