Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single files (/etc/crontab) are ignored #19

Open
manzsolutions-lpr opened this issue Jul 21, 2020 · 0 comments
Open

Single files (/etc/crontab) are ignored #19

manzsolutions-lpr opened this issue Jul 21, 2020 · 0 comments

Comments

@manzsolutions-lpr
Copy link

manzsolutions-lpr commented Jul 21, 2020

A check unfortunately only works with directories leading to a rather irritating error message:

$ strace -f -e file /opt/go-crond-64-linux --allow-unprivileged --auto
INFO[0000] starting go-crond version 20.7.0 (09eeb85; go1.14.4)  
[pid   377] openat(AT_FDCWD, "/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
WARN[0000] go-crond is NOT running as root, disabling user switching 
[pid   377] newfstatat(AT_FDCWD, ".", {st_mode=S_IFDIR|0777, st_size=42, ...}, 0) = 0
[pid   377] newfstatat(AT_FDCWD, "/var/www/nextcloud", {st_mode=S_IFDIR|0777, st_size=42, ...}, 0) = 0
INFO[0000] starting http server on                      
[pid   377] chdir("/var/www/nextcloud") = 0
[pid   377] newfstatat(AT_FDCWD, "/etc/alpine-release", 0xc0001a1a38, 0) = -1 ENOENT (No such file or directory)
[pid   377] newfstatat(AT_FDCWD, "/etc/redhat-release", 0xc0001a1b08, 0) = -1 ENOENT (No such file or directory)
[pid   377] newfstatat(AT_FDCWD, "/etc/SuSE-release", 0xc0001a1bd8, 0) = -1 ENOENT (No such file or directory)
[pid   377] newfstatat(AT_FDCWD, "/etc/debian_version", {st_mode=S_IFREG|0644, st_size=5, ...}, 0) = 0
INFO[0000]  --> detected Debian family, using distribution defaults 
[pid   377] newfstatat(AT_FDCWD, "/etc/crontab", {st_mode=S_IFREG|0644, st_size=589, ...}, 0) = 0
[pid   377] newfstatat(AT_FDCWD, "/etc/crontab", {st_mode=S_IFREG|0644, st_size=589, ...}, 0) = 0
INFO[0000] path /etc/crontab does not exists            
[pid   377] newfstatat(AT_FDCWD, "/etc/cron.d", 0xc0001a1f18, 0) = -1 ENOENT (No such file or directory)
[pid   376] chdir("/")                  = 0
INFO[0000] start runner with 0 jobs                     
^Cstrace: Process 373 detached
strace: Process 374 detached
strace: Process 375 detached
strace: Process 376 detached
strace: Process 377 detached
strace: Process 378 detached
strace: Process 379 detached
INFO[0003] got signal: interrupt                        
INFO[0003] stop runner                                  
INFO[0003] terminated                            

As you can see from strace /etc/crontab does exist but is logged as “does not exist”. Putting /etc/crontab into a dedicated folder and running with --include <folder> works. The linked line in the code seems to fit as it only allows folders to pass.

//edit:

Running a file directly like /opt/go-crond-64-linux /etc/crontab works.

mblaschke added a commit that referenced this issue Sep 24, 2022
Signed-off-by: Markus Blaschke <mblaschke82@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant