[Lurker-users] Problem in lurker-prune: utime used to touch file not owned by caller.
Brought to you by:
terpstra
From: Kaz K. <ka...@ky...> - 2013-09-29 21:06:39
|
Hi all, There is this code in prune.cpp: // set the mtime stamp to beginfix struct utimbuf touch; touch.actime = touch.modtime = beginfix; if (utime("lurker.docroot", &touch) < 0) { cerr << "touching " << docfile << ": " << strerror(errno) << endl; return 1; } This code is hostile to installations which use two user accounts for the archiving operation. The problem is that if utime is called with a non-null times pointer, then the caller must be the owner of the file. Being the member of a group which owns the file is not good enough. An alternative would be not to rely on the modification timestamp of "lurker.docroot", but actually store the value of beginfix in the file, either as a decimal integer or binary image or whatever. |