Browse Source

Private Sony Vaio data might not be readable by non-root users.

git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@5026 7894878c-1315-0410-8ee3-d5d059ff63e0
tags/v3.0.1
Jean Delvare 18 years ago
parent
commit
670d3a6d92
  1. 1
      CHANGES
  2. 22
      eeprom/decode-vaio.pl

1
CHANGES

@ -4,6 +4,7 @@ i2c-tools CHANGES
SVN
decode-dimms: Fix DDR2 SDRAM module speed decoding
Update manufacturer IDs.
decode-vaio: Private data might not be readable by non-root users
i2cset: Final status messages go to stdout
Return success even when readback fails or doesn't match
i2c-stub-from-dump: New helper script to use with i2c-stub

22
eeprom/decode-vaio.pl

@ -1,6 +1,6 @@
#!/usr/bin/perl -w
#
# Copyright (C) 2002-2006 Jean Delvare <khali@linux-fr.org>
# Copyright (C) 2002-2007 Jean Delvare <khali@linux-fr.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -43,6 +43,8 @@
# Revision might be a Service Tag.
# Version 1.4 2006-09-20 Jean Delvare <khali@linux-fr.org>
# Detect and skip false positives (e.g. EDID EEPROMs).
# Version 1.5 2007-11-19 Jean Delvare <khali@linux-fr.org>
# UUID and serial number might be hidden
#
# EEPROM data decoding for Sony Vaio laptops.
#
@ -81,6 +83,8 @@ use strict;
use Fcntl qw(:DEFAULT :seek);
use vars qw($sysfs $found);
use constant ONLYROOT => "Readable only by root";
sub print_item
{
my ($label,$value) = @_;
@ -175,7 +179,14 @@ sub decode_uuid
}
}
return($string);
if ($string eq '00000000-0000-0000-0000-000000000000')
{
return(ONLYROOT);
}
else
{
return($string);
}
}
sub vaio_decode
@ -187,7 +198,8 @@ sub vaio_decode
return 0 unless $name =~ m/^[A-Z-]{4}/;
print_item('Machine Name', $name);
print_item('Serial Number', decode_string($bus, $addr, 192, 32));
my $serial = decode_string($bus, $addr, 192, 32);
print_item('Serial Number', $serial ? $serial : ONLYROOT);
print_item('UUID', decode_uuid($bus, $addr, 16));
my $revision = decode_string($bus, $addr, 160, 10);
print_item(length($revision) > 2 ? 'Service Tag' : 'Revision',
@ -201,8 +213,8 @@ sub vaio_decode
BEGIN
{
print("Sony Vaio EEPROM Decoder\n");
print("Copyright (C) 2002-2006 Jean Delvare\n");
print("Version 1.4\n\n");
print("Copyright (C) 2002-2007 Jean Delvare\n");
print("Version 1.5\n\n");
}
END

Loading…
Cancel
Save