Automounters may need information like this to e.g. allow unprivileged
applications to mount filesystems from a CF card but not from
other ATA devices. See https://bugzilla.redhat.com/show_bug.cgi?id=734191
Signed-off-by: David Zeuthen <davidz@redhat.com>
struct udev *udev;
struct hd_driveid id;
uint8_t identify[512];
struct udev *udev;
struct hd_driveid id;
uint8_t identify[512];
+ uint16_t *identify_words;
char model[41];
char model_enc[256];
char serial[21];
char model[41];
char model_enc[256];
char serial[21];
+ identify_words = (uint16_t *) identify;
memcpy (model, id.model, 40);
model[40] = '\0';
memcpy (model, id.model, 40);
model[40] = '\0';
/* ATA devices have no vendor extension */
printf("ID_WWN_WITH_EXTENSION=0x%llx\n", (unsigned long long int) wwwn);
}
/* ATA devices have no vendor extension */
printf("ID_WWN_WITH_EXTENSION=0x%llx\n", (unsigned long long int) wwwn);
}
+
+ /* from Linux's include/linux/ata.h */
+ if (identify_words[0] == 0x848a || identify_words[0] == 0x844a) {
+ printf("ID_ATA_CFA=1\n");
+ } else {
+ if ((identify_words[83] & 0xc004) == 0x4004) {
+ printf("ID_ATA_CFA=1\n");
+ }
+ }
} else {
if (serial[0] != '\0')
printf("%s_%s\n", model, serial);
} else {
if (serial[0] != '\0')
printf("%s_%s\n", model, serial);