a couple fixes. Add support for muFS (multi-user adosfs). Default to
case-insesitive lookup. from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
This commit is contained in:
parent
ebe3db17a7
commit
85444a9a0b
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: adlookup.c,v 1.8 1994/10/29 07:58:24 cgd Exp $ */
|
||||
/* $NetBSD: adlookup.c,v 1.9 1994/12/28 08:51:56 chopps Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Christian E. Hopps
|
||||
@ -38,8 +38,31 @@
|
||||
#include <sys/queue.h>
|
||||
#include <adosfs/adosfs.h>
|
||||
|
||||
#ifdef ADOSFS_EXACTMATCH
|
||||
#define strmatch(s1, l1, s2, l2) \
|
||||
((l1) == (l2) && bcmp((s1), (s2), (l1)) == 0)
|
||||
#else
|
||||
int
|
||||
strmatch(s1, l1, s2, l2)
|
||||
char *s1, *s2;
|
||||
int l1, l2;
|
||||
{
|
||||
if (l1 != l2)
|
||||
return 0;
|
||||
while (--l1 >= 0) {
|
||||
char c;
|
||||
c = *s1++;
|
||||
if (c != *s2) {
|
||||
if (c >= 'A' && c <= 'Z' && c + ('a' - 'A') != *s2)
|
||||
return 0;
|
||||
if (c >= 'a' && c <= 'z' && c + ('A' - 'a') != *s2)
|
||||
return 0;
|
||||
}
|
||||
++s2;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* adosfs lookup. enters with:
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: adosfs.h,v 1.5 1994/07/11 05:07:38 chopps Exp $ */
|
||||
/* $NetBSD: adosfs.h,v 1.6 1994/12/28 08:51:59 chopps Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Christian E. Hopps
|
||||
@ -72,6 +72,8 @@ struct anode {
|
||||
int ntabent; /* (r/d) number of entries in table */
|
||||
int nwords; /* size of blocks in long words */
|
||||
int adprot; /* (d/f) amigados protection bits */
|
||||
uid_t uid; /* (d/f) uid of directory/file */
|
||||
gid_t gid; /* (d/f) gid of directory/file */
|
||||
int flags; /* misc flags */
|
||||
char *slinkto; /* name of file or dir */
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: adutil.c,v 1.5 1994/06/29 06:29:29 cgd Exp $ */
|
||||
/* $NetBSD: adutil.c,v 1.6 1994/12/28 08:52:01 chopps Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Christian E. Hopps
|
||||
@ -132,8 +132,15 @@ int
|
||||
adunixprot(adprot)
|
||||
int adprot;
|
||||
{
|
||||
adprot = (~adprot >> 1) & 0x7;
|
||||
return((adprot << 6) | (adprot << 3) | adprot);
|
||||
if (adprot & 0xc000ee00) {
|
||||
adprot = ((adprot & 0xee00) | (~adprot & 0x000e)) >> 1;
|
||||
return (((adprot & 0x7) << 6) | ((adprot & 0x700) >> 5) |
|
||||
(adprot >> 12));
|
||||
}
|
||||
else {
|
||||
adprot = (~adprot >> 1) & 0x7;
|
||||
return((adprot << 6) | (adprot << 3) | adprot);
|
||||
}
|
||||
}
|
||||
|
||||
static char
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: advfsops.c,v 1.7 1994/12/15 20:48:56 mycroft Exp $ */
|
||||
/* $NetBSD: advfsops.c,v 1.8 1994/12/28 08:52:04 chopps Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Christian E. Hopps
|
||||
@ -134,7 +134,8 @@ adosfs_mountfs(mp, path, bdvp, args, p)
|
||||
amp->bsize = dl.d_secsize;
|
||||
amp->nwords = amp->bsize >> 2;
|
||||
amp->devvp = bdvp;
|
||||
amp->rootb = (parp->p_size - 1 + 2) >> 1;
|
||||
/* amp->rootb = (parp->p_size - 1 + 2) >> 1;*/
|
||||
amp->rootb = (parp->p_size - 1 + parp->p_cpg) >> 1;
|
||||
amp->uid = args->uid; /* XXX check? */
|
||||
amp->gid = args->gid; /* XXX check? */
|
||||
amp->mask = args->mask;
|
||||
@ -413,10 +414,34 @@ adosfs_vget(mp, an, vpp)
|
||||
else if (ap->type == ALFILE)
|
||||
ap->lastindblk = ap->linkto;
|
||||
|
||||
if (ap->type == AROOT)
|
||||
if (ap->type == AROOT) {
|
||||
ap->adprot = 0;
|
||||
else
|
||||
ap->uid = amp->uid;
|
||||
ap->gid = amp->gid;
|
||||
} else {
|
||||
ap->adprot = adoswordn(bp, ap->nwords - 48);
|
||||
/*
|
||||
* Get uid/gid from extensions in file header
|
||||
* (really need to know if this is a muFS partition)
|
||||
*/
|
||||
ap->uid = (adoswordn(bp, ap->nwords - 49) >> 16) & 0xffff;
|
||||
ap->gid = adoswordn(bp, ap->nwords - 49) & 0xffff;
|
||||
if (ap->uid || ap->gid) {
|
||||
if (ap->uid == 0xffff)
|
||||
ap->uid = 0;
|
||||
if (ap->gid == 0xffff)
|
||||
ap->gid = 0;
|
||||
ap->adprot |= 0x40000000; /* Kludge */
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* uid & gid extension don't exist,
|
||||
* so use the mount-point uid/gid
|
||||
*/
|
||||
ap->uid = amp->uid;
|
||||
ap->gid = amp->gid;
|
||||
}
|
||||
}
|
||||
ap->mtime.days = adoswordn(bp, ap->nwords - 23);
|
||||
ap->mtime.mins = adoswordn(bp, ap->nwords - 22);
|
||||
ap->mtime.ticks = adoswordn(bp, ap->nwords - 21);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: advnops.c,v 1.17 1994/12/27 19:06:16 mycroft Exp $ */
|
||||
/* $NetBSD: advnops.c,v 1.18 1994/12/28 08:52:06 chopps Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Christian E. Hopps
|
||||
@ -83,12 +83,16 @@ adosfs_getattr(sp)
|
||||
ap = VTOA(sp->a_vp);
|
||||
amp = ap->amp;
|
||||
vattr_null(vap);
|
||||
vap->va_uid = amp->uid;
|
||||
vap->va_gid = amp->gid;
|
||||
vap->va_uid = ap->uid;
|
||||
vap->va_gid = ap->gid;
|
||||
vap->va_fsid = sp->a_vp->v_mount->mnt_stat.f_fsid.val[0];
|
||||
microtime(&vap->va_atime);
|
||||
vap->va_mtime = vap->va_atime;
|
||||
vap->va_ctime = vap->va_ctime;
|
||||
vap->va_atime.ts_sec = vap->va_mtime.ts_sec = vap->va_ctime.ts_sec =
|
||||
ap->mtime.days * 24 * 60 * 60 + ap->mtime.mins * 60 +
|
||||
ap->mtime.ticks / 50 + (8 * 365 + 2) * 24 * 60 * 60;
|
||||
vap->va_atime.ts_nsec = vap->va_mtime.ts_nsec = vap->va_ctime.ts_nsec = 0;
|
||||
vap->va_gen = 0;
|
||||
vap->va_flags = 0;
|
||||
vap->va_rdev = NODEV;
|
||||
@ -447,7 +451,7 @@ adosfs_bmap(sp)
|
||||
/*
|
||||
* check last indirect block cache
|
||||
*/
|
||||
if (flblk > ap->lastlindblk)
|
||||
if (flblk < ap->lastlindblk)
|
||||
fcnt = 0;
|
||||
else {
|
||||
flblk -= ap->lastlindblk;
|
||||
@ -721,8 +725,8 @@ adosfs_access(sp)
|
||||
#endif
|
||||
#ifdef QUOTA
|
||||
#endif
|
||||
error = vaccess(adunixprot(ap->adprot) & ap->amp->mask, ap->amp->uid,
|
||||
ap->amp->gid, mode, cred);
|
||||
error = vaccess(adunixprot(ap->adprot) & ap->amp->mask, ap->uid,
|
||||
ap->gid, mode, cred);
|
||||
#ifdef ADOSFS_DIAGNOSTIC
|
||||
printf(" %d)", error);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user