From cse.psu.edu!9fans-outgoing-owner Thu May 9 18:32:08 1996 Received: from colossus.cse.psu.edu ([130.203.1.2]) by cannon.ecf.toronto.edu with SMTP id <10133>; Thu, 9 May 1996 18:32:04 -0400 Received: by colossus.cse.psu.edu id <78951>; Thu, 9 May 1996 18:23:40 -0400 Received: from Draculina.nns.ru ([194.135.102.2]) by colossus.cse.psu.edu with SMTP id <78950>; Thu, 9 May 1996 18:23:23 -0400 Received: from Alyona.office.nns.ru (Alyona.office.nns.ru [192.168.1.3]) by Draculina.nns.ru (8.7.3/8.7.3) with ESMTP id CAA29086 for <9fans@cse.psu.edu>; Fri, 10 May 1996 02:22:45 +0400 (MSD) Received: from Alyona.office.nns.ru (localhost [127.0.0.1]) by Alyona.office.nns.ru (8.7.3/8.7.3) with ESMTP id CAA16044 for <9fans@cse.psu.edu>; Fri, 10 May 1996 02:22:44 +0400 (MSD) To: 9fans@cse.psu.edu (Plan 9 from Bell Labs fans) Subject: Small patch for kfs to show free space on disk MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16041.831680564.1@Alyona.office.nns.ru> Date: Thu, 9 May 1996 18:22:44 -0400 Message-ID: <16042.831680564@Alyona.office.nns.ru> From: Nickolay Saukh Sender: owner-9fans@cse.psu.edu Precedence: bulk Reply-To: 9fans@cse.psu.edu Status: RO Here is small patch for /sys/src/cmd/disk/kfs/con.c which allows to get the following numbers from kfs number of free blocks file system size in blocks block size Don't forget rebuild kernel (9pcdisk for PCs). ---------- cut here to destroy your CRT ---------- 417a "free", cmd_free, "", . 408a void cmd_free(void) { Iobuf *p; Superb *s; p = getbuf(cur_fs->dev, superaddr(cur_fs->dev), Bread); s = (Superb*) p->iobuf; cprint("%ld %ld %d\n", s->tfree, s->fsize, RBUFSIZE); putbuf(p); } . ---------- cut here to destroy your CRT ---------- From: miller@hamnavoe.demon.co.uk To: 9fans@cse.psu.edu Date: Sat, 2 May 1998 10:48:14 BST Subject: Re: [9fans] more secure kfs Sender: owner-9fans@cse.psu.edu Reply-To: 9fans@cse.psu.edu Kenji Arisawa asks: > Does anyone has a patch to kfs that enables more secure kfs? > > I would like to prohibit some kfs commands by the user who is > not the owner of /dev/hd0* It's simple to prohibit *all* kfs commands except from hostowner, by changing main.c as shown below. A filter program could then be started from cpurc to accept commands on another /srv file and pass the safe ones (sync?) to /srv.kfs [left as an exercise for the reader]. ========================================== diff /sys/src/cmd/disk/kfs/main.c main.c 11c11 < int srvfd(char*, int); --- > int srvfd(char*, int, int); 296c296 < srvfd(buf, p[0]); --- > srvfd(buf, p[0], 0600); 398c398 < srvfd(buf, sfd); --- > srvfd(buf, sfd, 0666); 412c412 < srvfd(char *s, int sfd) --- > srvfd(char *s, int sfd, int perm) 417c417 < fd = create(s, OWRITE, 0666); --- > fd = create(s, OWRITE, perm); 420c420 < fd = create(s, OWRITE, 0666); --- > fd = create(s, OWRITE, perm); ========================================== -- Richard Miller