File shadow-bsc1176006-chage-date.patch of Package shadow

Upstream:
4d139ca466820b9a5fe8f75b9a0bee6a922d906a
1175932c0c86ee46ee298fd9cfa01653a2ba3a27
Index: shadow-4.8.1/libmisc/getdate.y
===================================================================
--- shadow-4.8.1.orig/libmisc/getdate.y
+++ shadow-4.8.1/libmisc/getdate.y
@@ -344,7 +344,7 @@ relunit	: tUNUMBER tYEAR_UNIT {
 	    yyRelYear += $1 * $2;
 	}
 	| tYEAR_UNIT {
-	    yyRelYear++;
+	    yyRelYear += $1;
 	}
 	| tUNUMBER tMONTH_UNIT {
 	    yyRelMonth += $1 * $2;
@@ -353,7 +353,7 @@ relunit	: tUNUMBER tYEAR_UNIT {
 	    yyRelMonth += $1 * $2;
 	}
 	| tMONTH_UNIT {
-	    yyRelMonth++;
+	    yyRelMonth += $1;
 	}
 	| tUNUMBER tDAY_UNIT {
 	    yyRelDay += $1 * $2;
@@ -362,7 +362,7 @@ relunit	: tUNUMBER tYEAR_UNIT {
 	    yyRelDay += $1 * $2;
 	}
 	| tDAY_UNIT {
-	    yyRelDay++;
+	    yyRelDay += $1;
 	}
 	| tUNUMBER tHOUR_UNIT {
 	    yyRelHour += $1 * $2;
@@ -371,7 +371,7 @@ relunit	: tUNUMBER tYEAR_UNIT {
 	    yyRelHour += $1 * $2;
 	}
 	| tHOUR_UNIT {
-	    yyRelHour++;
+	    yyRelHour += $1;
 	}
 	| tUNUMBER tMINUTE_UNIT {
 	    yyRelMinutes += $1 * $2;
@@ -380,7 +380,7 @@ relunit	: tUNUMBER tYEAR_UNIT {
 	    yyRelMinutes += $1 * $2;
 	}
 	| tMINUTE_UNIT {
-	    yyRelMinutes++;
+	    yyRelMinutes += $1;
 	}
 	| tUNUMBER tSEC_UNIT {
 	    yyRelSeconds += $1 * $2;
@@ -389,7 +389,7 @@ relunit	: tUNUMBER tYEAR_UNIT {
 	    yyRelSeconds += $1 * $2;
 	}
 	| tSEC_UNIT {
-	    yyRelSeconds++;
+	    yyRelSeconds += $1;
 	}
 	;
 
Index: shadow-4.8.1/libmisc/strtoday.c
===================================================================
--- shadow-4.8.1.orig/libmisc/strtoday.c
+++ shadow-4.8.1/libmisc/strtoday.c
@@ -101,12 +101,12 @@ long strtoday (const char *str)
 		return retdate;
 	}
 
-	t = get_date (str, NULL);
+	t = get_date(str, NULL);
 	if ((time_t) - 1 == t) {
 		return -2;
 	}
 	/* convert seconds to days since 1970-01-01 */
-	return (long) (t + DAY / 2) / DAY;
+	return t / DAY;
 }
 
 #else				/* !USE_GETDATE */
openSUSE Build Service is sponsored by