mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-21 21:08:36 +03:00
ust_service_check: proper treatment of files in sub-directories
We must not only consider files in the current directory (ADF.USIM) but also in its sub-directories. This requires us to be able to determine the path we need to traverse between the currently selected file (EF.UST) and the respective file in some other directory, which is implemented via CardFile.build_select_path_to(). Change-Id: I61797fefa9dafa36a8a62c11aa2cfaeecb015740
This commit is contained in:
@@ -608,12 +608,8 @@ class EF_UServiceTable(TransparentEF):
|
||||
for f in files_by_service[s]:
|
||||
should_exist = f.should_exist_for_services(active_services)
|
||||
try:
|
||||
(data, sw) = cmd.card._scc.select_file(f.fid)
|
||||
cmd.rs.select_file(f)
|
||||
exists = True
|
||||
fcp = f.decode_select_response(data)
|
||||
# if we just selected a directory, go back
|
||||
if fcp['file_descriptor']['file_type'] == 'df':
|
||||
cmd.card._scc.select_parent_df()
|
||||
except SwMatchError as e:
|
||||
sw = str(e)
|
||||
exists = False
|
||||
@@ -625,7 +621,7 @@ class EF_UServiceTable(TransparentEF):
|
||||
cmd.perror(" ERROR: File %s is not selectable (%s) but should!" % (f, sw))
|
||||
finally:
|
||||
# re-select the EF.UST
|
||||
cmd.card._scc.select_file(self.fid)
|
||||
cmd.rs.select_file(self)
|
||||
return num_problems
|
||||
|
||||
class EF_UST(EF_UServiceTable):
|
||||
|
||||
Reference in New Issue
Block a user