summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2011-04-10 23:28:49 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2011-04-10 23:28:49 +0000
commite64909ba110d040ab0358cba13ce99930acbc388 (patch)
tree3489764985de732da2ea5d50af85a4ed8e1d3ed7
parentc9cd1d1912597449202f0e007473207271f18388 (diff)
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.
-rw-r--r--libexec/security/security13
1 files changed, 9 insertions, 4 deletions
diff --git a/libexec/security/security b/libexec/security/security
index 5da55462fc5..e6889a44537 100644
--- a/libexec/security/security
+++ b/libexec/security/security
@@ -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) {