summaryrefslogtreecommitdiff
path: root/source3/client/mount.h
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2008-11-06 15:07:07 -0500
committerJeff Layton <jlayton@redhat.com>2008-11-06 15:07:07 -0500
commit32695912dd3ed7c02da68209328d630c89d395ba (patch)
tree9fe8734a10f5a2a79980dff0578db12de0288530 /source3/client/mount.h
parentdb26f7b7c49b6d4254ce5da7097e062b7dbd0409 (diff)
downloadsamba-32695912dd3ed7c02da68209328d630c89d395ba.tar.gz
samba-32695912dd3ed7c02da68209328d630c89d395ba.tar.bz2
samba-32695912dd3ed7c02da68209328d630c89d395ba.zip
mount.cifs: use lock/unlock_mtab scheme from util-linux-ng mount prog
The util-linux-ng sources have a good, but rather complex scheme for locking the mtab before updating it. Mount helpers need to follow the same scheme. Advisory locking only works if everyone is using the same locking scheme. Copy the routines we need from util-linux-ng into a separate source file and then have mount.cifs and umount.cifs link in this object. The long term goal is to have these routines in a separate helper library (libmount). Mount helpers can then dynamically link in that lib. Until that happens, this should serve as a suitable stopgap solution. Signed-off-by: Jeff Layton <jlayton@redhat.com>
Diffstat (limited to 'source3/client/mount.h')
-rw-r--r--source3/client/mount.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/source3/client/mount.h b/source3/client/mount.h
new file mode 100644
index 0000000000..23ea4f0cbd
--- /dev/null
+++ b/source3/client/mount.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2008 Jeff Layton (jlayton@samba.org)
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ * *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* most of this info was taken from the util-linux-ng sources */
+
+#ifndef _MOUNT_H_
+#define _MOUNT_H_
+
+/* exit status - bits below are ORed */
+#define EX_USAGE 1 /* incorrect invocation or permission */
+#define EX_SYSERR 2 /* out of memory, cannot fork, ... */
+#define EX_SOFTWARE 4 /* internal mount bug or wrong version */
+#define EX_USER 8 /* user interrupt */
+#define EX_FILEIO 16 /* problems writing, locking, ... mtab/fstab */
+#define EX_FAIL 32 /* mount failure */
+#define EX_SOMEOK 64 /* some mount succeeded */
+
+#define _PATH_MOUNTED_LOCK _PATH_MOUNTED "~"
+#define _PATH_MOUNTED_TMP _PATH_MOUNTED ".tmp"
+
+extern int lock_mtab(void);
+extern void unlock_mtab(void);
+
+#endif /* ! _MOUNT_H_ */