News for hackers. Stuff that matters.
Re:A cron pitfall that will probably snare you at least once... by jerf on Monday June 27, 2011 @10:17AM (#2701356)
Asked there, but I'll tack it on here too: What is the purpose of that absurd-seeming restriction on file names? If you can drop arbitrary executables into directories on the file system, you've already "won", so I assume it's not security. I've read the run-parts man page, and that just pushes the problem back one level. If it's just to avoid running old files, that's an absurdly large hammer to hit that problem with.
Re:A cron pitfall that will probably snare you at least once... by raldi on Monday June 27, 2011 @10:28AM (#2701392)
My guess is they wanted to avoid running .dotfiles and #emacsbackup~ files and threw out the baby with the bathwater.
Re:A cron pitfall that will probably snare you at least once... by pyre on Monday June 27, 2011 @10:58AM (#2701511)
Also '.bak' or '.old'
Re:A cron pitfall that will probably snare you at least once... by qntm on Tuesday June 28, 2011 @08:59AM (#2705182)
Isn't ".bak" a fairly logical file extension for a cron job intended to, e.g., perform backups?
Re:A cron pitfall that will probably snare you at least once... by dexen on Monday June 27, 2011 @03:22PM (#2702604)
Are #emacsbackup~ files executable by default? If not, that's a very weak reason.

(honestly I dunno; have never used EMACS yet)

Re:A cron pitfall that will probably snare you at least once... by raldi on Monday June 27, 2011 @05:46PM (#2703138)
Well, # is actually used for emacs autosave files (or something else regarding open buffers). Making ~ backups is indeed on by default.

Then again, if you're editing files in /etc/ as root and using emacs to do so, you kinda deserve what you get.

Re:A cron pitfall that will probably snare you at least once... by dexen on Monday June 27, 2011 @05:53PM (#2703150)
Wait, my intented question was, `do those backup files have the executable permission bits set'? Not `do they hold valid input for interpreter/CPU'.

In Slackware's startup scripts, there's a good bunch of

  if [ -x SOME_FILE ]; then    # if the file is executable, run it
    ./SOME_FILE start
  fi
which makes it trivial to enable/disable various services by simply chmod +x SOME_FILE / chmod -x SOME_FILE. If EMACS' backup files were marked as not executable by the editor, that would be `case closed' for me, no need to pay extra attention to characters in file names.
Re:A cron pitfall that will probably snare you at least once... by ars on Monday June 27, 2011 @11:14PM (#2703905)
Yes, backup files have the executable bit set. They have the same bits as the real file.

They are in fact created by renaming the real file to the backup name, then saving the real file and copying the permissions.

Re:A cron pitfall that will probably snare you at least once... by insipid on Monday June 27, 2011 @11:21AM (#2701604)
According to the summary on the Ubuntu bug: "Essentially, we don't want to allow a '.' because of .dpkg-old and .dpkg-dist files."

Is the implication that you can have .dpkg files in cron folders that you wouldn't want to try to execute?

https://bugs.launchpad.net/ubuntu/+source/debianutils/+bug/3... http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=68561

Re:A cron pitfall that will probably snare you at least once... by nbpoole on Monday June 27, 2011 @11:23AM (#2701610)
I posted a link (http://news.ycombinator.com/item?id=2701527) to a Debian bug that explains the rationale (aside from the historical behavior argument) a little better: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=308911
Re:A cron pitfall that will probably snare you at least once... by insipid on Monday June 27, 2011 @03:14PM (#2702573)
My apologies; I must have missed the comments in between my first looking at it and posting my comment.
Re:A cron pitfall that will probably snare you at least once... by cperciva on Monday June 27, 2011 @10:28AM (#2701400)
I have no clue why run-parts does this; but BSD periodic doesn't.
Re:A cron pitfall that will probably snare you at least once... by mikemaccana on Monday June 27, 2011 @11:35AM (#2701669)
Yes, it's not a bug in Vixie Cron (which I think BSD cron may use) but in the Linux distros (who are responsible for adding run-parts).

.py, .pl, .sh and (as people realize they'are actually writing bash scripts) .bash are standards people actually use. Having them break in what amounts to an include dir is bad mojo.

Re:A cron pitfall that will probably snare you at least once... by cperciva on Monday June 27, 2011 @12:58PM (#2701999)
I can't speak for other BSDs, but FreeBSD's cron is still derived from Vixie cron.
Re:A cron pitfall that will probably snare you at least once... by RexRollman on Monday June 27, 2011 @02:27PM (#2702410)
OpenBSD uses Vixie Cron as well.