Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933595AbXK2VCr (ORCPT ); Thu, 29 Nov 2007 16:02:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761871AbXK2VCj (ORCPT ); Thu, 29 Nov 2007 16:02:39 -0500 Received: from nf-out-0910.google.com ([64.233.182.186]:11236 "EHLO nf-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761089AbXK2VCi (ORCPT ); Thu, 29 Nov 2007 16:02:38 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:from:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-disposition:message-id:content-type:content-transfer-encoding; b=NpcGikivYhO+54Yd2ZbcRiGJJbiIPAEBX3uzJL5B2NbZ+SEbSHH+8rtEWg2yF9x5SdwiXzSikQxEQuwb/edopb5FQ0YQrwW50MOvKW4HgSqjP2HFPOkx4m36CyG5+tLLcBTpCf3SEwIYEuznAg/C/pnbC3lLE33wSyvp5aE9crg= From: Bartlomiej Zolnierkiewicz To: "Kay Sievers" Subject: Re: Relax permissions for reading hard drive serial number? Date: Thu, 29 Nov 2007 22:07:46 +0100 User-Agent: KMail/1.9.6 (enterprise 0.20071012.724442) Cc: "Dan Kegel" , "Xavier Bestel" , Andrey Borzenkov , linux-kernel@vger.kernel.org References: <3ae72650711290939w4fee581fm6f0d65a33abf1b82@mail.gmail.com> In-Reply-To: <3ae72650711290939w4fee581fm6f0d65a33abf1b82@mail.gmail.com> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200711292207.46967.bzolnier@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3091 Lines: 86 On Thursday 29 November 2007, Kay Sievers wrote: > On Nov 29, 2007 4:46 PM, Dan Kegel wrote: > > On Nov 29, 2007 7:37 AM, Xavier Bestel wrote: > > > > One sticking point is that apps like Photoshop and probably > > > > Punkbuster want to retrieve the hard drive's serial number > > > > > > So they can't be installed on a network drive ? > > > > I think Adobe supports that, though perhaps not with the > > retail version. Big companies with network drives are > > probably an important revenue source for them. > > > > I haven't looked closely at what happens when you try installing > > onto network drives. If you are really interested, it's pretty easy to > > try yourself; just run the app under wine with > > WINEDEBUG=+cdrom,+disk and look in the log for calls like > > CreateFile("\\\\.\\PhysicalDrive0", ...). > > There's some chance the code always checks drive 0 instead > > of the drive you're installing onto. > > There are people who, for privacy reasons, really don't like that "unique" > unchangeable serial numbers can be retrieved by untrusted users. > > You should probably chmod the file on the users system, if he is fine with > that, but not change the kernel default. Seconded. While on it, how's about exporting model/firmware/serial through sysfs so /proc/ide/hd*/identify don't have to be used? [PATCH] ide: add /sys/bus/ide/devices/*/{model,firmware,serial} sysfs entries Cc: Dan Kegel Cc: Kay Sievers Cc: Xavier Bestel Cc: Andrey Borzenkov Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) Index: b/drivers/ide/ide.c =================================================================== --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -1670,10 +1670,34 @@ static ssize_t modalias_show(struct devi return sprintf(buf, "ide:m-%s\n", media_string(drive)); } +static ssize_t model_show(struct device *dev, struct device_attribute *attr, + char *buf) +{ + ide_drive_t *drive = to_ide_device(dev); + return sprintf(buf, "%s\n", drive->id->model); +} + +static ssize_t firmware_show(struct device *dev, struct device_attribute *attr, + char *buf) +{ + ide_drive_t *drive = to_ide_device(dev); + return sprintf(buf, "%s\n", drive->id->fw_rev); +} + +static ssize_t serial_show(struct device *dev, struct device_attribute *attr, + char *buf) +{ + ide_drive_t *drive = to_ide_device(dev); + return sprintf(buf, "%s\n", drive->id->serial_no); +} + static struct device_attribute ide_dev_attrs[] = { __ATTR_RO(media), __ATTR_RO(drivename), __ATTR_RO(modalias), + __ATTR_RO(model), + __ATTR_RO(firmware), + __ATTR(serial, 0400, serial_show, NULL), __ATTR_NULL }; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/