1
0
Files
2022-09-29 17:59:04 +03:00

49 lines
2.2 KiB
Plaintext

There are some rather sticky problems about what to do with respect to
file ownerships on extracted files. In general there are two cases:
===========================================================================
Restore ownership to numeric Set ownership to uid of user
uid stored in archive running bru
----------------------------- -----------------------------
Works properly for system files Fails miserably, with possible
when doing restoration from system disaster, for system files.
backups.
Root permissions can be used to give There is no way for root to easily
all the files to a single user. give all the files back to their
(Easy to correct ownerships if other original owners. (Hard to correct
case is the desired case) if other case is desired case).
Not desirable for archives imported Most convenient for archives imported
from foreign systems, where numeric from foreign systems, since all files
uids are likely to be completely will be owned by user doing extract.
different.
Is analogous to handling of other Would imply that other file attributes
file attributes such as group, mode, should be also set to user defaults.
dates, etc. These are restored to the Specifically, mode should be modified
original state. by umask, date should be current date,
etc. Bru already does some twiddling
with the file attributes, for security
purposes. For example, suid programs
do not have their suid bits preserved
except when bru is run by root or the
file owner.
===========================================================================
Note that we really need both cases, selectable by the user running
bru. The only real choice then, is which one to make the default.
It seems logical that the default should be the case which is most
often correct, and which is easiest to correct if a mistake is made.
From the comparison chart, it is apparent that the first case (restore
ownerships to recorded numeric uid's) is the most desirable.
Thus, the default is to restore everything as recorded in the archive,
with the exception of obvious security problems like suid programs. A
special flag is provided (-C) to make importing archive from other systems
less painful.