Only in dcron-4.4: chuser.o Only in dcron-4.4: concat.o Only in dcron-4.4: config Only in dcron-4.4: crond Only in dcron-4.4: crontab Only in dcron-4.4: crontab.o diff -aur dcron-4.4/database.c dcron-4.4.new/database.c --- dcron-4.4/database.c 2010-01-18 16:27:31.000000000 +0100 +++ dcron-4.4.new/database.c 2010-02-11 18:27:34.254887989 +0100 @@ -86,6 +86,17 @@ }; /* + * hash function to create JobNames when ID_TAG is missing + * Currently an sdbm, may be an other hash function is better. + */ +unsigned long hash(char *key) +{ + unsigned long h=0; + while(*key) h=*key++ + (h<<6) + (h<<16) - h; + return h; +} + +/* * Check the cron.update file in the specified directory. If user_override * is NULL then the files in the directory belong to the user whose name is * the file, otherwise they belong to the user_override user. @@ -595,10 +606,6 @@ line.cl_Description = NULL; line.cl_JobName = NULL; } - if (ptr && line.cl_Delay > 0 && !line.cl_JobName) { - printlogf(LOG_WARNING, "failed parsing crontab for user %s: writing timestamp requires job %s to be named\n", userName, ptr); - ptr = NULL; - } if (!ptr) { /* couldn't parse so we abort; free any cl_Waiters */ if (line.cl_Waiters) { @@ -621,12 +628,25 @@ line.cl_Shell = strdup(ptr); if (line.cl_Delay > 0) { - if (!(line.cl_Timestamp = concat(TSDir, "/", userName, ".", line.cl_JobName, NULL))) { - errno = ENOMEM; - perror("SynchronizeFile"); - exit(1); + if (!line.cl_JobName) { + char *h_str = strdup("xxxxxxxx"); + unsigned long h = hash(line.cl_Shell); + sprintf(h_str, "%ld", h%100000000); + if (!(line.cl_Timestamp = concat(TSDir, "/", userName, ".", h_str, NULL))) { + errno = ENOMEM; + perror("SynchronizeFile"); + exit(1); + } + free(h_str); + line.cl_NotUntil = tnow + line.cl_Delay; + } else { + if (!(line.cl_Timestamp = concat(TSDir, "/", userName, ".", line.cl_JobName, NULL))) { + errno = ENOMEM; + perror("SynchronizeFile"); + exit(1); + } + line.cl_NotUntil = tnow + line.cl_Delay; } - line.cl_NotUntil = tnow + line.cl_Delay; } if (line.cl_JobName) { Only in dcron-4.4: database.o Only in dcron-4.4: job.o Only in dcron-4.4: main.o Only in dcron-4.4: protos.h Only in dcron-4.4: subs.o