return 0;
}
if (!cxt->update) {
- cxt->update = mnt_new_update(!cxt->mtab_writable);
+ cxt->update = mnt_new_update();
if (!cxt->update)
return -ENOMEM;
+
+ mnt_update_set_filename(cxt->update,
+ cxt->mtab_writable ? cxt->mtab_path : cxt->utab_path,
+ !cxt->mtab_writable);
}
rc = mnt_update_set_fs(cxt->update, cxt->mountflags,
int mnt_context_update_tabs(mnt_context *cxt)
{
- const char *filename;
- mnt_lock *lock = NULL;
-
assert(cxt);
if (cxt->flags & MNT_FL_NOMTAB) {
DBG(CXT, mnt_debug_h(cxt, "don't update: syscall failed"));
return 0;
}
- if (mnt_update_is_userspace_only(cxt->update))
- filename = cxt->utab_path;
- else {
- filename = cxt->mtab_path;
- lock = mnt_context_get_lock(cxt);
- }
- assert(filename);
- return mnt_update_tab(cxt->update, filename, lock);
+ return mnt_update_tab(cxt->update, mnt_context_get_lock(cxt));
}
static int is_remount(mnt_context *cxt)
if (!rc)
rc = __mnt_fs_set_optstr_ptr(cxt->fs, n, FALSE);
- if (!rc && cxt->update &&
- !mnt_update_is_userspace_only(cxt->update))
- /* refresh options in /etc/mtab as well*/
+ /* refresh options in /etc/mtab as well */
+ if (!rc && cxt->update && cxt->mtab_writable)
rc = mnt_update_set_fs(cxt->update,
cxt->mountflags, NULL, cxt->fs);
}
if (!fs)
return -EINVAL;
fprintf(file, "------ fs: %p\n", fs);
- fprintf(file, "source: %s\n", mnt_fs_get_source(fs));
- fprintf(file, "target: %s\n", mnt_fs_get_target(fs));
- fprintf(file, "fstype: %s\n", mnt_fs_get_fstype(fs));
- fprintf(file, "optstr: %s\n", mnt_fs_get_optstr(fs));
+ fprintf(file, "source: %s\n", mnt_fs_get_source(fs));
+ fprintf(file, "target: %s\n", mnt_fs_get_target(fs));
+ fprintf(file, "fstype: %s\n", mnt_fs_get_fstype(fs));
+ fprintf(file, "optstr: %s\n", mnt_fs_get_optstr(fs));
if (mnt_fs_get_root(fs))
- fprintf(file, "root: %s\n", mnt_fs_get_root(fs));
+ fprintf(file, "root: %s\n", mnt_fs_get_root(fs));
if (mnt_fs_get_bindsrc(fs))
fprintf(file, "bindsrc: %s\n", mnt_fs_get_bindsrc(fs));
if (mnt_fs_get_freq(fs))
- fprintf(file, "freq: %d\n", mnt_fs_get_freq(fs));
+ fprintf(file, "freq: %d\n", mnt_fs_get_freq(fs));
if (mnt_fs_get_passno(fs))
- fprintf(file, "pass: %d\n", mnt_fs_get_passno(fs));
+ fprintf(file, "pass: %d\n", mnt_fs_get_passno(fs));
if (mnt_fs_get_id(fs))
- fprintf(file, "id: %d\n", mnt_fs_get_id(fs));
+ fprintf(file, "id: %d\n", mnt_fs_get_id(fs));
if (mnt_fs_get_parent_id(fs))
- fprintf(file, "parent: %d\n", mnt_fs_get_parent_id(fs));
+ fprintf(file, "parent: %d\n", mnt_fs_get_parent_id(fs));
if (mnt_fs_get_devno(fs))
- fprintf(file, "devno: %d:%d\n", major(mnt_fs_get_devno(fs)),
+ fprintf(file, "devno: %d:%d\n", major(mnt_fs_get_devno(fs)),
minor(mnt_fs_get_devno(fs)));
return 0;
}
extern int mnt_match_options(const char *optstr, const char *pattern);
extern const char *mnt_get_fstab_path(void);
extern const char *mnt_get_mtab_path(void);
-extern const char *mnt_get_utab_path(void);
extern int mnt_get_filesystems(char ***filesystems, const char *pattern);
extern void mnt_free_filesystems(char **filesystems);
extern int mnt_has_regular_mtab(const char **mtab, int *writable);
-extern int mnt_has_regular_utab(const char **utab, int *writable);
/* cache.c */
extern mnt_cache *mnt_new_cache(void);
mnt_fs **fs);
/* tab_update.c */
-extern mnt_update *mnt_new_update(int userspace_only);
+extern mnt_update *mnt_new_update(void);
extern void mnt_free_update(mnt_update *upd);
extern int mnt_update_is_ready(mnt_update *upd);
extern int mnt_update_set_fs(mnt_update *upd, int mountflags,
const char *target, mnt_fs *fs);
-extern int mnt_update_tab(mnt_update *upd, const char *filename, mnt_lock *lc);
-extern int mnt_update_is_userspace_only(mnt_update *upd);;
+extern int mnt_update_tab(mnt_update *upd, mnt_lock *lc);
/* context.c */
const char *usage;
};
-/* utils.c */
+/* test.c */
extern int mnt_run_test(struct mtest *tests, int argc, char *argv[]);
#endif
extern char *mnt_get_mountpoint(const char *path);
extern char *mnt_get_fs_root(const char *path, const char *mountpoint);
extern int mnt_open_uniq_filename(const char *filename, char **name, int flags);
+extern int mnt_has_regular_utab(const char **utab, int *writable);
+extern const char *mnt_get_utab_path(void);
/*
* Generic iterator
/* tab_update.c */
extern mnt_fs *mnt_update_get_fs(mnt_update *upd);
+extern int mnt_update_set_filename(mnt_update *upd, const char *filename, int userspace_only);
#endif /* _LIBMOUNT_PRIVATE_H */
/**
* mnt_new_tab_from_dir
- * @dirname: for example /etc/fstab.d or /dev/.mount/utabs
+ * @dirname: for example /etc/fstab.d
*
* Returns: newly allocated tab on success and NULL in case of error.
*/
* @filename: overwrites default (/etc/mtab or $LIBMOUNT_MTAB) or NULL
*
* This function parses /etc/mtab or /proc/self/mountinfo +
- * /dev/.mount/utabs/<*>.mtab or /proc/mounts.
+ * /dev/.mount/utabs or /proc/mounts.
*
* See also mnt_tab_set_parser_errcb().
*
struct _mnt_update {
char *target;
mnt_fs *fs;
+ char *filename;
unsigned long mountflags;
int userspace_only;
int ready;
/**
* mnt_new_update:
- * @userspace_only: TRUE/FALSE -- maintain userspace mount options only
*
* Returns: newly allocated update handler
*/
-mnt_update *mnt_new_update(int userspace_only)
+mnt_update *mnt_new_update(void)
{
mnt_update *upd;
if (!upd)
return NULL;
- upd->userspace_only = userspace_only;
DBG(UPDATE, mnt_debug_h(upd, "allocate"));
return upd;
mnt_free_fs(upd->fs);
free(upd->target);
+ free(upd->filename);
free(upd);
}
+/*
+ * Returns 0 on success, 1 if not file available, -1 in case of error.
+ */
+int mnt_update_set_filename(mnt_update *upd, const char *filename, int userspace_only)
+{
+ const char *path = NULL;
+ int rw = 0;
+
+ assert(upd);
+
+ /* filename explicitly defined */
+ if (filename) {
+ char *p = strdup(filename);
+ if (!p)
+ return -ENOMEM;
+
+ upd->userspace_only = userspace_only;
+ free(upd->filename);
+ upd->filename = p;
+ }
+
+ if (upd->filename)
+ return 0;
+
+ /* detect tab filename -- /etc/mtab or /dev/.mount/utab
+ */
+ mnt_has_regular_mtab(&path, &rw);
+ if (!rw) {
+ path = NULL;
+ mnt_has_regular_utab(&path, &rw);
+ if (!rw)
+ return 1;
+ upd->userspace_only = TRUE;
+ }
+ upd->filename = strdup(path);
+ if (!upd->filename)
+ return -ENOMEM;
+
+ return 0;
+}
+
/**
* mnt_update_is_ready:
* @upd: update handler
return upd ? upd->ready : FALSE;
}
-/**
- * mnt_update_is_userspace_only:
- * @upd: update handler
- *
- * Returns: 1 if @upd cares about userspace mount options only (see
- * mnt_new_update().
- */
-int mnt_update_is_userspace_only(mnt_update *upd)
-{
- return upd ? upd->userspace_only : FALSE;
-}
-
-
/**
* mnt_update_set_fs:
* @upd: update handler
int mnt_update_set_fs(mnt_update *upd, int mountflags,
const char *target, mnt_fs *fs)
{
+ int rc;
+
assert(upd);
assert(target || fs);
upd->target = NULL;
upd->mountflags = mountflags;
+ rc = mnt_update_set_filename(upd, NULL, 0);
+ if (rc)
+ return rc; /* error or no file available (rc = 1) */
+
if (fs) {
if (upd->userspace_only && !(mountflags & MS_MOVE)) {
int rc = utab_new_entry(fs, mountflags, &upd->fs);
return 0;
}
-static int update_tab(mnt_update *upd, const char *filename, mnt_tab *tb)
+static int update_tab(mnt_update *upd, mnt_tab *tb)
{
FILE *f;
int rc, fd;
char *uq = NULL;
- if (!tb || !filename)
+ if (!tb || !upd->filename)
return -EINVAL;
- DBG(UPDATE, mnt_debug_h(upd, "%s: updating", filename));
+ DBG(UPDATE, mnt_debug_h(upd, "%s: updating", upd->filename));
- fd = mnt_open_uniq_filename(filename, &uq, O_WRONLY);
+ fd = mnt_open_uniq_filename(upd->filename, &uq, O_WRONLY);
if (fd < 0)
return fd; /* error */
fd = fileno(f);
rc = fchmod(fd, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) ? -errno : 0;
- if (!rc &&stat(filename, &st) == 0)
+ if (!rc && stat(upd->filename, &st) == 0)
/* Copy uid/gid from the present file before renaming. */
rc = fchown(fd, st.st_uid, st.st_gid) ? -errno : 0;
fclose(f);
- rc = rename(uq, filename) ? -errno : 0;
+ rc = rename(uq, upd->filename) ? -errno : 0;
} else {
rc = -errno;
close(fd);
}
}
-static int update_add_entry(mnt_update *upd, const char *filename, mnt_lock *lc)
+static int update_add_entry(mnt_update *upd, mnt_lock *lc)
{
FILE *f;
int rc = 0, u_lc = -1;
assert(upd);
assert(upd->fs);
- DBG(UPDATE, mnt_debug_h(upd, "%s: add entry", filename));
+ DBG(UPDATE, mnt_debug_h(upd, "%s: add entry", upd->filename));
if (lc)
mnt_lock_file(lc);
else if (upd->userspace_only)
- u_lc = utab_lock(filename);
+ u_lc = utab_lock(upd->filename);
- f = fopen(filename, "a+");
+ f = fopen(upd->filename, "a+");
if (f) {
rc = upd->userspace_only ? fprintf_utab_fs(f, upd->fs) :
fprintf_mtab_fs(f, upd->fs);
- DBG(UPDATE, mnt_debug_h(upd, "%s: add [rc=%d]", filename, rc));
+ DBG(UPDATE, mnt_debug_h(upd, "%s: add [rc=%d]", upd->filename, rc));
fclose(f);
} else {
- DBG(UPDATE, mnt_debug_h(upd, "%s: failed: %m", filename));
+ DBG(UPDATE, mnt_debug_h(upd, "%s: failed: %m", upd->filename));
rc = -errno;
}
if (lc)
return rc;
}
-static int update_remove_entry(mnt_update *upd, const char *filename, mnt_lock *lc)
+static int update_remove_entry(mnt_update *upd, mnt_lock *lc)
{
mnt_tab *tb;
int rc = 0, u_lc = -1;
assert(upd);
assert(upd->target);
- DBG(UPDATE, mnt_debug_h(upd, "%s: remove entry", filename));
+ DBG(UPDATE, mnt_debug_h(upd, "%s: remove entry", upd->filename));
if (lc)
mnt_lock_file(lc);
else if (upd->userspace_only)
- u_lc = utab_lock(filename);
+ u_lc = utab_lock(upd->filename);
- tb = __mnt_new_tab_from_file(filename,
+ tb = __mnt_new_tab_from_file(upd->filename,
upd->userspace_only ? MNT_FMT_UTAB : MNT_FMT_MTAB);
if (tb) {
mnt_fs *rem = mnt_tab_find_target(tb, upd->target, MNT_ITER_BACKWARD);
if (rem) {
mnt_tab_remove_fs(tb, rem);
- rc = update_tab(upd, filename, tb);
+ rc = update_tab(upd, tb);
mnt_free_fs(rem);
}
mnt_free_tab(tb);
return rc;
}
-static int update_modify_target(mnt_update *upd, const char *filename, mnt_lock *lc)
+static int update_modify_target(mnt_update *upd, mnt_lock *lc)
{
mnt_tab *tb = NULL;
int rc = 0, u_lc = -1;
- DBG(UPDATE, mnt_debug_h(upd, "%s: modify target", filename));
+ DBG(UPDATE, mnt_debug_h(upd, "%s: modify target", upd->filename));
if (lc)
mnt_lock_file(lc);
else if (upd->userspace_only)
- u_lc = utab_lock(filename);
+ u_lc = utab_lock(upd->filename);
- tb = __mnt_new_tab_from_file(filename,
+ tb = __mnt_new_tab_from_file(upd->filename,
upd->userspace_only ? MNT_FMT_UTAB : MNT_FMT_MTAB);
if (tb) {
mnt_fs *cur = mnt_tab_find_target(tb, upd->target, MNT_ITER_BACKWARD);
if (cur) {
rc = mnt_fs_set_target(cur, mnt_fs_get_target(upd->fs));
if (!rc)
- rc = update_tab(upd, filename, tb);
+ rc = update_tab(upd, tb);
}
mnt_free_tab(tb);
}
return rc;
}
-static int update_modify_options(mnt_update *upd, const char *filename, mnt_lock *lc)
+static int update_modify_options(mnt_update *upd, mnt_lock *lc)
{
mnt_tab *tb = NULL;
int rc = 0, u_lc = -1;
assert(upd);
assert(upd->fs);
- DBG(UPDATE, mnt_debug_h(upd, "%s: modify options", filename));
+ DBG(UPDATE, mnt_debug_h(upd, "%s: modify options", upd->filename));
if (lc)
mnt_lock_file(lc);
else if (upd->userspace_only)
- u_lc = utab_lock(filename);
+ u_lc = utab_lock(upd->filename);
- tb = __mnt_new_tab_from_file(filename,
+ tb = __mnt_new_tab_from_file(upd->filename,
upd->userspace_only ? MNT_FMT_UTAB : MNT_FMT_MTAB);
if (tb) {
mnt_fs *cur = mnt_tab_find_target(tb,
if (cur) {
rc = mnt_fs_set_optstr(cur, mnt_fs_get_optstr(upd->fs));
if (!rc)
- rc = update_tab(upd, filename, tb);
+ rc = update_tab(upd, tb);
}
mnt_free_tab(tb);
}
/**
* mnt_update_tab:
- * @filename: mtab of utab filename
* @lc: lock
*
- * High-level API to update /etc/mtab or /dev/.mount/utab.
+ * High-level API to update /etc/mtab (or private /dev/.mount/utab file).
*
* Returns: 0 on success, negative number on error.
*/
-int mnt_update_tab(mnt_update *upd, const char *filename, mnt_lock *lc)
+int mnt_update_tab(mnt_update *upd, mnt_lock *lc)
{
int rc = -EINVAL;
assert(upd);
- assert(filename);
-
- DBG(UPDATE, mnt_debug_h(upd, "%s: update tab", filename));
- if (!filename || !upd)
+ if (!upd->filename || !upd)
return -EINVAL;
if (!upd->ready)
return 0;
+ DBG(UPDATE, mnt_debug_h(upd, "%s: update tab", upd->filename));
+
if (!upd->fs && upd->target)
- rc = update_remove_entry(upd, filename, lc); /* umount */
+ rc = update_remove_entry(upd, lc); /* umount */
else if (upd->mountflags & MS_MOVE)
- rc = update_modify_target(upd, filename, lc); /* move */
+ rc = update_modify_target(upd, lc); /* move */
else if (upd->mountflags & MS_REMOUNT)
- rc = update_modify_options(upd, filename, lc); /* remount */
+ rc = update_modify_options(upd, lc); /* remount */
else if (upd->fs)
- rc = update_add_entry(upd, filename, lc); /* mount */
+ rc = update_add_entry(upd, lc); /* mount */
upd->ready = FALSE;
- DBG(UPDATE, mnt_debug_h(upd, "%s: update tab: done [rc=%d]", filename, rc));
+ DBG(UPDATE, mnt_debug_h(upd, "%s: update tab: done [rc=%d]",
+ upd->filename, rc));
return rc;
}
int rc, writable = 0;
const char *filename = NULL;
mnt_update *upd;
- mnt_lock *lock = NULL;
DBG(UPDATE, mnt_debug("update test"));
rc = mnt_has_regular_mtab(&filename, &writable);
if (rc && writable) {
- upd = mnt_new_update(FALSE);
+ /* normal mtab, lock required */
lock = mnt_new_lock(filename, 0);
-
- /* note that proper solution is to call mnt_unlock_file() from
- * signal handler. The atexit() could be ignore if program ends
- * by _exit(). The _exit() function is usually used in signal
- * handlers.
- */
- atexit(lock_fallback);
-
- } else {
- filename = NULL;
- rc = mnt_has_regular_utab(&filename, &writable);
-
- if (rc && writable)
- upd = mnt_new_update(TRUE);
- else {
- fprintf(stderr, "utab useless: %m\n");
- return -1;
- }
+ if (lock)
+ atexit(lock_fallback);
}
+ upd = mnt_new_update();
+ if (!upd)
+ return -ENOMEM;
rc = mnt_update_set_fs(upd, mountflags, target, fs);
if (rc == 1) {
/* [... here should be mount(2) call ...] */
- rc = mnt_update_tab(upd, filename, lock);
+ rc = mnt_update_tab(upd, lock);
done:
return rc;
}
return 0;
}
-/**
- *
- * mnt_has_regular_utab:
- * @utab: returns path to utab (usually /dev/.mount/utab)
- * @writable: returns 1 if the file is writable
+/*
+ * Don't export this to libmount API -- utab is private library stuff.
*
* If the file does not exist and @writable argument is not NULL then it will
* try to create the directory (e.g. /dev/.mount) and the file.
return p ? : _PATH_MOUNTED;
}
-/**
- * mnt_get_utab_path:
- *
- * This function returns *default* location of the utab file.
+/*
+ * Don't export this to libmount API -- utab is private library stuff.
*
* Returns: path to /dev/.mount/utab or $LIBMOUNT_UTAB.
*/
target: /proc
fstype: proc
optstr: rw,relatime
+root: /
id: 15
parent: 20
devno: 0:3
target: /sys
fstype: sysfs
optstr: rw,relatime
+root: /
id: 16
parent: 20
devno: 0:15
target: /dev
fstype: devtmpfs
optstr: rw,relatime,size=1983516k,nr_inodes=495879,mode=755
+root: /
id: 17
parent: 20
devno: 0:5
target: /dev/pts
fstype: devpts
optstr: rw,relatime,gid=5,mode=620,ptmxmode=000
+root: /
id: 18
parent: 17
devno: 0:10
target: /dev/shm
fstype: tmpfs
optstr: rw,relatime
+root: /
id: 19
parent: 17
devno: 0:16
target: /
fstype: ext3
optstr: rw,noatime,errors=continue,user_xattr,acl,barrier=0,data=ordered
+root: /
id: 20
parent: 1
devno: 8:4
target: /sys/fs/cgroup
fstype: tmpfs
optstr: rw,nosuid,nodev,noexec,relatime,mode=755
+root: /
id: 21
parent: 16
devno: 0:17
target: /sys/fs/cgroup/systemd
fstype: cgroup
optstr: rw,nosuid,nodev,noexec,relatime,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd
+root: /
id: 22
parent: 21
devno: 0:18
target: /sys/fs/cgroup/cpuset
fstype: cgroup
optstr: rw,nosuid,nodev,noexec,relatime,cpuset
+root: /
id: 23
parent: 21
devno: 0:19
target: /sys/fs/cgroup/ns
fstype: cgroup
optstr: rw,nosuid,nodev,noexec,relatime,ns
+root: /
id: 24
parent: 21
devno: 0:20
target: /sys/fs/cgroup/cpu
fstype: cgroup
optstr: rw,nosuid,nodev,noexec,relatime,cpu
+root: /
id: 25
parent: 21
devno: 0:21
target: /sys/fs/cgroup/cpuacct
fstype: cgroup
optstr: rw,nosuid,nodev,noexec,relatime,cpuacct
+root: /
id: 26
parent: 21
devno: 0:22
target: /sys/fs/cgroup/memory
fstype: cgroup
optstr: rw,nosuid,nodev,noexec,relatime,memory
+root: /
id: 27
parent: 21
devno: 0:23
target: /sys/fs/cgroup/devices
fstype: cgroup
optstr: rw,nosuid,nodev,noexec,relatime,devices
+root: /
id: 28
parent: 21
devno: 0:24
target: /sys/fs/cgroup/freezer
fstype: cgroup
optstr: rw,nosuid,nodev,noexec,relatime,freezer
+root: /
id: 29
parent: 21
devno: 0:25
target: /sys/fs/cgroup/net_cls
fstype: cgroup
optstr: rw,nosuid,nodev,noexec,relatime,net_cls
+root: /
id: 30
parent: 21
devno: 0:26
target: /sys/fs/cgroup/blkio
fstype: cgroup
optstr: rw,nosuid,nodev,noexec,relatime,blkio
+root: /
id: 31
parent: 21
devno: 0:27
target: /sys/kernel/security
fstype: autofs
optstr: rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
+root: /
id: 32
parent: 16
devno: 0:28
target: /dev/hugepages
fstype: autofs
optstr: rw,relatime,fd=23,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
+root: /
id: 33
parent: 17
devno: 0:29
target: /sys/kernel/debug
fstype: autofs
optstr: rw,relatime,fd=24,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
+root: /
id: 34
parent: 16
devno: 0:30
target: /proc/sys/fs/binfmt_misc
fstype: autofs
optstr: rw,relatime,fd=25,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
+root: /
id: 35
parent: 15
devno: 0:31
target: /dev/mqueue
fstype: autofs
optstr: rw,relatime,fd=26,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
+root: /
id: 36
parent: 17
devno: 0:32
target: /proc/bus/usb
fstype: usbfs
optstr: rw,relatime
+root: /
id: 37
parent: 15
devno: 0:14
target: /dev/hugepages
fstype: hugetlbfs
optstr: rw,relatime
+root: /
id: 38
parent: 33
devno: 0:33
target: /dev/mqueue
fstype: mqueue
optstr: rw,relatime
+root: /
id: 39
parent: 36
devno: 0:12
target: /boot
fstype: ext3
optstr: rw,noatime,errors=continue,barrier=0,data=ordered
+root: /
id: 40
parent: 20
devno: 8:6
target: /home/kzak
fstype: ext4
optstr: rw,noatime,barrier=1,data=ordered
+root: /
id: 41
parent: 20
devno: 253:0
target: /proc/sys/fs/binfmt_misc
fstype: binfmt_misc
optstr: rw,relatime
+root: /
id: 42
parent: 35
devno: 0:34
target: /sys/fs/fuse/connections
fstype: fusectl
optstr: rw,relatime
+root: /
id: 43
parent: 16
devno: 0:35
target: /home/kzak/.gvfs
fstype: fuse.gvfs-fuse-daemon
optstr: rw,nosuid,nodev,relatime,user_id=500,group_id=500
+root: /
id: 44
parent: 41
devno: 0:36
target: /var/lib/nfs/rpc_pipefs
fstype: rpc_pipefs
optstr: rw,relatime
+root: /
id: 45
parent: 20
devno: 0:37
target: /mnt/sounds
fstype: cifs
optstr: rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344
+root: /
id: 47
parent: 20
devno: 0:38
-0 0 0:0 / /mnt/bar user - ext3 /dev/sdb1 none
-0 0 0:0 / /mnt/xyz loop=/dev/loop0,uhelper=hal - ext3 /dev/sda2 none
+SRC=/dev/sdb1 TARGET=/mnt/bar ROOT=/ OPTS=user
+SRC=/dev/sda2 TARGET=/mnt/xyz ROOT=/ OPTS=loop=/dev/loop0,uhelper=hal
-0 0 0:0 / /mnt/newbar user - ext3 /dev/sdb1 none
-0 0 0:0 / /mnt/newxyz loop=/dev/loop0,uhelper=hal - ext3 /dev/sda2 none
+SRC=/dev/sdb1 TARGET=/mnt/newbar ROOT=/ OPTS=user
+SRC=/dev/sda2 TARGET=/mnt/newxyz ROOT=/ OPTS=loop=/dev/loop0,uhelper=hal
-0 0 0:0 / /mnt/newbar user - ext3 /dev/sdb1 none
-0 0 0:0 / /mnt/newxyz user - ext3 /dev/sda2 none
+SRC=/dev/sdb1 TARGET=/mnt/newbar ROOT=/ OPTS=user
+SRC=/dev/sda2 TARGET=/mnt/newxyz ROOT=/ OPTS=user
-0 0 0:0 / /mnt/newxyz user - ext3 /dev/sda2 none
+SRC=/dev/sda2 TARGET=/mnt/newxyz ROOT=/ OPTS=user
# Traditional /etc/mtab
#
export LIBMOUNT_MTAB=$TS_OUTPUT.mtab
+rm -f $LIBMOUNT_MTAB
> $LIBMOUNT_MTAB
ts_init_subtest "mtab-mount"
ln -s /proc/mounts $LIBMOUNT_MTAB
export LIBMOUNT_UTAB=$TS_OUTPUT.utab
+rm -f $LIBMOUNT_UTAB
> $LIBMOUNT_UTAB
ts_init_subtest "utab-mount"