[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Permissions in / are 777
Frank Bartels wrote:
> > > It is possible to create or remove links from u:/ as normal user.
> ^^^^^!
Does this cure your problem? :)
ciao,
TeSche
--
Torsten Scherer (TeSche, Schiller...), itschere@techfak.uni-bielefeld.de
Faculty of Technology, University of Bielefeld, Germany, Europe, Earth...
| Use any of "finger itschere@129.70.131.2-15" for adresses and more. |
| Last updated: 31. July 1994. |
--- unifs.c.orig Sun Aug 14 12:24:20 1994
+++ unifs.c Sun Aug 14 15:21:14 1994
@@ -63,6 +63,7 @@
FILESYS *fs;
void *data;
struct unifile *next;
+ short cdate, ctime;
} UNIFILE;
static UNIFILE u_drvs[UNI_NUM_DRVS];
@@ -93,6 +94,8 @@
u->next = u+1;
u->mode = S_IFDIR|DEFAULT_DIRMODE;
u->dev = i;
+ u->cdate = datestamp;
+ u->ctime = timestamp;
if (i == PROCDRV) {
strcpy(u->name, "proc");
u->fs = &proc_filesys;
@@ -237,8 +240,8 @@
xattr->mode = u->mode;
xattr->attr = 0;
}
- xattr->mtime = xattr->atime = xattr->ctime = 0;
- xattr->mdate = xattr->adate = xattr->cdate = 0;
+ xattr->mtime = xattr->atime = xattr->ctime = u->ctime;
+ xattr->mdate = xattr->adate = xattr->cdate = u->cdate;
return 0;
}
@@ -297,6 +300,8 @@
while (u) {
if (!strnicmp(u->name, name, NAME_MAX)) {
if ( (u->mode & S_IFMT) != S_IFLNK ) return EFILNF;
+ if (curproc->euid && (u->dev != curproc->euid))
+ return EACCDN;
kfree(u->data);
if (lastu)
lastu->next = u->next;
@@ -612,6 +617,9 @@
}
if (r != EFILNF) return r; /* some other error */
+ if (curproc->egid)
+ return EACCDN; /* only members of admin group may do that */
+
u = kmalloc(SIZEOF(UNIFILE));
if (!u) return EACCDN;
@@ -625,9 +633,11 @@
}
strcpy(u->data, to);
u->mode = S_IFLNK | DEFAULT_DIRMODE;
- u->dev = curproc->ruid;
+ u->dev = curproc->euid;
u->next = u_root;
u->fs = &uni_filesys;
+ u->cdate = datestamp;
+ u->ctime = timestamp;
u_root = u;
return 0;
}