/*
* really.c - program for gaining privilege
*
- * Copyright (C) 1992-3 Ian Jackson <iwj10@cus.cam.ac.uk>
+ * Copyright (C) 1992-3 Ian Jackson <ian@davenant.greenend.org.uk>
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2,
+ * published by the Free Software Foundation; either version 3,
* or (at your option) any later version.
*
* This is distributed in the hope that it will be useful, but
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
- * License along with this file; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * License along with this file; if not, consult the Free Software
+ * Foundation's website at www.fsf.org, or the GNU Project website at
+ * www.gnu.org.
*/
#include <stdio.h>
" -G|--gid <gid> } the group list\n"
"other really-options:\n"
" -h|--help display this message\n"
- " -R|--chroot <dir> chroot (but *not* chdir)\n",
+ " -R|--chroot <dir> chroot (but *not* chdir - danger!)\n",
stderr) == EOF) { perror("write usage"); exit(-1); }
}
#ifdef REALLY_CHECK_FILE
static int checkroot(void) {
int r;
- r= access(REALLY_CHECK_FILE,W_OK);
- if (r) return -1;
- return 0;
+ r= access(REALLY_CHECK_FILE, W_OK);
+ if (!r) return 0;
+#ifdef REALLY_CHECK_FILE_2
+ r= access(REALLY_CHECK_FILE_2, W_OK);
+ if (!r) return 0;
+ /* If all fails we return the errno from file _2 */
+#endif /*REALLY_CHECK_FILE_2*/
+ return -1;
}
#endif
#ifdef REALLY_CHECK_GID