/* Template for the name field of an 'x' type header */
static char *exthdr_name;
+static char *exthdr_mtime_option;
+static time_t exthdr_mtime;
+
/* Template for the name field of a 'g' type header */
static char *globexthdr_name;
+static char *globexthdr_mtime_option;
+static time_t globexthdr_mtime;
+
bool
xheader_keyword_deleted_p (const char *kw)
{
USAGE_ERROR ((0, 0, _("Keyword %s is unknown or not yet implemented"), kw));
}
+static void
+assign_time_option (char **sval, time_t *tval, const char *input)
+{
+ uintmax_t u;
+ char *p;
+ time_t t = u = strtoumax (input, &p, 10);
+ if (t != u || *p || errno == ERANGE)
+ ERROR ((0, 0, _("Time stamp is out of allowed range")));
+ else
+ {
+ *tval = t;
+ assign_string (sval, input);
+ }
+}
+
static void
xheader_set_keyword_equal (char *kw, char *eq)
{
assign_string (&exthdr_name, p);
else if (strcmp (kw, "globexthdr.name") == 0)
assign_string (&globexthdr_name, p);
+ else if (strcmp (kw, "exthdr.mtime") == 0)
+ assign_time_option (&exthdr_mtime_option, &exthdr_mtime, p);
+ else if (strcmp (kw, "globexthdr.mtime") == 0)
+ assign_time_option (&globexthdr_mtime_option, &globexthdr_mtime, p);
else
{
if (xheader_protected_keyword_p (kw))
char *p;
size = xhdr->size;
+ switch (type)
+ {
+ case XGLTYPE:
+ if (globexthdr_mtime_option)
+ t = globexthdr_mtime;
+ break;
+
+ case XHDTYPE:
+ if (exthdr_mtime_option)
+ t = exthdr_mtime;
+ break;
+ }
header = start_private_header (name, size, t);
header->header.typeflag = type;