FreeBSD Bugzilla – Attachment 201915 Details for
Bug 235657
/usr/libexec/atrun race causes missed jobs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Diff against /usr/src/libexec/atrun directory
atrun.diff (text/plain), 1.84 KB, created by
karl
on 2019-02-11 05:46:11 UTC
(
hide
)
Description:
Diff against /usr/src/libexec/atrun directory
Filename:
MIME Type:
Creator:
karl
Created:
2019-02-11 05:46:11 UTC
Size:
1.84 KB
patch
obsolete
>Index: atrun.c >=================================================================== >--- atrun.c (revision 343994) >+++ atrun.c (working copy) >@@ -200,29 +200,45 @@ > > PRIV_END > >- if (stream == NULL) >+ if (stream == NULL) { >+ unlink(filename); > perr("cannot open input file %s", filename); >+ } > >- if ((fd_in = dup(fileno(stream))) <0) >+ if ((fd_in = dup(fileno(stream))) <0) { >+ unlink(filename); > perr("error duplicating input file descriptor"); >+ } > >- if (fstat(fd_in, &buf) == -1) >+ if (fstat(fd_in, &buf) == -1) { >+ unlink(filename); > perr("error in fstat of input file descriptor"); >+ } > >- if (lstat(filename, &lbuf) == -1) >+ if (lstat(filename, &lbuf) == -1) { >+ unlink(filename); > perr("error in fstat of input file"); >+ } > >- if (S_ISLNK(lbuf.st_mode)) >+ if (S_ISLNK(lbuf.st_mode)) { >+ unlink(filename); > perrx("Symbolic link encountered in job %s - aborting", filename); >+ } > > if ((lbuf.st_dev != buf.st_dev) || (lbuf.st_ino != buf.st_ino) || > (lbuf.st_uid != buf.st_uid) || (lbuf.st_gid != buf.st_gid) || >- (lbuf.st_size!=buf.st_size)) >+ (lbuf.st_size!=buf.st_size)) { >+ unlink(filename); > perrx("Somebody changed files from under us for job %s - aborting", > filename); >+ } > >- if (buf.st_nlink > 1) >+ if (buf.st_nlink > 1) { >+ unlink(filename); > perrx("Somebody is trying to run a linked script for job %s", filename); >+ } >+ >+ unlink(filename); > > if ((fflags = fcntl(fd_in, F_GETFD)) <0) > perr("error in fcntl"); >@@ -561,10 +577,6 @@ > if (islower(queue)) > run_file(dirent->d_name, buf.st_uid, buf.st_gid); > } >- /* Delete older files >- */ >- if ((run_time < now) && !(S_IXUSR & buf.st_mode) && (S_IRUSR & buf.st_mode)) >- unlink(dirent->d_name); > } > /* run the single batch file, if any > */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 235657
: 201915