Skip to content

[BUG] Files in the Custom Scripts directory are executed unexpectedly #311

@shuosiw

Description

@shuosiw

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Image

According to the documentation, if the file does not have executable permissions, it will be ignored, but in fact, it will still be executed.

Image

I want to import a CA certificate file for the Jellyfin container. I placed the certificate in this directory and wrote a script to import the certificate.

Image

You can see that the certificate file does not have executable permissions, but it is still executed.

Expected Behavior

As documented, files without executable permissions in the Custom Scripts directory should be skipped.

Steps To Reproduce

If you put a normal file (without executable permission) in the Custom Scripts directory, it will be executed and then an error will be reported.

Environment

- OS: unRAID Server OS version: 6.8.1
- How docker service was installed: linuxserver/jellyfin:10.10.7

CPU architecture

x86-64

Docker creation

run with `-v /mnt/user/appdata/jellyfin-dc/custom-cont-init.d:/custom-cont-init.d:ro`

Container logs

**** creating video group video1567 with id 18 ****
**** adding /dev/dri/renderD128 to video group video1567 with id 18 ****
**** permissions for /dev/dri/card0 are good ****
[custom-init] Files found, executing
[custom-init] ca.crt: executing...
/custom-cont-init.d/ca.crt: line 1: -----BEGIN: command not found
/custom-cont-init.d/ca.crt: line 2: MIID************************************************************: command not found
/custom-cont-init.d/ca.crt: line 3: BQAw************************************************************: command not found
/custom-cont-init.d/ca.crt: line 4: CE15************************************************************: command not found
/custom-cont-init.d/ca.crt: line 5: A1UE************************************************************: command not found
/custom-cont-init.d/ca.crt: line 6: MIIB************************************************************: command not found
/custom-cont-init.d/ca.crt: line 7: G1m7************************************************************: No such file or directory
/custom-cont-init.d/ca.crt: line 8: n7BX************************************************************: No such file or directory
/custom-cont-init.d/ca.crt: line 9: G6Uh************************************************************: No such file or directory
/custom-cont-init.d/ca.crt: line 10: lJ+************************************************************f: No such file or directory
/custom-cont-init.d/ca.crt: line 11: gf7************************************************************c: command not found
/custom-cont-init.d/ca.crt: line 12: MQI************************************************************j: command not found
/custom-cont-init.d/ca.crt: line 13: BBg************************************************************q: No such file or directory
/custom-cont-init.d/ca.crt: line 14: hki************************************************************8: No such file or directory
/custom-cont-init.d/ca.crt: line 15: CLW************************************************************X: No such file or directory
/custom-cont-init.d/ca.crt: line 16: 9rj************************************************************4: No such file or directory
/custom-cont-init.d/ca.crt: line 17: 0Hm************************************************************5: No such file or directory
/custom-cont-init.d/ca.crt: line 18: lLD************************************************************c: No such file or directory
/custom-cont-init.d/ca.crt: line 19: mE6qJjSBWk/7F7w4+uDV6I7ODSyRlMqwBonVaid/SA==: No such file or directory
/custom-cont-init.d/ca.crt: line 20: -----END: command not found
[custom-init] ca.crt: exited 127
[custom-init] update-ca.sh: executing...
mv: cannot remove '/custom-cont-init.d/ca.crt': Read-only file system
Updating certificates in /etc/ssl/certs...
rehash: warning: skipping ca-certificates.crt,it does not contain exactly one certificate or CRL

1 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
/usr/local/share/ca-certificates/myroot/ca.crt: OK
[custom-init] update-ca.sh: exited 0

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions