Branch: r14.0.x

f66944e5 2016-09-08 12:33:51 Timothy Pearson
Properly classify Lenovo USB camera platform subdevices

(cherry picked from commit b18bff9ad82dd217efa1adefb3ab8308b0344c49)
M tdecore/tdehw/tdehardwaredevices.cpp
diff --git a/tdecore/tdehw/tdehardwaredevices.cpp b/tdecore/tdehw/tdehardwaredevices.cpp
index 6d3b2ed..b0706a2 100644
--- a/tdecore/tdehw/tdehardwaredevices.cpp
+++ b/tdecore/tdehw/tdehardwaredevices.cpp
@@ -2292,6 +2292,11 @@
 			}
 		}
 
+		if ((devicesubsystem == "usb")
+			&& (devicedriver == "uvcvideo")) {
+			if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::Platform);
+		}
+
 		// Last ditch attempt at classification
 		// Likely inaccurate and sweeping
 		if ((devicesubsystem == "usb")
dc7e40a1 2016-09-08 12:34:08 Timothy Pearson
Probe partitions to get filesystem type
This fixes problems with LUKS partitions not being detected

(cherry picked from commit 30c008d5512bf83039d2e24d2e737303f68a42af)
M tdecore/tdehw/tdehardwaredevices.cpp
diff --git a/tdecore/tdehw/tdehardwaredevices.cpp b/tdecore/tdehw/tdehardwaredevices.cpp
index b0706a2..222bf41 100644
--- a/tdecore/tdehw/tdehardwaredevices.cpp
+++ b/tdecore/tdehw/tdehardwaredevices.cpp
@@ -2553,13 +2553,11 @@
 				parentsyspath.truncate(parentsyspath.findRev("/"));
 				parentdisk = static_cast<TDEStorageDevice*>(findBySystemPath(parentsyspath));
 			}
+			disktype = classifyDiskType(dev, devicenode, devicebus, devicetypestring, systempath, devicevendor, devicemodel, filesystemtype, devicedriver);
 			if (parentdisk) {
 				// Set partition disk type and status based on the parent device
-				disktype = parentdisk->diskType();
+				disktype = disktype | parentdisk->diskType();
 				diskstatus = diskstatus | parentdisk->diskStatus();
-			}
-			else {
-				disktype = classifyDiskType(dev, devicenode, devicebus, devicetypestring, systempath, devicevendor, devicemodel, filesystemtype, devicedriver);
 			}
 			sdevice->internalSetDiskType(disktype);
 			device = classifyUnknownDeviceByExternalRules(dev, device, true);	// Check external rules for possible subtype overrides
515aec93 2016-09-08 12:34:30 Timothy Pearson
Parse GENERALIZEDTIME ASN structures

This fixes certificate dates beyond year 2049.

(cherry picked from commit 07dbb3b5c92ed22f71123eb84806d55f9962c60b)
M tdeio/kssl/ksslutils.cc
diff --git a/tdeio/kssl/ksslutils.cc b/tdeio/kssl/ksslutils.cc
index 444e5dd..2e4a95d 100644
--- a/tdeio/kssl/ksslutils.cc
+++ b/tdeio/kssl/ksslutils.cc
@@ -35,6 +35,9 @@
 TQDateTime qdt;
 char *v;
 int gmt=0;
+int gentime=0;
+int yoffset=0;
+int yearbase=1900;
 int i;
 int y=0,M=0,d=0,h=0,m=0,s=0;
 TQDate qdate;
@@ -42,24 +45,30 @@
  
   i = tm->length;
   v = (char *)tm->data;
- 
+  if ((i == 15) || (i == 21)) {
+          gentime=1;
+          yoffset=2;
+          yearbase=0;
+  }
   if (i < 10) goto auq_err;
   if (v[i-1] == 'Z') gmt=1;
-  for (i=0; i<10; i++)
+  for (i=0; i<10+yoffset; i++)
           if ((v[i] > '9') || (v[i] < '0')) goto auq_err;
-  y = (v[0]-'0')*10+(v[1]-'0');
+  y = (v[0+yoffset]-'0')*10+(v[1+yoffset]-'0');
+  if (gentime)
+          y += (v[0]-'0')*1000+(v[1]-'0')*100;
   if (y < 50) y+=100;
-  M = (v[2]-'0')*10+(v[3]-'0');
+  M = (v[2+yoffset]-'0')*10+(v[3+yoffset]-'0');
   if ((M > 12) || (M < 1)) goto auq_err;
-  d = (v[4]-'0')*10+(v[5]-'0');
-  h = (v[6]-'0')*10+(v[7]-'0');
-  m =  (v[8]-'0')*10+(v[9]-'0');
-  if (    (v[10] >= '0') && (v[10] <= '9') &&
-          (v[11] >= '0') && (v[11] <= '9'))
-          s = (v[10]-'0')*10+(v[11]-'0');
- 
+  d = (v[4+yoffset]-'0')*10+(v[5+yoffset]-'0');
+  h = (v[6+yoffset]-'0')*10+(v[7+yoffset]-'0');
+  m =  (v[8+yoffset]-'0')*10+(v[9+yoffset]-'0');
+  if (    (v[10+yoffset] >= '0') && (v[10+yoffset] <= '9') &&
+          (v[11+yoffset] >= '0') && (v[11+yoffset] <= '9'))
+          s = (v[10+yoffset]-'0')*10+(v[11+yoffset]-'0');
+
   // localize the date and display it.
-  qdate.setYMD(y+1900, M, d);
+  qdate.setYMD(y+yearbase, M, d);
   qtime.setHMS(h,m,s);
   qdt.setDate(qdate); qdt.setTime(qtime);
   auq_err: