BSD macro from sys/param.h.
-/* $OpenBSD: atrun.c,v 1.21 2015/01/14 17:27:29 millert Exp $ */
+/* $OpenBSD: atrun.c,v 1.22 2015/01/14 17:27:51 millert Exp $ */
/*
* Copyright (c) 2002-2003 Todd C. Miller <Todd.Miller@courtesan.com>
log_it("CRON", getpid(), "ORPHANED JOB", atfile);
_exit(EXIT_FAILURE);
}
-#if (defined(BSD)) && (BSD >= 199103)
+#ifdef HAVE_PW_EXPIRE
if (pw->pw_expire && time(NULL) >= pw->pw_expire) {
log_it(pw->pw_name, getpid(), "ACCOUNT EXPIRED, JOB ABORTED",
atfile);
"unable to set groups for %s\n", pw->pw_name);
_exit(EXIT_FAILURE);
}
-#if (defined(BSD)) && (BSD >= 199103)
+#ifdef HAVE_SETLOGIN
setlogin(pw->pw_name);
#endif
if (setuid(pw->pw_uid)) {
-/* $OpenBSD: config.h,v 1.17 2004/06/17 22:11:55 millert Exp $ */
+/* $OpenBSD: config.h,v 1.18 2015/01/14 17:27:51 millert Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* All rights reserved
*/
#define HAVE_TM_GMTOFF /*-*/
+ /* if your OS has the paths.h header */
+#define HAVE_PATHS_H /*-*/
+
/* if your OS supports a BSD-style login.conf file */
#define LOGIN_CAP /*-*/
/* if your OS has a getloadavg() function */
#define HAVE_GETLOADAVG /*-*/
+ /* if your OS has a setlogin() function */
+#define HAVE_SETLOGIN /*-*/
+
+ /* if your OS has a pw_expire field in struct passwd */
+#define HAVE_PW_EXPIRE /*-*/
+
/* maximum load at which batch jobs will still run */
#define BATCH_MAXLOAD 1.5 /*-*/
-/* $OpenBSD: do_command.c,v 1.39 2015/01/14 17:27:30 millert Exp $ */
+/* $OpenBSD: do_command.c,v 1.40 2015/01/14 17:27:51 millert Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* All rights reserved
"unable to set groups for %s\n", e->pwd->pw_name);
_exit(EXIT_FAILURE);
}
-#if (defined(BSD)) && (BSD >= 199103)
+#ifdef HAVE_SETLOGIN
setlogin(usernm);
-#endif /* BSD */
+#endif
if (setuid(e->pwd->pw_uid)) {
fprintf(stderr,
"unable to set uid to %lu\n",
-/* $OpenBSD: entry.c,v 1.34 2014/08/25 07:50:26 doug Exp $ */
+/* $OpenBSD: entry.c,v 1.35 2015/01/14 17:27:51 millert Exp $ */
/*
* Copyright 1988,1990,1993,1994 by Paul Vixie
}
e->envp = tenvp;
}
-#if defined(BSD) || defined(__linux)
if (snprintf(envstr, sizeof envstr, "USER=%s", pw->pw_name) >=
sizeof(envstr))
log_it("CRON", getpid(), "error", "can't set USER");
}
e->envp = tenvp;
}
-#endif
Debug(DPARS, ("load_entry()...about to parse command\n"))
-/* $OpenBSD: pathnames.h,v 1.12 2007/02/13 18:39:34 mglocker Exp $ */
+/* $OpenBSD: pathnames.h,v 1.13 2015/01/14 17:27:51 millert Exp $ */
/* Copyright 1993,1994 by Paul Vixie
* All rights reserved
#ifndef _PATHNAMES_H_
#define _PATHNAMES_H_
-#if (defined(BSD)) && (BSD >= 199103) || defined(__linux) || defined(AIX)
+#ifdef HAVE_PATHS_H
# include <paths.h>
-#endif /*BSD*/
+#endif /*HAVE_PATHS_H*/
#ifndef CRONDIR
/* CRONDIR is where cron(8) and crontab(1) both chdir
-/* $OpenBSD: popen.c,v 1.23 2015/01/14 17:27:30 millert Exp $ */
+/* $OpenBSD: popen.c,v 1.24 2015/01/14 17:27:51 millert Exp $ */
/*
* Copyright (c) 1988, 1993, 1994
pw->pw_name);
_exit(1);
}
-#if (defined(BSD)) && (BSD >= 199103)
+#ifdef HAVE_SETLOGIN
setlogin(pw->pw_name);
-#endif /* BSD */
+#endif
if (setuid(pw->pw_uid)) {
fprintf(stderr,
"unable to set uid for %s\n",