From owner-freebsd-audit Tue Feb 20 0:19:20 2001 Delivered-To: freebsd-audit@freebsd.org Received: from critter.freebsd.dk (flutter.freebsd.dk [212.242.40.147]) by hub.freebsd.org (Postfix) with ESMTP id 2CF6537B401 for ; Tue, 20 Feb 2001 00:19:18 -0800 (PST) (envelope-from phk@critter.freebsd.dk) Received: from critter (localhost [127.0.0.1]) by critter.freebsd.dk (8.11.1/8.11.1) with ESMTP id f1K8JRx90434 for ; Tue, 20 Feb 2001 09:19:27 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: audit@freebsd.org Subject: update to the committer "big list of rules" From: Poul-Henning Kamp Date: Tue, 20 Feb 2001 09:19:27 +0100 Message-ID: <90432.982657167@critter> Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG It might be an idea if you guys negotiate a point 11 in the "The FreeBSD Committers' Big List of Rules" saying 11. Send your patches to audit@freebsd.org to get a review. URL: http://www.freebsd.org/tutorials/committers-guide/article.html -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Feb 20 5: 9:39 2001 Delivered-To: freebsd-audit@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 5D72637B401 for ; Tue, 20 Feb 2001 05:09:18 -0800 (PST) (envelope-from des@ofug.org) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id OAA34149; Tue, 20 Feb 2001 14:09:17 +0100 (CET) (envelope-from des@ofug.org) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: audit@freebsd.org Subject: MFC ftpd fixes to RELENG_3 From: Dag-Erling Smorgrav Date: 20 Feb 2001 14:09:16 +0100 Message-ID: Lines: 20 User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.4 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --=-=-= The attached patch attempts to MFC some of the changes in ftpd between RELENG_3 and HEAD. I started out with a full diff, then removed all PAM- and IPv6-related changes and restored the INTERNAL_LS conditional. The most notable changes (from a RELENG_3 point of view) are SKEY and Kerberos authentication fixes, addition of the -r (read-only) option, some anonftp fixes (e.g. chdir("/")), stricter checking of all commands (including refusing most of them before the user is logged in), "not a plain file" fixes, long user name support, and using sendfile(2). Note that the patch was made with diff -b, so applying it as-is will result in misindented code. The version I'll commit is properly indented. DES -- Dag-Erling Smorgrav - des@ofug.org --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=ftpd-mfc.diff Content-Description: patch Index: ftpcmd.y =================================================================== RCS file: /home/ncvs/src/libexec/ftpd/ftpcmd.y,v retrieving revision 1.13.2.1 diff -u -b -r1.13.2.1 ftpcmd.y --- ftpcmd.y 1999/08/29 15:03:11 1.13.2.1 +++ ftpcmd.y 2001/02/20 13:03:03 @@ -89,6 +89,7 @@ extern int usedefault; extern int transflag; extern char tmpline[]; +extern int readonly; off_t restart_point; @@ -127,6 +128,7 @@ %token NUMBER %type check_login octal_number byte_size +%type check_login_ro octal_number byte_size %type struct_code mode_code type_code form_code %type pathstring pathname password username @@ -182,8 +184,9 @@ if ($2) passive(); } - | TYPE SP type_code CRLF + | TYPE check_login SP type_code CRLF { + if ($2) { switch (cmd_type) { case TYPE_A: @@ -216,10 +219,12 @@ UNIMPLEMENTED for NBBY != 8 #endif /* NBBY == 8 */ } + } } - | STRU SP struct_code CRLF + | STRU check_login SP struct_code CRLF { - switch ($3) { + if ($2) { + switch ($4) { case STRU_F: reply(200, "STRU F ok."); @@ -229,9 +234,11 @@ reply(504, "Unimplemented STRU type."); } } - | MODE SP mode_code CRLF + } + | MODE check_login SP mode_code CRLF { - switch ($3) { + if ($2) { + switch ($4) { case MODE_S: reply(200, "MODE S ok."); @@ -240,15 +247,20 @@ default: reply(502, "Unimplemented MODE type."); } + } } - | ALLO SP NUMBER CRLF + | ALLO check_login SP NUMBER CRLF { + if ($2) { reply(202, "ALLO command ignored."); + } } - | ALLO SP NUMBER SP R SP NUMBER CRLF + | ALLO check_login SP NUMBER SP R SP NUMBER CRLF { + if ($2) { reply(202, "ALLO command ignored."); } + } | RETR check_login SP pathname CRLF { if ($2 && $4 != NULL) @@ -256,14 +268,14 @@ if ($4 != NULL) free($4); } - | STOR check_login SP pathname CRLF + | STOR check_login_ro SP pathname CRLF { if ($2 && $4 != NULL) store($4, "w", 0); if ($4 != NULL) free($4); } - | APPE check_login SP pathname CRLF + | APPE check_login_ro SP pathname CRLF { if ($2 && $4 != NULL) store($4, "a", 0); @@ -301,18 +313,20 @@ if ($4 != NULL) free($4); } - | STAT CRLF + | STAT check_login CRLF { + if ($2) { statcmd(); } - | DELE check_login SP pathname CRLF + } + | DELE check_login_ro SP pathname CRLF { if ($2 && $4 != NULL) delete($4); if ($4 != NULL) free($4); } - | RNTO check_login SP pathname CRLF + | RNTO check_login_ro SP pathname CRLF { if ($2) { if (fromname) { @@ -325,15 +339,20 @@ } free($4); } - | ABOR CRLF + | ABOR check_login CRLF { + if ($2) reply(225, "ABOR command successful."); } | CWD check_login CRLF { - if ($2) + if ($2) { + if (guest) + cwd("/"); + else cwd(pw->pw_dir); } + } | CWD check_login SP pathname CRLF { if ($2 && $4 != NULL) @@ -364,14 +383,14 @@ { reply(200, "NOOP command successful."); } - | MKD check_login SP pathname CRLF + | MKD check_login_ro SP pathname CRLF { if ($2 && $4 != NULL) makedir($4); if ($4 != NULL) free($4); } - | RMD check_login SP pathname CRLF + | RMD check_login_ro SP pathname CRLF { if ($2 && $4 != NULL) removedir($4); @@ -421,7 +440,7 @@ } } } - | SITE SP CHMOD check_login SP octal_number SP pathname CRLF + | SITE SP CHMOD check_login_ro SP octal_number SP pathname CRLF { if ($4 && ($8 != NULL)) { if ($6 > 0777) @@ -435,35 +454,39 @@ if ($8 != NULL) free($8); } - | SITE SP IDLE CRLF + | SITE SP check_login IDLE CRLF { + if ($3) reply(200, "Current IDLE time limit is %d seconds; max %d", timeout, maxtimeout); } - | SITE SP IDLE SP NUMBER CRLF + | SITE SP check_login IDLE SP NUMBER CRLF { - if ($5 < 30 || $5 > maxtimeout) { + if ($3) { + if ($6 < 30 || $6 > maxtimeout) { reply(501, "Maximum IDLE time must be between 30 and %d seconds", maxtimeout); } else { - timeout = $5; + timeout = $6; (void) alarm((unsigned) timeout); reply(200, "Maximum IDLE time set to %d seconds", timeout); } } - | STOU check_login SP pathname CRLF + } + | STOU check_login_ro SP pathname CRLF { if ($2 && $4 != NULL) store($4, "w", 1); if ($4 != NULL) free($4); } - | SYST CRLF + | SYST check_login CRLF { + if ($2) #ifdef unix #ifdef BSD reply(215, "UNIX Type: L%d Version: BSD-%d", @@ -533,7 +556,7 @@ } ; rcmd - : RNFR check_login SP pathname CRLF + : RNFR check_login_ro SP pathname CRLF { char *renamefrom(); @@ -545,13 +568,16 @@ } } } - | REST SP byte_size CRLF + | REST check_login SP byte_size CRLF { + if ($2) { fromname = (char *) 0; - restart_point = $3; /* XXX $3 is only "int" */ - reply(350, "Restarting at %qd. %s", restart_point, + restart_point = $4; /* XXX $4 is only "int" */ + reply(350, "Restarting at %qd. %s", + restart_point, "Send STORE or RETRIEVE to initiate transfer."); } + } ; username @@ -735,12 +761,19 @@ check_login : /* empty */ { - if (logged_in) - $$ = 1; - else { - reply(530, "Please login with USER and PASS."); + $$ = check_login1(); + } + ; + +check_login_ro + : /* empty */ + { + if (readonly) { + reply(550, "Permission denied."); $$ = 0; } + else + $$ = check_login1(); } ; @@ -1254,7 +1287,9 @@ case TYPE_L: case TYPE_I: { struct stat stbuf; - if (stat(filename, &stbuf) < 0 || !S_ISREG(stbuf.st_mode)) + if (stat(filename, &stbuf) < 0) + perror_reply(550, filename); + else if (!S_ISREG(stbuf.st_mode)) reply(550, "%s: not a plain file.", filename); else reply(213, "%qu", stbuf.st_size); @@ -1269,7 +1304,11 @@ perror_reply(550, filename); return; } - if (fstat(fileno(fin), &stbuf) < 0 || !S_ISREG(stbuf.st_mode)) { + if (fstat(fileno(fin), &stbuf) < 0) { + perror_reply(550, filename); + (void) fclose(fin); + return; + } else if (!S_ISREG(stbuf.st_mode)) { reply(550, "%s: not a plain file.", filename); (void) fclose(fin); return; @@ -1289,3 +1328,15 @@ reply(504, "SIZE not implemented for Type %c.", "?AEIL"[type]); } } + +static int +check_login1() +{ + if (logged_in) + return 1; + else { + reply(530, "Please login with USER and PASS."); + return 0; + } +} + Index: ftpd.8 =================================================================== RCS file: /home/ncvs/src/libexec/ftpd/ftpd.8,v retrieving revision 1.25.2.3 diff -u -b -r1.25.2.3 ftpd.8 --- ftpd.8 1999/08/29 15:03:12 1.25.2.3 +++ ftpd.8 2001/02/19 21:46:42 @@ -32,7 +32,7 @@ .\" @(#)ftpd.8 8.2 (Berkeley) 4/19/94 .\" $FreeBSD: src/libexec/ftpd/ftpd.8,v 1.25.2.3 1999/08/29 15:03:12 peter Exp $ .\" -.Dd April 19, 1994 +.Dd February 19, 2000 .Dt FTPD 8 .Os BSD 4.2 .Sh NAME @@ -48,6 +48,7 @@ .Op Fl R .Op Fl S .Op Fl U +.Op Fl r .Op Fl T Ar maxtimeout .Op Fl t Ar timeout .Op Fl a Ar address @@ -84,8 +85,8 @@ With this option set, .Nm will detach and become a daemon, accepting connections on the FTP port and -forking children processes to handle them. This is lower overhead than -starting +forking children processes to handle them. +This is lower overhead than starting .Nm from .Xr inetd 8 @@ -103,7 +104,7 @@ .It Fl S With this option set, .Nm -logs all anonymous transfers to the file +logs all anonymous file downloads to the file .Pa /var/log/ftpd when this file exists. .It Fl U @@ -137,6 +138,9 @@ .Ar file . .It Fl A Allow only anonymous ftp access. +.It Fl r +Put server in read-only mode. +All commands which may modify the local filesystem are disabled. .El .Pp The file @@ -162,20 +166,23 @@ in the anonymous user's case. .Pp The ftp server currently supports the following ftp requests. -The case of the requests is ignored. +The case of the requests is ignored. Requests marked [RW] are +disabled if +.Fl r +is specified. .Bl -column "Request" -offset indent .It Sy Request Ta Sy "Description" .It ABOR Ta "abort previous command" .It ACCT Ta "specify account (ignored)" .It ALLO Ta "allocate storage (vacuously)" -.It APPE Ta "append to a file" +.It APPE Ta "append to a file [RW]" .It CDUP Ta "change to parent of current working directory" .It CWD Ta "change working directory" -.It DELE Ta "delete a file" +.It DELE Ta "delete a file [RW]" .It HELP Ta "give help information" .It LIST Ta "give list files in a directory" Pq Dq Li "ls -lgA" -.It MKD Ta "make a directory" .It MDTM Ta "show last modification time of file" +.It MKD Ta "make a directory [RW]" .It MODE Ta "specify data transfer" Em mode .It NLST Ta "give name list of files in directory" .It NOOP Ta "do nothing" @@ -186,23 +193,23 @@ .It QUIT Ta "terminate session" .It REST Ta "restart incomplete transfer" .It RETR Ta "retrieve a file" -.It RMD Ta "remove a directory" -.It RNFR Ta "specify rename-from file name" -.It RNTO Ta "specify rename-to file name" +.It RMD Ta "remove a directory [RW]" +.It RNFR Ta "specify rename-from file name [RW]" +.It RNTO Ta "specify rename-to file name [RW]" .It SITE Ta "non-standard commands (see next section)" .It SIZE Ta "return size of file" .It STAT Ta "return status of server" -.It STOR Ta "store a file" -.It STOU Ta "store a file with a unique name" +.It STOR Ta "store a file [RW]" +.It STOU Ta "store a file with a unique name [RW]" .It STRU Ta "specify data transfer" Em structure .It SYST Ta "show operating system type of server system" .It TYPE Ta "specify data transfer" Em type .It USER Ta "specify user name" .It XCUP Ta "change to parent of current working directory (deprecated)" .It XCWD Ta "change working directory (deprecated)" -.It XMKD Ta "make a directory (deprecated)" +.It XMKD Ta "make a directory (deprecated) [RW]" .It XPWD Ta "print the current working directory (deprecated)" -.It XRMD Ta "remove a directory (deprecated)" +.It XRMD Ta "remove a directory (deprecated) [RW]" .El .Pp The following non-standard or @@ -215,7 +222,7 @@ .It Sy Request Ta Sy Description .It UMASK Ta change umask, e.g. ``SITE UMASK 002'' .It IDLE Ta set idle-timer, e.g. ``SITE IDLE 60'' -.It CHMOD Ta "change mode of a file, e.g. ``SITE CHMOD 755 filename''" +.It CHMOD Ta "change mode of a file [RW], e.g. ``SITE CHMOD 755 filename''" .It HELP Ta give help information .El .Pp @@ -244,7 +251,7 @@ .Dq Li \&*?[]{}~ . .Pp .Nm Ftpd -authenticates users according to five rules. +authenticates users according to six rules. .Pp .Bl -enum -offset indent .It @@ -253,13 +260,15 @@ In this case a password must be provided by the client before any file operations may be performed. If the user has an S/Key key, the response from a successful USER -command will include an S/Key challenge. The client may choose to respond -with a PASS command giving either a standard password or an S/Key -one-time password. The server will automatically determine which type of -password it has been given and attempt to authenticate accordingly. See +command will include an S/Key challenge. +The client may choose to respond with a PASS command giving either +a standard password or an S/Key one-time password. +The server will automatically determine which type of +password it has been given and attempt to authenticate accordingly. +See .Xr key 1 -for more information on S/Key authentication. S/Key is a Trademark of -Bellcore. +for more information on S/Key authentication. +S/Key is a Trademark of Bellcore. .It The login name must not appear in the file .Pa /etc/ftpusers . @@ -462,3 +471,4 @@ .Nm command appeared in .Bx 4.2 . +IPv6 support was added in WIDE Hydrangea IPv6 stack kit. Index: ftpd.c =================================================================== RCS file: /home/ncvs/src/libexec/ftpd/ftpd.c,v retrieving revision 1.52.2.3 diff -u -b -r1.52.2.3 ftpd.c --- ftpd.c 1999/10/25 08:31:50 1.52.2.3 +++ ftpd.c 2001/02/19 21:40:38 @@ -51,11 +51,12 @@ * FTP server. */ #include -#include #include +#include #include +#include +#include #include -#include #include #include @@ -142,6 +143,7 @@ int mode; int usedefault = 1; /* for data transfers */ int pdata = -1; /* for passive mode */ +int readonly=0; /* Server is in readonly mode. */ sig_atomic_t transflag; off_t file_size; off_t byte_count; @@ -206,7 +208,6 @@ #ifdef SKEY int pwok = 0; -char addr_string[20]; /* XXX */ #endif #define LOGCMD(cmd, file) \ @@ -287,7 +288,7 @@ bind_address.s_addr = htonl(INADDR_ANY); - while ((ch = getopt(argc, argv, "AdlDSURt:T:u:va:p:")) != -1) { + while ((ch = getopt(argc, argv, "AdlDSURrt:T:u:va:p:")) != -1) { switch (ch) { case 'D': daemon_mode++; @@ -301,6 +302,10 @@ logging++; /* > 1 == extra logging */ break; + case 'r': + readonly = 1; + break; + case 'R': paranoid = 0; break; @@ -401,7 +406,7 @@ } if (setsockopt(ctl_sock, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on)) < 0) - syslog(LOG_ERR, "control setsockopt: %m");; + syslog(LOG_ERR, "control setsockopt: %m"); server_addr.sin_family = AF_INET; server_addr.sin_addr = bind_address; server_addr.sin_port = sv->s_port; @@ -464,9 +469,6 @@ if (signal(SIGURG, myoob) == SIG_ERR) syslog(LOG_ERR, "signal: %m"); -#ifdef SKEY - strncpy(addr_string, inet_ntoa(his_addr.sin_addr), sizeof(addr_string)); -#endif addrlen = sizeof(ctrl_addr); if (getsockname(0, (struct sockaddr *)&ctrl_addr, &addrlen) < 0) { syslog(LOG_ERR, "getsockname (%s): %m",argv[0]); @@ -754,7 +756,7 @@ static int login_attempts; /* number of failed login attempts */ static int askpasswd; /* had user command, ask for passwd */ -static char curname[10]; /* current USER name */ +static char curname[MAXLOGNAME]; /* current USER name */ /* * USER command. @@ -831,7 +833,7 @@ if (logging) strncpy(curname, name, sizeof(curname)-1); #ifdef SKEY - pwok = skeyaccess(name, NULL, remotehost, addr_string); + pwok = skeyaccess(name, NULL, remotehost, remotehost); reply(331, "%s", skey_challenge(name, pw, pwok)); #else reply(331, "Password required for %s.", name); @@ -944,11 +946,15 @@ goto skip; #endif #ifdef SKEY - rval = strcmp(skey_crypt(passwd, pw->pw_passwd, pw, pwok), - pw->pw_passwd); - pwok = 0; + rval = 1; + if (pwok) + rval = strcmp(pw->pw_passwd, + crypt(passwd, pw->pw_passwd)); + if (rval) + rval = strcmp(pw->pw_passwd, + skey_crypt(passwd, pw->pw_passwd, pw, pwok)); #else - rval = strcmp(crypt(passwd, pw->pw_passwd), pw->pw_passwd); + rval = strcmp(pw->pw_passwd, crypt(passwd, pw->pw_passwd)); #endif /* The strcmp does not catch null passwords! */ if (*pw->pw_passwd == '\0' || @@ -976,6 +982,9 @@ return; } } +#ifdef SKEY + pwok = 0; +#endif login_attempts = 0; /* this time successful */ if (setegid((gid_t)pw->pw_gid) < 0) { reply(550, "Can't set gid."); @@ -1089,14 +1098,14 @@ if (thishost != firsthost) snprintf(proctitle, sizeof(proctitle), "%s: anonymous(%s)/%.*s", remotehost, hostname, - sizeof(proctitle) - sizeof(remotehost) - - sizeof(": anonymous/"), passwd); + (int)(sizeof(proctitle) - sizeof(remotehost) - + sizeof(": anonymous/")), passwd); else #endif snprintf(proctitle, sizeof(proctitle), "%s: anonymous/%.*s", remotehost, - sizeof(proctitle) - sizeof(remotehost) - - sizeof(": anonymous/"), passwd); + (int)(sizeof(proctitle) - sizeof(remotehost) - + sizeof(": anonymous/")), passwd); setproctitle("%s", proctitle); #endif /* SETPROCTITLE */ if (logging) @@ -1282,6 +1291,7 @@ if (data >= 0) return (fdopen(data, mode)); (void) seteuid((uid_t)0); + s = socket(AF_INET, SOCK_STREAM, 0); if (s < 0) goto bad; @@ -1426,9 +1436,10 @@ off_t filesize; int isreg; { - int c, cnt, filefd, netfd; - char *buf, *bp; + int c, filefd, netfd; + char *buf; size_t len; + off_t cnt; transflag++; if (setjmp(urgcatch)) { @@ -1465,27 +1476,28 @@ netfd = fileno(outstr); filefd = fileno(instr); - if (isreg && filesize < (off_t)16 * 1024 * 1024) { - buf = mmap(0, filesize, PROT_READ, MAP_SHARED, filefd, - (off_t)0); - if (buf == MAP_FAILED) { - syslog(LOG_WARNING, "mmap(%lu): %m", - (unsigned long)filesize); - goto oldway; - } - bp = buf; + if (isreg) { + + off_t offset; + int err; + len = filesize; - do { - cnt = write(netfd, bp, len); + err = cnt = offset = 0; + + while (err != -1 && cnt < filesize) { + err = sendfile(filefd, netfd, offset, len, + (struct sf_hdtr *) NULL, &cnt, 0); + offset += cnt; len -= cnt; - bp += cnt; - if (cnt > 0) byte_count += cnt; - } while(cnt > 0 && len > 0); - transflag = 0; - munmap(buf, (size_t)filesize); - if (cnt < 0) + if (err == -1) { + if (!cnt) + goto oldway; + goto data_err; + } + } + reply(226, "Transfer complete."); return; } --=-=-=-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Feb 20 17: 1:49 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mail.gmx.net (mail.gmx.net [194.221.183.20]) by hub.freebsd.org (Postfix) with SMTP id 71EA537B401 for ; Tue, 20 Feb 2001 17:01:43 -0800 (PST) (envelope-from tmoestl@gmx.net) Received: (qmail 10850 invoked by uid 0); 21 Feb 2001 01:01:41 -0000 Received: from p3e9bc02a.dip.t-dialin.net (HELO forge.local) (62.155.192.42) by mail.gmx.net (mail08) with SMTP; 21 Feb 2001 01:01:41 -0000 Received: from tmm by forge.local with local (Exim 3.20 #1) id 14VNf1-0001E4-00 for ; Wed, 21 Feb 2001 02:01:39 +0100 Date: Wed, 21 Feb 2001 02:01:39 +0100 From: Thomas Moestl To: freebsd-audit@freebsd.org Subject: removing setgid kmem from pstat Message-ID: <20010221020139.A4016@crow.dom2ip.de> Mail-Followup-To: Thomas Moestl , freebsd-audit@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, I have done yet another set of patches for setgid removal, this time for pstat. This change makes all options of pstat (except -v, see below) work with crash dumps via libkvm calls and with live kernels via sysctl. Note: pstat -v is broken (-v has been disabled for a while), so I did not care about any code needed for this option. Again, some kernel changes were needed. First of all, the kernel tty list as kept in kern/tty.c is used, so the drivers that did not register with this list (with ttyregister or ttymalloc) were changed to do so. Then, the kern.file and kern.ttys sysctls were changed - they now use a struct xfile or a struct xtty respectively that contain a little less information (for paranoia reasons) and are flat structures (previously, pointers were exported). I think there is no place where these where actually used save pstat and libkvm (see below). Because of the format change of the kern.file sysctl, I also had to change kvm_getfiles in libkvm. The output of this is quite different now (a simple array of struct xfile's), because less information is exported via the sysctl. Although I could spot no place where this was actually used, I guess a version number bump is needed. There is also a patch for nfsstat; this removes setgid install in the Makefile, and a comment and a little code no longer needed in the non-setgid case. nfsstat has apparently used sysctls on live kernels for years, and so setgid can be taken away without any real modifications. The new patches are at: - for pstat: http://www.tu-bs.de/~y0015675/pstat.diff - for nfsstat: http://www.tu-bs.de/~y0015675/nfsstat.diff - for libkvm: http://www.tu-bs.de/~y0015675/libkvm2.diff - for the kernel: http://www.tu-bs.de/~y0015675/sysctl6.diff The previously posted patches are at (please note that the iostat and sysctl5 patches have been updated since my last mail): http://www.tu-bs.de/~y0015675/vmstat.diff http://www.tu-bs.de/~y0015675/iostat.diff http://www.tu-bs.de/~y0015675/vinum.diff http://www.tu-bs.de/~y0015675/libdevstat.diff http://www.tu-bs.de/~y0015675/sysctl5.diff http://www.tu-bs.de/~y0015675/sysctl4.diff http://www.tu-bs.de/~y0015675/dmesg.diff http://www.tu-bs.de/~y0015675/sysctl3.diff http://www.tu-bs.de/~y0015675/systat.diff http://www.tu-bs.de/~y0015675/sysctl2.diff http://www.tu-bs.de/~y0015675/top.diff http://www.tu-bs.de/~y0015675/libkvm.diff http://www.tu-bs.de/~y0015675/sysctl.diff It would be nice if people with the respective hardware for the tty drivers I changed (dgb, rp, cy, stallion, rc) could give this patch a try (but please note that the new patches partly depend on the older ones, although this should only affect pstat). The changes are small, and I do not expect much problems. Please review and comment. - thomas To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Feb 20 17:16:47 2001 Delivered-To: freebsd-audit@freebsd.org Received: from lennier.cc.vt.edu (lennier.cc.vt.edu [198.82.161.193]) by hub.freebsd.org (Postfix) with ESMTP id 2076637B491; Tue, 20 Feb 2001 17:16:44 -0800 (PST) (envelope-from mheffner@vt.edu) Received: from mail.vt.edu (gkar.cc.vt.edu [198.82.161.190]) by lennier.cc.vt.edu (8.11.0/8.11.0) with ESMTP id f1L1Gfu36070; Tue, 20 Feb 2001 20:16:41 -0500 (EST) Received: from enterprise.muriel.penguinpowered.com ([198.82.100.151]) by gkar.cc.vt.edu (Sun Internet Mail Server sims.3.5.2000.03.23.18.03.p10) with ESMTP id <0G9300KDR27RRZ@gkar.cc.vt.edu>; Tue, 20 Feb 2001 20:16:39 -0500 (EST) Date: Tue, 20 Feb 2001 20:16:39 -0500 (EST) From: Mike Heffner Subject: RE: update to the committer "big list of rules" In-reply-to: <90432.982657167@critter> To: Poul-Henning Kamp Cc: audit@freebsd.org Message-id: MIME-version: 1.0 X-Mailer: XFMail 1.4.7 on FreeBSD Content-type: multipart/signed; boundary="_=XFMail.1.4.7.FreeBSD:20010220201639:472=_"; micalg=pgp-md5; protocol="application/pgp-signature" X-Priority: 3 (Normal) Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This message is in MIME format --_=XFMail.1.4.7.FreeBSD:20010220201639:472=_ Content-Type: text/plain; charset=us-ascii If we do, there are some good points in an email from Robert Watson: http://www.FreeBSD.org/cgi/getmsg.cgi?fetch=1064241+1068977+/usr/local/www/db/te xt/2001/cvs-all/20010107.cvs-all that could be put under "Details." On 20-Feb-2001 Poul-Henning Kamp wrote: | | It might be an idea if you guys negotiate a point 11 in the | "The FreeBSD Committers' Big List of Rules" saying | | 11. Send your patches to audit@freebsd.org to get a review. | | URL: http://www.freebsd.org/tutorials/committers-guide/article.html | -- Mike Heffner Blacksburg, VA http://filebox.vt.edu/users/mheffner --_=XFMail.1.4.7.FreeBSD:20010220201639:472=_ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE6kxb3FokZQs3sv5kRAkJ/AJ9owiVw7vf477Oulw+x/y3eH6DGNwCZAWWD YIiAlqiKVsvDVQGFfgNt1CQ= =Fkho -----END PGP SIGNATURE----- --_=XFMail.1.4.7.FreeBSD:20010220201639:472=_-- End of MIME message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Feb 20 18:55:48 2001 Delivered-To: freebsd-audit@freebsd.org Received: from assaris.sics.se (h122n4fls32o892.telia.com [213.64.47.122]) by hub.freebsd.org (Postfix) with ESMTP id 8B35937B401 for ; Tue, 20 Feb 2001 18:55:27 -0800 (PST) (envelope-from assar@assaris.sics.se) Received: (from assar@localhost) by assaris.sics.se (8.9.3/8.9.3) id DAA35837; Wed, 21 Feb 2001 03:55:40 +0100 (CET) (envelope-from assar) From: assar@freebsd.org To: audit@freebsd.org Subject: changing type of vfs_mount Date: 21 Feb 2001 03:55:37 +0100 Message-ID: <5lsnl87niu.fsf@assaris.sics.se> Lines: 8 User-Agent: Gnus/5.070098 (Pterodactyl Gnus v0.98) Emacs/20.6 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --=-=-= Here are some patches that change the type of vfs_mount and the mount syscall to use the more correct `const char *path, void *data' which also brings FreeBSD in line with the other BSDs. Comments? /assar --=-=-= Content-Disposition: attachment; filename=fbsd-sys.diff Index: coda/coda_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/coda/coda_vfsops.c,v retrieving revision 1.29 diff -u -w -r1.29 coda_vfsops.c --- coda/coda_vfsops.c 2001/01/27 00:01:26 1.29 +++ coda/coda_vfsops.c 2001/02/21 02:50:30 @@ -107,8 +107,8 @@ int coda_mount(vfsp, path, data, ndp, p) struct mount *vfsp; /* Allocated and initialized by mount(2) */ - char *path; /* path covered: ignored by the fs-layer */ - caddr_t data; /* Need to define a data type for this in netbsd? */ + const char *path; /* path covered: ignored by the fs-layer */ + void *data; /* Need to define a data type for this in netbsd? */ struct nameidata *ndp; /* Clobber this to lookup the device name */ struct proc *p; /* The ever-famous proc pointer */ { Index: coda/coda_vfsops.h =================================================================== RCS file: /home/ncvs/src/sys/coda/coda_vfsops.h,v retrieving revision 1.5 diff -u -w -r1.5 coda_vfsops.h --- coda/coda_vfsops.h 2000/10/05 11:58:22 1.5 +++ coda/coda_vfsops.h 2001/02/21 02:50:30 @@ -47,7 +47,7 @@ struct mount; int coda_vfsopstats_init(void); -int coda_mount(struct mount *, char *, caddr_t, struct nameidata *, +int coda_mount(struct mount *, const char *, void *, struct nameidata *, struct proc *); int coda_start(struct mount *, int, struct proc *); int coda_unmount(struct mount *, int, struct proc *); Index: compat/linprocfs/linprocfs_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/compat/linprocfs/linprocfs_vfsops.c,v retrieving revision 1.6 diff -u -w -r1.6 linprocfs_vfsops.c --- compat/linprocfs/linprocfs_vfsops.c 2000/12/13 20:19:06 1.6 +++ compat/linprocfs/linprocfs_vfsops.c 2001/02/21 02:50:35 @@ -54,7 +54,8 @@ #include #include -static int linprocfs_mount __P((struct mount *mp, char *path, caddr_t data, +static int linprocfs_mount __P((struct mount *mp, const char *path, + void *data, struct nameidata *ndp, struct proc *p)); static int linprocfs_statfs __P((struct mount *mp, struct statfs *sbp, struct proc *p)); @@ -70,8 +71,8 @@ static int linprocfs_mount(mp, path, data, ndp, p) struct mount *mp; - char *path; - caddr_t data; + const char *path; + void *data; struct nameidata *ndp; struct proc *p; { Index: fs/devfs/devfs_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/fs/devfs/devfs_vfsops.c,v retrieving revision 1.11 diff -u -w -r1.11 devfs_vfsops.c --- fs/devfs/devfs_vfsops.c 2000/12/08 21:50:04 1.11 +++ fs/devfs/devfs_vfsops.c 2001/02/21 02:50:44 @@ -47,7 +47,8 @@ MALLOC_DEFINE(M_DEVFS, "DEVFS", "DEVFS data"); -static int devfs_mount __P((struct mount *mp, char *path, caddr_t data, +static int devfs_mount __P((struct mount *mp, const char *path, + void *data, struct nameidata *ndp, struct proc *p)); static int devfs_unmount __P((struct mount *mp, int mntflags, struct proc *p)); @@ -61,8 +62,8 @@ static int devfs_mount(mp, path, data, ndp, p) struct mount *mp; - char *path; - caddr_t data; + const char *path; + void *data; struct nameidata *ndp; struct proc *p; { Index: fs/hpfs/hpfs_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/fs/hpfs/hpfs_vfsops.c,v retrieving revision 1.10 diff -u -w -r1.10 hpfs_vfsops.c --- fs/hpfs/hpfs_vfsops.c 2001/01/27 00:01:29 1.10 +++ fs/hpfs/hpfs_vfsops.c 2001/02/21 02:50:44 @@ -84,7 +84,7 @@ #if defined(__FreeBSD__) struct sockaddr; -static int hpfs_mount __P((struct mount *, char *, caddr_t, +static int hpfs_mount __P((struct mount *, const char *, void *, struct nameidata *, struct proc *)); static int hpfs_init __P((struct vfsconf *)); static int hpfs_uninit __P((struct vfsconf *)); Index: gnu/ext2fs/ext2_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/gnu/ext2fs/ext2_vfsops.c,v retrieving revision 1.76 diff -u -w -r1.76 ext2_vfsops.c --- gnu/ext2fs/ext2_vfsops.c 2001/02/09 06:09:16 1.76 +++ gnu/ext2fs/ext2_vfsops.c 2001/02/21 02:50:45 @@ -73,7 +73,7 @@ static int ext2_fhtovp __P((struct mount *, struct fid *, struct vnode **)); static int ext2_flushfiles __P((struct mount *mp, int flags, struct proc *p)); static int ext2_mount __P((struct mount *, - char *, caddr_t, struct nameidata *, struct proc *)); + const char *, void *, struct nameidata *, struct proc *)); static int ext2_mountfs __P((struct vnode *, struct mount *, struct proc *)); static int ext2_reload __P((struct mount *mountp, struct ucred *cred, struct proc *p)); @@ -179,8 +179,8 @@ static int ext2_mount(mp, path, data, ndp, p) register struct mount *mp; - char *path; - caddr_t data; /* this is actually a (struct ufs_args *) */ + const char *path; + void *data; /* this is actually a (struct ufs_args *) */ struct nameidata *ndp; struct proc *p; { Index: isofs/cd9660/cd9660_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/isofs/cd9660/cd9660_vfsops.c,v retrieving revision 1.83 diff -u -w -r1.83 cd9660_vfsops.c --- isofs/cd9660/cd9660_vfsops.c 2001/01/27 00:01:31 1.83 +++ isofs/cd9660/cd9660_vfsops.c 2001/02/21 02:50:49 @@ -65,7 +65,7 @@ MALLOC_DEFINE(M_ISOFSNODE, "ISOFS node", "ISOFS vnode private part"); static int cd9660_mount __P((struct mount *, - char *, caddr_t, struct nameidata *, struct proc *)); + const char *, void *, struct nameidata *, struct proc *)); static int cd9660_unmount __P((struct mount *, int, struct proc *)); static int cd9660_root __P((struct mount *, struct vnode **)); static int cd9660_statfs __P((struct mount *, struct statfs *, struct proc *)); @@ -176,8 +176,8 @@ static int cd9660_mount(mp, path, data, ndp, p) register struct mount *mp; - char *path; - caddr_t data; + const char *path; + void *data; struct nameidata *ndp; struct proc *p; { Index: kern/syscalls.master =================================================================== RCS file: /home/ncvs/src/sys/kern/syscalls.master,v retrieving revision 1.84 diff -u -w -r1.84 syscalls.master --- kern/syscalls.master 2000/12/02 05:41:29 1.84 +++ kern/syscalls.master 2001/02/21 02:50:51 @@ -66,8 +66,8 @@ int flags); } 19 COMPAT POSIX { long lseek(int fd, long offset, int whence); } 20 STD POSIX { pid_t getpid(void); } -21 STD BSD { int mount(char *type, char *path, int flags, \ - caddr_t data); } +21 STD BSD { int mount(const char *type, const char *path, \ + int flags, void *data); } ; XXX 4.4lite2 uses `char *type' but we're not ready for that. ; XXX `path' should have type `const char *' but we're not ready for that. 22 STD BSD { int unmount(char *path, int flags); } Index: kern/vfs_default.c =================================================================== RCS file: /home/ncvs/src/sys/kern/vfs_default.c,v retrieving revision 1.41 diff -u -w -r1.41 vfs_default.c --- kern/vfs_default.c 2001/02/18 02:22:58 1.41 +++ kern/vfs_default.c 2001/02/21 02:50:53 @@ -624,8 +624,8 @@ int vfs_stdmount (mp, path, data, ndp, p) struct mount *mp; - char *path; - caddr_t data; + const char *path; + void *data; struct nameidata *ndp; struct proc *p; { Index: kern/vfs_syscalls.c =================================================================== RCS file: /home/ncvs/src/sys/kern/vfs_syscalls.c,v retrieving revision 1.177 diff -u -w -r1.177 vfs_syscalls.c --- kern/vfs_syscalls.c 2001/02/16 14:31:49 1.177 +++ kern/vfs_syscalls.c 2001/02/21 02:50:54 @@ -97,10 +97,10 @@ */ #ifndef _SYS_SYSPROTO_H_ struct mount_args { - char *type; - char *path; + const char *type; + const char *path; int flags; - caddr_t data; + void *data; }; #endif /* ARGSUSED */ @@ -116,10 +116,10 @@ mount1(p, uap, segflag) struct proc *p; struct mount_args /* { - syscallarg(char *) type; - syscallarg(char *) path; + syscallarg(const char *) type; + syscallarg(const char *) path; syscallarg(int) flags; - syscallarg(caddr_t) data; + syscallarg(void *) data; } */ *uap; int segflag; { Index: miscfs/fdesc/fdesc_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/miscfs/fdesc/fdesc_vfsops.c,v retrieving revision 1.23 diff -u -w -r1.23 fdesc_vfsops.c --- miscfs/fdesc/fdesc_vfsops.c 2000/10/09 20:06:13 1.23 +++ miscfs/fdesc/fdesc_vfsops.c 2001/02/21 02:50:55 @@ -55,7 +55,8 @@ static MALLOC_DEFINE(M_FDESCMNT, "FDESC mount", "FDESC mount structure"); -static int fdesc_mount __P((struct mount *mp, char *path, caddr_t data, +static int fdesc_mount __P((struct mount *mp, const char *path, + void *data, struct nameidata *ndp, struct proc *p)); static int fdesc_unmount __P((struct mount *mp, int mntflags, struct proc *p)); @@ -68,8 +69,8 @@ static int fdesc_mount(mp, path, data, ndp, p) struct mount *mp; - char *path; - caddr_t data; + const char *path; + void *data; struct nameidata *ndp; struct proc *p; { Index: miscfs/nullfs/null_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/miscfs/nullfs/null_vfsops.c,v retrieving revision 1.43 diff -u -w -r1.43 null_vfsops.c --- miscfs/nullfs/null_vfsops.c 2000/10/29 13:56:56 1.43 +++ miscfs/nullfs/null_vfsops.c 2001/02/21 02:50:55 @@ -59,7 +59,7 @@ struct vnode **vpp); static int nullfs_checkexp(struct mount *mp, struct sockaddr *nam, int *extflagsp, struct ucred **credanonp); -static int nullfs_mount(struct mount *mp, char *path, caddr_t data, +static int nullfs_mount(struct mount *mp, const char *path, void *data, struct nameidata *ndp, struct proc *p); static int nullfs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg, struct proc *p); @@ -81,8 +81,8 @@ static int nullfs_mount(mp, path, data, ndp, p) struct mount *mp; - char *path; - caddr_t data; + const char *path; + void *data; struct nameidata *ndp; struct proc *p; { Index: miscfs/portal/portal_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/miscfs/portal/portal_vfsops.c,v retrieving revision 1.27 diff -u -w -r1.27 portal_vfsops.c --- miscfs/portal/portal_vfsops.c 2000/11/25 07:16:06 1.27 +++ miscfs/portal/portal_vfsops.c 2001/02/21 02:50:55 @@ -59,7 +59,8 @@ static MALLOC_DEFINE(M_PORTALFSMNT, "PORTAL mount", "PORTAL mount structure"); -static int portal_mount __P((struct mount *mp, char *path, caddr_t data, +static int portal_mount __P((struct mount *mp, const char *path, + void *data, struct nameidata *ndp, struct proc *p)); static int portal_unmount __P((struct mount *mp, int mntflags, struct proc *p)); @@ -73,8 +74,8 @@ static int portal_mount(mp, path, data, ndp, p) struct mount *mp; - char *path; - caddr_t data; + const char *path; + void *data; struct nameidata *ndp; struct proc *p; { Index: miscfs/umapfs/umap_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/miscfs/umapfs/umap_vfsops.c,v retrieving revision 1.33 diff -u -w -r1.33 umap_vfsops.c --- miscfs/umapfs/umap_vfsops.c 2000/10/29 16:06:36 1.33 +++ miscfs/umapfs/umap_vfsops.c 2001/02/21 02:50:55 @@ -58,7 +58,8 @@ struct vnode **vpp)); static int umapfs_checkexp __P((struct mount *mp, struct sockaddr *nam, int *extflagsp, struct ucred **credanonp)); -static int umapfs_mount __P((struct mount *mp, char *path, caddr_t data, +static int umapfs_mount __P((struct mount *mp, const char *path, + void *data, struct nameidata *ndp, struct proc *p)); static int umapfs_quotactl __P((struct mount *mp, int cmd, uid_t uid, caddr_t arg, struct proc *p)); @@ -83,8 +84,8 @@ static int umapfs_mount(mp, path, data, ndp, p) struct mount *mp; - char *path; - caddr_t data; + const char *path; + void *data; struct nameidata *ndp; struct proc *p; { Index: miscfs/union/union_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/miscfs/union/union_vfsops.c,v retrieving revision 1.42 diff -u -w -r1.42 union_vfsops.c --- miscfs/union/union_vfsops.c 2001/02/04 13:12:34 1.42 +++ miscfs/union/union_vfsops.c 2001/02/21 02:51:00 @@ -56,7 +56,8 @@ static MALLOC_DEFINE(M_UNIONFSMNT, "UNION mount", "UNION mount structure"); extern int union_init __P((struct vfsconf *)); -static int union_mount __P((struct mount *mp, char *path, caddr_t data, +static int union_mount __P((struct mount *mp, const char *path, + void *data, struct nameidata *ndp, struct proc *p)); static int union_root __P((struct mount *mp, struct vnode **vpp)); static int union_statfs __P((struct mount *mp, struct statfs *sbp, @@ -70,8 +71,8 @@ static int union_mount(mp, path, data, ndp, p) struct mount *mp; - char *path; - caddr_t data; + const char *path; + void *data; struct nameidata *ndp; struct proc *p; { Index: msdosfs/msdosfs_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/msdosfs/msdosfs_vfsops.c,v retrieving revision 1.71 diff -u -w -r1.71 msdosfs_vfsops.c --- msdosfs/msdosfs_vfsops.c 2001/02/09 06:10:54 1.71 +++ msdosfs/msdosfs_vfsops.c 2001/02/21 02:51:09 @@ -93,7 +93,7 @@ struct vnode **)); static int msdosfs_checkexp __P((struct mount *, struct sockaddr *, int *, struct ucred **)); -static int msdosfs_mount __P((struct mount *, char *, caddr_t, +static int msdosfs_mount __P((struct mount *, const char *, void *, struct nameidata *, struct proc *)); static int msdosfs_root __P((struct mount *, struct vnode **)); static int msdosfs_statfs __P((struct mount *, struct statfs *, @@ -224,8 +224,8 @@ static int msdosfs_mount(mp, path, data, ndp, p) struct mount *mp; - char *path; - caddr_t data; + const char *path; + void *data; struct nameidata *ndp; struct proc *p; { Index: nfs/nfs_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/nfs/nfs_vfsops.c,v retrieving revision 1.93 diff -u -w -r1.93 nfs_vfsops.c --- nfs/nfs_vfsops.c 2000/11/14 08:00:39 1.93 +++ nfs/nfs_vfsops.c 2001/02/21 02:51:12 @@ -99,7 +99,8 @@ struct nfs_args *argp)); static int mountnfs __P((struct nfs_args *,struct mount *, struct sockaddr *,char *,char *,struct vnode **)); -static int nfs_mount __P(( struct mount *mp, char *path, caddr_t data, +static int nfs_mount __P(( struct mount *mp, const char *path, + void *data, struct nameidata *ndp, struct proc *p)); static int nfs_unmount __P(( struct mount *mp, int mntflags, struct proc *p)); @@ -755,8 +756,8 @@ static int nfs_mount(mp, path, data, ndp, p) struct mount *mp; - char *path; - caddr_t data; + const char *path; + void *data; struct nameidata *ndp; struct proc *p; { Index: ntfs/ntfs_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/ntfs/ntfs_vfsops.c,v retrieving revision 1.27 diff -u -w -r1.27 ntfs_vfsops.c --- ntfs/ntfs_vfsops.c 2001/02/09 06:11:07 1.27 +++ ntfs/ntfs_vfsops.c 2001/02/21 02:51:13 @@ -96,7 +96,7 @@ #if defined(__FreeBSD__) struct sockaddr; -static int ntfs_mount __P((struct mount *, char *, caddr_t, +static int ntfs_mount __P((struct mount *, const char *, void *, struct nameidata *, struct proc *)); static int ntfs_init __P((struct vfsconf *)); static int ntfs_checkexp __P((struct mount *, struct sockaddr *, @@ -236,13 +236,8 @@ static int ntfs_mount ( struct mount *mp, -#if defined(__FreeBSD__) - char *path, - caddr_t data, -#else const char *path, void *data, -#endif struct nameidata *ndp, struct proc *p ) { Index: nwfs/nwfs_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/nwfs/nwfs_vfsops.c,v retrieving revision 1.12 diff -u -w -r1.12 nwfs_vfsops.c --- nwfs/nwfs_vfsops.c 2001/02/04 13:13:15 1.12 +++ nwfs/nwfs_vfsops.c 2001/02/21 02:51:13 @@ -69,7 +69,7 @@ MODULE_DEPEND(nwfs, ncp, 1, 1, 1); -static int nwfs_mount(struct mount *, char *, caddr_t, +static int nwfs_mount(struct mount *, const char *, void *, struct nameidata *, struct proc *); static int nwfs_quotactl(struct mount *, int, uid_t, caddr_t, struct proc *); static int nwfs_root(struct mount *, struct vnode **); @@ -142,7 +142,7 @@ * mp - path - addr in user space of mount point (ie /usr or whatever) * data - addr in user space of mount params */ -static int nwfs_mount(struct mount *mp, char *path, caddr_t data, +static int nwfs_mount(struct mount *mp, const char *path, void *data, struct nameidata *ndp, struct proc *p) { struct nwfs_args args; /* will hold data from mount request */ Index: sys/mount.h =================================================================== RCS file: /home/ncvs/src/sys/sys/mount.h,v retrieving revision 1.101 diff -u -w -r1.101 mount.h --- sys/mount.h 2001/02/18 13:30:19 1.101 +++ sys/mount.h 2001/02/21 02:51:14 @@ -316,8 +316,9 @@ #endif struct vfsops { - int (*vfs_mount) __P((struct mount *mp, char *path, caddr_t data, - struct nameidata *ndp, struct proc *p)); + int (*vfs_mount) __P((struct mount *mp, const char *path, + void *data, struct nameidata *ndp, + struct proc *p)); int (*vfs_start) __P((struct mount *mp, int flags, struct proc *p)); int (*vfs_unmount) __P((struct mount *mp, int mntflags, @@ -435,7 +436,7 @@ * kern/vfs_default.c, they should be used instead of making "dummy" * functions or casting entries in the VFS op table to "enopnotsupp()". */ -int vfs_stdmount __P((struct mount *mp, char *path, caddr_t data, +int vfs_stdmount __P((struct mount *mp, const char *path, void *data, struct nameidata *ndp, struct proc *p)); int vfs_stdstart __P((struct mount *mp, int flags, struct proc *p)); int vfs_stdunmount __P((struct mount *mp, int mntflags, struct proc *p)); Index: sys/sysproto.h =================================================================== RCS file: /home/ncvs/src/sys/sys/sysproto.h,v retrieving revision 1.71 diff -u -w -r1.71 sysproto.h --- sys/sysproto.h 2000/12/02 05:45:32 1.71 +++ sys/sysproto.h 2001/02/21 02:51:16 @@ -2,7 +2,7 @@ * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/sys/sysproto.h,v 1.71 2000/12/02 05:45:32 jake Exp $ + * $FreeBSD$ * created from FreeBSD: src/sys/kern/syscalls.master,v 1.84 2000/12/02 05:41:29 jake Exp */ @@ -90,10 +90,10 @@ register_t dummy; }; struct mount_args { - char * type; char type_[PAD_(char *)]; - char * path; char path_[PAD_(char *)]; + const char * type; char type_[PAD_(const char *)]; + const char * path; char path_[PAD_(const char *)]; int flags; char flags_[PAD_(int)]; - caddr_t data; char data_[PAD_(caddr_t)]; + void * data; char data_[PAD_(void *)]; }; struct unmount_args { char * path; char path_[PAD_(char *)]; Index: ufs/ffs/ffs_extern.h =================================================================== RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_extern.h,v retrieving revision 1.36 diff -u -w -r1.36 ffs_extern.h --- ufs/ffs/ffs_extern.h 2000/12/19 04:41:02 1.36 +++ ufs/ffs/ffs_extern.h 2001/02/21 02:51:16 @@ -87,8 +87,8 @@ int ffs_mountfs __P((struct vnode *, struct mount *, struct proc *, struct malloc_type *)); int ffs_mountroot __P((void)); -int ffs_mount __P((struct mount *, char *, caddr_t, struct nameidata *, - struct proc *)); +int ffs_mount __P((struct mount *, const char *, void *, + struct nameidata *, struct proc *)); int ffs_reallocblks __P((struct vop_reallocblks_args *)); int ffs_realloccg __P((struct inode *, ufs_daddr_t, ufs_daddr_t, int, int, struct ucred *, struct buf **)); Index: ufs/ffs/ffs_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_vfsops.c,v retrieving revision 1.138 diff -u -w -r1.138 ffs_vfsops.c --- ufs/ffs/ffs_vfsops.c 2001/02/09 06:11:33 1.138 +++ ufs/ffs/ffs_vfsops.c 2001/02/21 02:51:17 @@ -134,8 +134,8 @@ int ffs_mount(mp, path, data, ndp, p) struct mount *mp; /* mount struct pointer*/ - char *path; /* path to mount point*/ - caddr_t data; /* arguments to FS specific mount*/ + const char *path; /* path to mount point*/ + void *data; /* arguments to FS specific mount*/ struct nameidata *ndp; /* mount point credentials*/ struct proc *p; /* process requesting mount*/ { Index: ufs/ifs/ifs_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/ufs/ifs/ifs_vfsops.c,v retrieving revision 1.5 diff -u -w -r1.5 ifs_vfsops.c --- ufs/ifs/ifs_vfsops.c 2001/02/09 06:11:37 1.5 +++ ufs/ifs/ifs_vfsops.c 2001/02/21 02:51:17 @@ -69,7 +69,7 @@ static MALLOC_DEFINE(M_IFSNODE, "IFS node", "IFS vnode private part"); static int ifs_init (struct vfsconf *); -static int ifs_mount (struct mount *, char *, caddr_t, +static int ifs_mount (struct mount *, const char *, void *, struct nameidata *, struct proc *); extern int ifs_vget (struct mount *, ino_t, struct vnode **); @@ -103,8 +103,8 @@ static int ifs_mount(mp, path, data, ndp, p) struct mount *mp; - char *path; - caddr_t data; + const char *path; + void *data; struct nameidata *ndp; struct proc *p; { Index: ufs/mfs/mfs_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/ufs/mfs/mfs_vfsops.c,v retrieving revision 1.86 diff -u -w -r1.86 mfs_vfsops.c --- ufs/mfs/mfs_vfsops.c 2000/08/20 21:34:39 1.86 +++ ufs/mfs/mfs_vfsops.c 2001/02/21 02:51:17 @@ -70,7 +70,7 @@ extern vop_t **mfs_vnodeop_p; static int mfs_mount __P((struct mount *mp, - char *path, caddr_t data, struct nameidata *ndp, + const char *path, void *data, struct nameidata *ndp, struct proc *p)); static int mfs_start __P((struct mount *mp, int flags, struct proc *p)); static int mfs_statfs __P((struct mount *mp, struct statfs *sbp, @@ -158,8 +158,8 @@ static int mfs_mount(mp, path, data, ndp, p) register struct mount *mp; - char *path; - caddr_t data; + const char *path; + void *data; struct nameidata *ndp; struct proc *p; { --=-=-=-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Tue Feb 20 20: 4:41 2001 Delivered-To: freebsd-audit@freebsd.org Received: from lennier.cc.vt.edu (lennier.cc.vt.edu [198.82.161.193]) by hub.freebsd.org (Postfix) with ESMTP id C944737B491 for ; Tue, 20 Feb 2001 20:04:34 -0800 (PST) (envelope-from mheffner@vt.edu) Received: from mail.vt.edu (gkar.cc.vt.edu [198.82.161.190]) by lennier.cc.vt.edu (8.11.0/8.11.0) with ESMTP id f1L44Wu64697; Tue, 20 Feb 2001 23:04:32 -0500 (EST) Received: from enterprise.muriel.penguinpowered.com ([198.82.100.151]) by gkar.cc.vt.edu (Sun Internet Mail Server sims.3.5.2000.03.23.18.03.p10) with ESMTP id <0G9300HIX9ZJVP@gkar.cc.vt.edu>; Tue, 20 Feb 2001 23:04:31 -0500 (EST) Date: Tue, 20 Feb 2001 23:04:31 -0500 (EST) From: Mike Heffner Subject: Re: mail(1) cleanup patch In-reply-to: <20010216082420.A85640@hamlet.nectar.com> To: "Jacques A. Vidrine" Cc: Nathan Ahlstrom Cc: Nathan Ahlstrom , FreeBSD-audit Message-id: MIME-version: 1.0 X-Mailer: XFMail 1.4.7 on FreeBSD Content-type: multipart/signed; boundary="_=XFMail.1.4.7.FreeBSD:20010220230431:472=_"; micalg=pgp-md5; protocol="application/pgp-signature" X-Priority: 3 (Normal) Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This message is in MIME format --_=XFMail.1.4.7.FreeBSD:20010220230431:472=_ Content-Type: text/plain; charset=us-ascii Ok, I've finally gotten around to updating the patch. I've attempted to detect more truncation cases. Also, axed blankline() with a strspn(). On 16-Feb-2001 Jacques A. Vidrine wrote: | On Thu, Feb 15, 2001 at 11:44:19PM -0500, Mike Heffner wrote: |> http://filebox.vt.edu/users/mheffner/patches/mail.patch | | This looks good. There are always more nits :-) but mostly they were | there before you arrived. Nothing earth-shattering, I think, but hey, | ``while you are there'': [snip] -- Mike Heffner Blacksburg, VA http://filebox.vt.edu/users/mheffner --_=XFMail.1.4.7.FreeBSD:20010220230431:472=_ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE6kz5OFokZQs3sv5kRAulTAJ9TjPcyWG6NBm3jmMgh36pP0F0pUgCeMR3q JsaNe3RUhgBfwMlO9Ybgwh4= =sNPh -----END PGP SIGNATURE----- --_=XFMail.1.4.7.FreeBSD:20010220230431:472=_-- End of MIME message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message From owner-freebsd-audit Fri Feb 23 11:28:56 2001 Delivered-To: freebsd-audit@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id E682537B401; Fri, 23 Feb 2001 11:28:54 -0800 (PST) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (robert@fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.11.1/8.11.1) with SMTP id f1NJSlh67692; Fri, 23 Feb 2001 14:28:48 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Fri, 23 Feb 2001 14:28:47 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: Thomas Moestl Cc: freebsd-audit@freebsd.org, jhb@freebsd.org Subject: Re: patch to remove setgid kmem from top In-Reply-To: <20010202015844.A1246@crow.dom2ip.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Just to let everyone know -- I've now committed these changes to the -CURRENT branch. I'd like to MFC them in a few days, although we'll see how my time commitments go. Before then, I'd like to get the remainder of the setgid kmem patches reviewed and committed. My next target is systat. Robert N M Watson FreeBSD Core Team, TrustedBSD Project robert@fledge.watson.org NAI Labs, Safeport Network Services To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message