Hide Sony Vaio serial number and UUID to regular users. This is a backport

from Linux 2.6.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5019 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2007-11-16 08:48:06 +00:00
1 parent 2ae24a97ed
commit 7294b74b97
2 files changed
+9 -4

No files matched your search

+1
View File
@@ -4,6 +4,7 @@ lm_sensors CHANGES file
SVN-HEAD
Library: Fix fschrc and fschmd support
Makefile: Revert changeset 4738, fix bug #2187 differently
Module eeprom: Hide Sony Vaio serial numbers to regular users (2.6 backport)
Program decode-dimms.pl: Fix DDR2 SDRAM module speed decoding
Update manufacturer IDs.
Program sensors: Hide spurious errors on missing f71872f voltage inputs
+8 -4
View File
@@ -207,7 +207,7 @@ static int eeprom_detect(struct i2c_adapter *adapter, int address,
&& i2c_smbus_read_byte(new_client) == 'G'
&& i2c_smbus_read_byte(new_client) == '-') {
printk(KERN_INFO "Vaio EEPROM detected, "
"enabling password protection\n");
"enabling privacy protection\n");
data->nature = NATURE_VAIO;
}
}
@@ -308,9 +308,13 @@ void eeprom_contents(struct i2c_client *client, int operation,
*nrels_mag = 0;
else if (operation == SENSORS_PROC_REAL_READ) {
eeprom_update_client(client, nr >> 1);
/* Hide Vaio security settings to regular users */
if (nr == 0 && data->nature == NATURE_VAIO
&& !capable(CAP_SYS_ADMIN))
/* Hide Vaio private settings to regular users:
- BIOS passwords: bytes 0x00 to 0x0f (row 0)
- UUID: bytes 0x10 to 0x1f (row 1)
- Serial number: 0xc0 to 0xdf (rows 12 and 13) */
if (data->nature == NATURE_VAIO
&& !capable(CAP_SYS_ADMIN)
&& (nr == 0 || nr == 1 || nr == 12 || nr == 13))
for (i = 0; i < 16; i++)
results[i] = 0;
else