Move fileops.c defines and prototypes to filesops.h
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 23 Apr 2010 10:02:39 +0000 (06:02 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 23 Apr 2010 10:02:39 +0000 (06:02 -0400)
include/fileops.h [new file with mode: 0644]
plugins/sudoers/sudoers.h
src/fileops.c
src/sudo.h

diff --git a/include/fileops.h b/include/fileops.h
new file mode 100644 (file)
index 0000000..b2479fd
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010 Todd C. Miller <Todd.Miller@courtesan.com>
+ *
+ * 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 */
index baf3a6a5e519b7659b9c0565c02443072b857b00..17eb81ada9acb1b0853b98f5f8cde65597268f4a 100644 (file)
@@ -28,6 +28,7 @@
 #include <error.h>
 #include <alloc.h>
 #include <list.h>
+#include <fileops.h>
 #include <missing.h>
 #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 *);
 
index 50c7cbc107cff64b53d40e03fec79081db9be56b..b7d7411b10aa51510091fbfb84f2012f960172b6 100644 (file)
@@ -47,7 +47,7 @@
 # include <emul/timespec.h>
 #endif
 
-#include "sudo.h" /* XXX - for SUDO_LOCK and friends */
+#include <fileops.h>
 
 #ifndef LINE_MAX
 # define LINE_MAX 2048
index 2408e9112c8092fbfaeaa9375dbd1a10f80d871a..9ba30b543bbc638b1629767658359018c11e806a 100644 (file)
 
 #include <pathnames.h>
 #include <limits.h>
-#include "compat.h"
-#include "alloc.h"
-#include "error.h"
-#include "list.h"
-#include "missing.h"
+
+#include <compat.h>
+#include <alloc.h>
+#include <error.h>
+#include <fileops.h>
+#include <list.h>
+#include <missing.h>
 
 #ifdef __TANDEM
 # define ROOT_UID       65535
  */
 #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[],