From: Todd C. Miller Date: Fri, 23 Apr 2010 10:02:39 +0000 (-0400) Subject: Move fileops.c defines and prototypes to filesops.h X-Git-Tag: SUDO_1_8_0~702 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4b04e875ed07d7d29e0c79ee2ec8978a9e552503;p=sudo Move fileops.c defines and prototypes to filesops.h --- diff --git a/include/fileops.h b/include/fileops.h new file mode 100644 index 000000000..b2479fd92 --- /dev/null +++ b/include/fileops.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2010 Todd C. Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _SUDO_FILEOPS_H +#define _SUDO_FILEOPS_H + +/* + * Flags for lock_file() + */ +#define SUDO_LOCK 1 /* lock a file */ +#define SUDO_TLOCK 2 /* test & lock a file (non-blocking) */ +#define SUDO_UNLOCK 4 /* unlock a file */ + +int lock_file(int, int); +int touch(int, char *, struct timeval *); +char *sudo_parseln(FILE *); + +#endif /* _SUDO_FILEOPS_H */ diff --git a/plugins/sudoers/sudoers.h b/plugins/sudoers/sudoers.h index baf3a6a5e..17eb81ada 100644 --- a/plugins/sudoers/sudoers.h +++ b/plugins/sudoers/sudoers.h @@ -28,6 +28,7 @@ #include #include #include +#include #include #include "defaults.h" #include "logging.h" @@ -186,13 +187,6 @@ struct sudo_user { */ #define SUDO_PASS_MAX 256 -/* - * Flags for lock_file() - */ -#define SUDO_LOCK 1 /* lock a file */ -#define SUDO_TLOCK 2 /* test & lock a file (non-blocking) */ -#define SUDO_UNLOCK 4 /* unlock a file */ - struct lbuf; struct passwd; @@ -256,11 +250,6 @@ YY_DECL; void dump_defaults(void); void dump_auth_methods(void); -/* fileops.c */ -int lock_file(int, int); -int touch(int, char *, struct timeval *); -char *sudo_parseln(FILE *); - /* getspwuid.c */ char *sudo_getepw(const struct passwd *); diff --git a/src/fileops.c b/src/fileops.c index 50c7cbc10..b7d7411b1 100644 --- a/src/fileops.c +++ b/src/fileops.c @@ -47,7 +47,7 @@ # include #endif -#include "sudo.h" /* XXX - for SUDO_LOCK and friends */ +#include #ifndef LINE_MAX # define LINE_MAX 2048 diff --git a/src/sudo.h b/src/sudo.h index 2408e9112..9ba30b543 100644 --- a/src/sudo.h +++ b/src/sudo.h @@ -26,11 +26,13 @@ #include #include -#include "compat.h" -#include "alloc.h" -#include "error.h" -#include "list.h" -#include "missing.h" + +#include +#include +#include +#include +#include +#include #ifdef __TANDEM # define ROOT_UID 65535 @@ -93,13 +95,6 @@ */ #define SUDO_PASS_MAX 256 -/* - * Flags for lock_file() - */ -#define SUDO_LOCK 1 /* lock a file */ -#define SUDO_TLOCK 2 /* test & lock a file (non-blocking) */ -#define SUDO_UNLOCK 4 /* unlock a file */ - /* * Flags for tgetpass() */ @@ -173,10 +168,6 @@ int tty_present(void); /* zero_bytes.c */ void zero_bytes(volatile void *, size_t); -/* fileops.c */ -int lock_file(int, int); -char *sudo_parseln(FILE *); - /* script.c */ int script_duplow(int); int script_execve(struct command_details *details, char *argv[], char *envp[],