SCCS-vsn: sbin/mount/mount.c 8.21
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)mount.c 8.20 (Berkeley) %G%";
+static char sccsid[] = "@(#)mount.c 8.21 (Berkeley) %G%";
#endif /* not lint */
#include <sys/param.h>
#endif /* not lint */
#include <sys/param.h>
#include <err.h>
#include <errno.h>
#include <fstab.h>
#include <err.h>
#include <errno.h>
#include <fstab.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
void mangle __P((char *, int *, const char **));
int mountfs __P((const char *, const char *, const char *,
int, const char *, const char *));
void mangle __P((char *, int *, const char **));
int mountfs __P((const char *, const char *, const char *,
int, const char *, const char *));
-void prmount __P((const char *, const char *, int));
+void prmount __P((struct statfs *));
void usage __P((void));
/* From mount_ufs.c. */
void usage __P((void));
/* From mount_ufs.c. */
{ MNT_RDONLY, "read-only" },
{ MNT_SYNCHRONOUS, "synchronous" },
{ MNT_UNION, "union" },
{ MNT_RDONLY, "read-only" },
{ MNT_SYNCHRONOUS, "synchronous" },
{ MNT_UNION, "union" },
- { MNT_USER, "user mount" },
for (i = 0; i < mntsize; i++) {
if (badvfstype(mntbuf[i].f_type, vfslist))
continue;
for (i = 0; i < mntsize; i++) {
if (badvfstype(mntbuf[i].f_type, vfslist))
continue;
- prmount(mntbuf[i].f_mntfromname,
- mntbuf[i].f_mntonname, mntbuf[i].f_flags);
warn("statfs %s", name);
return (1);
}
warn("statfs %s", name);
return (1);
}
- prmount(sf.f_mntfromname, sf.f_mntonname, sf.f_flags);
-prmount(spec, name, flags)
- const char *spec, *name;
- int flags;
+prmount(sfp)
+ struct statfs *sfp;
- (void)printf("%s on %s", spec, name);
+ (void)printf("%s on %s", sfp->f_mntfromname, sfp->f_mntonname);
- flags &= MNT_VISFLAGMASK;
+ flags = sfp->f_flags & MNT_VISFLAGMASK;
for (f = 0, o = optnames; flags && o->o_opt; o++)
if (flags & o->o_opt) {
(void)printf("%s%s", !f++ ? " (" : ", ", o->o_name);
flags &= ~o->o_opt;
}
for (f = 0, o = optnames; flags && o->o_opt; o++)
if (flags & o->o_opt) {
(void)printf("%s%s", !f++ ? " (" : ", ", o->o_name);
flags &= ~o->o_opt;
}
+ if (sfp->f_owner) {
+ (void)printf("%smounted by ", !f++ ? " (" : ", ");
+ if ((pw = getpwuid(sfp->f_owner)) != NULL)
+ (void)printf("%s", pw->pw_name);
+ else
+ (void)printf("%d", sfp->f_owner);
+ }
(void)printf(f ? ")\n" : "\n");
}
(void)printf(f ? ")\n" : "\n");
}