mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
auth/factotum: mount factotum onto /mnt/factotum instead of /mnt by default
Factotum used to mount itself on /mnt and serving the first-level directory "factotum" itself. This has the undesired consequence that it has to respond to all walks crossing the /mnt directory. Instead, we make factotum interpret the previously ignored mount-spec (aname). If it is "factotum", it serves the factotum directory as the root, so it can be directly mounted onto /mnt/factotum. For backwards compatibility, the old behaviour is preserved. The namespace file will now always mount factotum onto /mnt/factotum. In the case of a old factotum, that ignores the mount-spec, do a bind moving /mnt/factotum/factotum to /mnt/factotum.
This commit is contained in:
parent
0676a1ba51
commit
4ed03dff93
5 changed files with 38 additions and 16 deletions
|
@ -12,14 +12,15 @@ bind -qa #¶ /dev
|
|||
mount -C /srv/boot /root $rootspec
|
||||
bind -a $rootdir /
|
||||
|
||||
# authentication
|
||||
mount -b /srv/factotum /mnt
|
||||
|
||||
# mount points
|
||||
mount -a /srv/slashn /n
|
||||
mount -a /srv/slashmnt /mnt
|
||||
mount -a /srv/mntexport /mnt/exportfs
|
||||
|
||||
# authentication
|
||||
mount /srv/factotum /mnt/factotum factotum
|
||||
bind -q /mnt/factotum/factotum /mnt/factotum
|
||||
|
||||
# standard bin
|
||||
bind /$cputype/bin /bin
|
||||
bind $rootdir/rc /rc
|
||||
|
|
|
@ -17,11 +17,9 @@ mntgen -s slashn /n && chmod 666 /srv/slashn
|
|||
mntgen -s slashmnt /mnt && chmod 666 /srv/slashmnt
|
||||
mntgen -s mntexport /mnt/exportfs && chmod 666 /srv/mntexport}
|
||||
|
||||
# move factotum from /mnt to /mnt/factotum
|
||||
mount /srv/factotum /mnt/temp
|
||||
unmount /srv/factotum /mnt
|
||||
bind /mnt/temp/factotum /mnt/factotum
|
||||
unmount /mnt/temp
|
||||
# now that /mnt exists, mount factotum
|
||||
mount /srv/factotum /mnt/factotum factotum
|
||||
bind -q /mnt/factotum/factotum /mnt/factotum
|
||||
|
||||
# usb listener
|
||||
nusbrc
|
||||
|
|
|
@ -18,11 +18,9 @@ mntgen -s slashn /n && chmod 666 /srv/slashn
|
|||
mntgen -s slashmnt /mnt && chmod 666 /srv/slashmnt
|
||||
mntgen -s mntexport /mnt/exportfs && chmod 666 /srv/mntexport}
|
||||
|
||||
# move factotum from /mnt to /mnt/factotum
|
||||
mount /srv/factotum /mnt/temp
|
||||
unmount /srv/factotum /mnt
|
||||
bind /mnt/temp/factotum /mnt/factotum
|
||||
unmount /mnt/temp
|
||||
# now that /mnt exists, mount factotum
|
||||
mount /srv/factotum /mnt/factotum factotum
|
||||
bind -q /mnt/factotum/factotum /mnt/factotum
|
||||
|
||||
# usb listener
|
||||
nusbrc
|
||||
|
|
|
@ -741,3 +741,16 @@ is the reason for the error.
|
|||
.B /sys/src/cmd/auth/factotum
|
||||
.SH "SEE ALSO"
|
||||
.IR authsrv (6)
|
||||
.SH "HISTORY"
|
||||
Since November 2024,
|
||||
.I auth/factotum
|
||||
understand the previously ignored
|
||||
mount specifier
|
||||
.BR factotum ,
|
||||
causing it to serve the second-level directory
|
||||
as the root of the file-system.
|
||||
This allows directly mounting it on
|
||||
.BR /mnt/factotum ,
|
||||
avoiding the need to respond to walks
|
||||
passing over
|
||||
.BR /mnt .
|
||||
|
|
|
@ -7,7 +7,7 @@ int doprivate = 1;
|
|||
int gflag;
|
||||
char *owner;
|
||||
int kflag;
|
||||
char *mtpt = "/mnt";
|
||||
char *mtpt = nil;
|
||||
Keyring *ring;
|
||||
char *service;
|
||||
int sflag;
|
||||
|
@ -153,7 +153,12 @@ main(int argc, char **argv)
|
|||
promptforhostowner();
|
||||
owner = getuser();
|
||||
|
||||
postmountsrv(&fs, service, mtpt, MBEFORE);
|
||||
if(mtpt == nil){
|
||||
mtpt = "/mnt";
|
||||
mount(postsrv(&fs, service), -1, "/mnt/factotum", MREPL, "factotum");
|
||||
} else {
|
||||
mount(postsrv(&fs, service), -1, mtpt, MBEFORE, "");
|
||||
}
|
||||
if(service){
|
||||
nulldir(&d);
|
||||
d.mode = 0666;
|
||||
|
@ -236,7 +241,14 @@ mkqid(int type, int path)
|
|||
static void
|
||||
fsattach(Req *r)
|
||||
{
|
||||
if(strcmp(r->ifcall.aname, "factotum") == 0)
|
||||
r->fid->qid = mkqid(QTDIR, Qfactotum);
|
||||
else if(*r->ifcall.aname == 0)
|
||||
r->fid->qid = mkqid(QTDIR, Qroot);
|
||||
else {
|
||||
respond(r, "unknown mount spec");
|
||||
return;
|
||||
}
|
||||
r->ofcall.qid = r->fid->qid;
|
||||
respond(r, nil);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue