From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: "Kay Sievers" <kay.sievers@vrfy.org>
Cc: "Dan Kegel" <dank@kegel.com>,
"Xavier Bestel" <xavier.bestel@free.fr>,
Andrey Borzenkov <arvidjaar@mail.ru>,
linux-kernel@vger.kernel.org
Subject: Re: Relax permissions for reading hard drive serial number?
Date: Thu, 29 Nov 2007 22:07:46 +0100 [thread overview]
Message-ID: <200711292207.46967.bzolnier@gmail.com> (raw)
In-Reply-To: <3ae72650711290939w4fee581fm6f0d65a33abf1b82@mail.gmail.com>
On Thursday 29 November 2007, Kay Sievers wrote:
> On Nov 29, 2007 4:46 PM, Dan Kegel <dank@kegel.com> wrote:
> > On Nov 29, 2007 7:37 AM, Xavier Bestel <xavier.bestel@free.fr> 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 <dank@kegel.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Xavier Bestel <xavier.bestel@free.fr>
Cc: Andrey Borzenkov <arvidjaar@mail.ru>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
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
};
next prev parent reply other threads:[~2007-11-29 21:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-29 15:13 Relax permissions for reading hard drive serial number? Dan Kegel
2007-11-29 15:37 ` Xavier Bestel
2007-11-29 15:46 ` Dan Kegel
2007-11-29 17:39 ` Kay Sievers
2007-11-29 21:07 ` Bartlomiej Zolnierkiewicz [this message]
2007-12-02 16:43 ` Matti Aarnio
2007-12-02 18:45 ` Matti Aarnio
2007-12-04 12:06 ` Kyle Moffett
2007-12-02 14:15 ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200711292207.46967.bzolnier@gmail.com \
--to=bzolnier@gmail.com \
--cc=arvidjaar@mail.ru \
--cc=dank@kegel.com \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xavier.bestel@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox