/etc/security - patch for don't count lost+found in /var/mail

View: New views
2 Messages — Rating Filter:   Alert me  

/etc/security - patch for don't count lost+found in /var/mail

by Bugzilla from leva@ecentrum.hu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

/etc/security complains about the lost+found directory in /var/mail. Here is a
diff to ignore a lost+found named directory in /var/mail:

--- security.orig       Wed Aug 13 00:51:28 2008
+++ security    Sun Nov  1 09:04:48 2009
@@ -434,7 +434,7 @@
 fi

 # Mailboxes should be owned by user and unreadable.
-ls -l /var/mail | sed 1d | \
+ls -l /var/mail | sed 1d | egrep -v '^d.* lost\+found$' \
 awk '$3 != $9 \
  { print "user " $9 " mailbox is owned by " $3 }
      $1 != "-rw-------" \



Daniel

--
LIVAI Daniel
PGP key ID = 0x4AC0A4B1
Key fingerprint = D037 03B9 C12D D338 4412  2D83 1373 917A 4AC0 A4B1


Re: /etc/security - patch for don't count lost+found in /var/mail

by Ingo Schwarze :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Daniel,

> /etc/security complains about the lost+found directory in /var/mail.
> Here is a diff to ignore a lost+found named directory in /var/mail:

Umm, i'm not convinced ignoring debris left over from file system repair
in /var/mail is a sane default.  Being reminded to clean the mess up
doesn't seem that bad on first sight.  Besides, there may be cases where
having a dedicated partition for /var/mail makes sense, but it is so
unusual that complicating the code in /etc/security for special-casing
it seems a bit excessive.

As far as i understand, lost+found is not created when creating a new
file system, but only by fsck_ffs(8) in case it is needed while cleaning
up a dirty file system, i.e. usually after a crash only.  Thus, removing
it after reviewing and cleaning up the contents ought to be safe.

Yours,
  Ingo


LEVAI Daniel wrote on Sun, Nov 01, 2009 at 09:07:58AM +0100:

> --- security.orig       Wed Aug 13 00:51:28 2008
> +++ security    Sun Nov  1 09:04:48 2009
> @@ -434,7 +434,7 @@
>  fi
>
>  # Mailboxes should be owned by user and unreadable.
> -ls -l /var/mail | sed 1d | \
> +ls -l /var/mail | sed 1d | egrep -v '^d.* lost\+found$' \
>  awk '$3 != $9 \
>   { print "user " $9 " mailbox is owned by " $3 }
>       $1 != "-rw-------" \