#1086575 tgt: The example in the manpage for media_home isn't supported by tgt-admin

Package:
tgt
Source:
tgt
Description:
Linux SCSI target user-space daemon and tools
Submitter:
Tim Woodall
Date:
2024-11-01 15:45:01 UTC
Severity:
normal
#1086575#5
Date:
2024-11-01 15:34:34 UTC
From:
To:
Dear Maintainer,

Under in the tgtadm man page under the media_home documentation there
are tgtadm commands to set this a virtual jukebox. However, the first
step, "The dvd starts out without a backing store" isn't supported by
tgt-admin.

I propose a patch that makes this supported. Additionally, I include two
example conf files for a dvd jukebox exactly as per the manpage and a
virtual tape library.

Note that this patch no longer allows shell expansion of variables (and
shell scripts) in the conf file in the areas of the code I've changed.
This might be classed as a regression.  This patch should also fix
#905028.


tgt-admin.patch  - the patch itself
tgt-admin.conf   - a conffile that should be identical to the man page
                   example.
tapechanger.conf - a conffile for a vtl. Commented instructions at the
                   end for how to use it.


Additionally, I would suggest that tgt-admin verifies that all of the
conffiles it reads are owned and only writeable by root. There are
countless shell escape vulnerabilites that would allow anyone with write
access to a conf file to gain root permissions when it starts. (My perl
skills are not sufficient to do this so I have not included a patch but
I've made my best effort to resolve these issues in the areas of the
code I have touched.)