cron can crash (SIGSEGV) when trying to re-parent orphans
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cron (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
We sometimes have people come and go, leaving behind
old crontab files that, when they return, and are given
the same username, no longer have the correct uid.
This can cause cron to crash when it has the old crontab
file on its orphans list. Below's a lightly-edited
backtrace, with username replaced by "joeuser".
Here's the user's (former) crontab:
-rw------- 1 48031 crontab 1216 Jul 26 15:36 /var/spool/
Whereas his new uid is
# id -u joeuser
48529
This is on bionic with cron 3.0pl1-128.1ubuntu1
--buck
Core was generated by `/usr/sbin/cron -f'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 find_user (name=<optimized out>, db=0x0, db@entry=
at database.c:316
316 database.c: No such file or directory.
(gdb) bt
#0 find_user (name=<optimized out>, db=0x0, db@entry=
at database.c:316
#1 force_rescan_user (old_db=
new_
fname=
at database.c:588
#2 0x000055fc9f2b03ab in process_crontab (uname=
fname=
statbuf=
old_
#3 0x000055fc9f2b0ba6 in check_orphans (db=0x7fffe687cb50) at database.c:639
#4 0x000055fc9f2af6ce in main (argc=<optimized out>, argv=<optimized out>)
at cron.c:178