1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00

Reviewing my version of the code, Andrew Fresh found an elegant way to

keep the format of the "Block device changes:" output exactly the same
as it was in the past.  As a bonus, this also avoids lies in variable
names, making it more obvious what is actually being compared here.
This commit is contained in:
schwarze 2011-04-10 23:28:48 +00:00
parent 2343b1c662
commit 89927eaeff

View File

@ -1,6 +1,6 @@
#!/usr/bin/perl -T
# $OpenBSD: security,v 1.7 2011/04/09 22:54:40 schwarze Exp $
# $OpenBSD: security,v 1.8 2011/04/10 23:28:48 schwarze Exp $
#
# Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
# Copyright (c) 2011 Andrew Fresh <andrew@afresh1.com>
@ -553,8 +553,9 @@ sub find_special_files {
# Special Files
elsif (!-d _ && !-f _ && !-l _ && !-S _ && !-p _ ) {
$device_files->{$File::Find::name} = $file;
$file->{size} = (($rdev >> 8) & 0xff) . ',' .
(($rdev & 0xff) | (($rdev >> 8) & 0xffff00));
$file->{major} = (($rdev >> 8) & 0xff) . ',';
$file->{minor} = (($rdev >> 8) & 0xffff00) |
($rdev & 0xff);
} else {
return;
}
@ -593,7 +594,11 @@ sub check_filelist {
my ($files, $mode) = @_;
my $current = BACKUP_DIR . "$mode.current";
my $backup = BACKUP_DIR . "$mode.backup";
my @fields = qw(strmode nlink user group size mon day time year);
my @fields = (
qw(strmode nlink user group),
$mode eq 'device' ? qw(major minor) : 'size',
qw(mon day time year)
);
my %current;
if (-s $current) {