Browse code

Simple layout: introduce the "extra_tail" property.

Xavier G authored on 26/04/2020 19:48:58
Showing 1 changed files

  • yamltab index 8b3715d..5ee11ed 100755
... ...
@@ -268,6 +268,11 @@ def simplify_keytab(keytab):
268 268
 		simple_entry['kvno'] = entry.get('actual_kvno', entry['kvno'])
269 269
 		if 'tail_kvno' in entry:
270 270
 			simple_entry['kvno_in_tail'] = True
271
+		if 'tail' in record:
272
+			start = 4 if 'tail_kvno' in entry else 0
273
+			extra_tail = record['tail'][start:]
274
+			if extra_tail:
275
+				simple_entry['extra_tail'] = extra_tail
271 276
 		for key in ('date', 'enctype', 'key'):
272 277
 			if key in entry:
273 278
 				simple_entry[key] = entry[key]
... ...
@@ -441,6 +446,7 @@ def simple_kvno_to_full(inentry, index, entry, record):
441 446
 		elif kvno_too_big:
442 447
 			message = 'Cannot store kvno > 255 without kvno_in_tail in entry #%d'
443 448
 			raise KeytabComposingError(message % index)
449
+		record['tail'] += to_bytes(inentry.get('extra_tail', b''))
444 450
 
445 451
 def simple_timestamp_to_full(inentry, index, entry):
446 452
 	if 'timestamp' in inentry: