struct udev *udev;
struct hd_driveid id;
char model[41];
+ char model_enc[256];
char serial[21];
char revision[9];
const char *node = NULL;
goto close;
}
+ memcpy (model, id.model, 40);
+ model[40] = '\0';
+ udev_util_encode_string(model, model_enc, sizeof(model_enc));
udev_util_replace_whitespace((char *) id.model, model, 40);
udev_util_replace_chars(model, NULL);
udev_util_replace_whitespace((char *) id.serial_no, serial, 20);
printf("ID_TYPE=disk\n");
}
printf("ID_MODEL=%s\n", model);
+ printf("ID_MODEL_ENC=%s\n", model_enc);
printf("ID_SERIAL=%s\n", serial);
printf("ID_REVISION=%s\n", revision);
printf("ID_BUS=ata\n");
static int export;
static char vendor_str[64];
static char model_str[64];
+static char vendor_enc_str[256];
+static char model_enc_str[256];
static char revision_str[16];
static char type_str[16];
if (retval)
return retval;
+ udev_util_encode_string(dev_scsi->vendor, vendor_enc_str, sizeof(vendor_enc_str));
+ udev_util_encode_string(dev_scsi->model, model_enc_str, sizeof(model_enc_str));
+
udev_util_replace_whitespace(dev_scsi->vendor, vendor_str, sizeof(vendor_str));
udev_util_replace_chars(vendor_str, NULL);
udev_util_replace_whitespace(dev_scsi->model, model_str, sizeof(model_str));
char serial_str[MAX_SERIAL_LEN];
printf("ID_VENDOR=%s\n", vendor_str);
+ printf("ID_VENDOR_ENC=%s\n", vendor_enc_str);
printf("ID_MODEL=%s\n", model_str);
+ printf("ID_MODEL_ENC=%s\n", model_enc_str);
printf("ID_REVISION=%s\n", revision_str);
printf("ID_TYPE=%s\n", type_str);
if (dev_scsi.serial[0] != '\0') {
static char vendor_str[64];
static char model_str[64];
+static char model_str_enc[256];
+static char vendor_str_enc[256];
static char serial_str[UTIL_NAME_SIZE];
static char revision_str[64];
static char type_str[64];
udev_device_get_sysname(dev_scsi));
goto fallback;
}
+ udev_util_encode_string(scsi_vendor, vendor_str_enc, sizeof(vendor_str_enc));
udev_util_replace_whitespace(scsi_vendor, vendor_str, sizeof(vendor_str)-1);
udev_util_replace_chars(vendor_str, NULL);
udev_device_get_sysname(dev_scsi));
goto fallback;
}
+ udev_util_encode_string(scsi_model, model_str_enc, sizeof(model_str_enc));
udev_util_replace_whitespace(scsi_model, model_str, sizeof(model_str)-1);
udev_util_replace_chars(model_str, NULL);
info(udev, "No USB vendor information available\n");
return 1;
}
+ udev_util_encode_string(usb_vendor, vendor_str_enc, sizeof(vendor_str_enc));
udev_util_replace_whitespace(usb_vendor, vendor_str, sizeof(vendor_str)-1);
udev_util_replace_chars(vendor_str, NULL);
}
dbg(udev, "No USB model information available\n");
return 1;
}
+ udev_util_encode_string(usb_model, model_str_enc, sizeof(model_str_enc));
udev_util_replace_whitespace(usb_model, model_str, sizeof(model_str)-1);
udev_util_replace_chars(model_str, NULL);
}
if (export) {
printf("ID_VENDOR=%s\n", vendor_str);
+ printf("ID_VENDOR_ENC=%s\n", vendor_str_enc);
printf("ID_MODEL=%s\n", model_str);
+ printf("ID_MODEL_ENC=%s\n", model_str_enc);
printf("ID_REVISION=%s\n", revision_str);
printf("ID_SERIAL=%s\n", serial);
if (serial_str[0] != '\0')