svn commit: r238968 - head/sbin/shutdown
Author: des Date: Wed Aug 1 09:10:21 2012 New Revision: 238968 URL: http://svn.freebsd.org/changeset/base/238968 Log: Restore a piece of BSD history. PR: 169127 Submitted by: Ruben de Groot MFC after:1 week Modified: head/sbin/shutdown/shutdown.c Modified: head/sbin/shutdown/shutdown.c == --- head/sbin/shutdown/shutdown.c Wed Aug 1 09:00:26 2012 (r238967) +++ head/sbin/shutdown/shutdown.c Wed Aug 1 09:10:21 2012 (r238968) @@ -93,7 +93,7 @@ static char mbuf[BUFSIZ]; static const char *nosync, *whom; static void badtime(void); -static void perform_shutdown(void); +static void die_you_gravy_sucking_pig_dog(void); static void finish(int); static void getoffset(char *); static void loop(void); @@ -282,7 +282,7 @@ loop(void) if (!tp->timeleft) break; } - perform_shutdown(); + die_you_gravy_sucking_pig_dog(); } static jmp_buf alarmbuf; @@ -349,7 +349,7 @@ timeout(int signo __unused) } static void -perform_shutdown(void) +die_you_gravy_sucking_pig_dog(void) { char *empty_environ[] = { NULL }; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r238605 - head/etc/rc.d
Author: des Date: Wed Jul 18 23:01:23 2012 New Revision: 238605 URL: http://svn.freebsd.org/changeset/base/238605 Log: Move -n ${_jail} before ${_flags} so that any -n options in ${_flags} will override ours instead of the other way around. Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail == --- head/etc/rc.d/jail Wed Jul 18 21:47:50 2012(r238604) +++ head/etc/rc.d/jail Wed Jul 18 23:01:23 2012(r238605) @@ -641,7 +641,7 @@ jail_start() i=$((i + 1)) done - eval ${_setfib} jail ${_flags} -n ${_jail} -i ${_rootdir} ${_hostname} \ + eval ${_setfib} jail -n ${_jail} ${_flags} -i ${_rootdir} ${_hostname} \ \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 \ http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r238602 - head/usr.bin/du
Author: des Date: Wed Jul 18 19:28:22 2012 New Revision: 238602 URL: http://svn.freebsd.org/changeset/base/238602 Log: Add -g (gigabyte) flag to complement -k (kilobyte) and -m (megabyte). MFC after:1 week Modified: head/usr.bin/du/du.1 head/usr.bin/du/du.c Modified: head/usr.bin/du/du.1 == --- head/usr.bin/du/du.1Wed Jul 18 18:10:27 2012(r238601) +++ head/usr.bin/du/du.1Wed Jul 18 19:28:22 2012(r238602) @@ -28,7 +28,7 @@ .\"@(#)du.18.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd December 17, 2011 +.Dd July 18, 2012 .Dt DU 1 .Os .Sh NAME @@ -38,7 +38,7 @@ .Nm .Op Fl Aclnx .Op Fl H | L | P -.Op Fl h | k | m +.Op Fl g | h | k | m .Op Fl a | s | d Ar depth .Op Fl B Ar blocksize .Op Fl I Ar mask @@ -63,9 +63,9 @@ Calculate block counts in .Ar blocksize byte blocks. This is different from the -.Fl h, k +.Fl h, k, m and -.Fl m +.Fl g options or setting .Ev BLOCKSIZE and gives an estimate of how much space the examined file hierarchy would @@ -95,13 +95,15 @@ Display a grand total. Display an entry for all files and directories .Ar depth directories deep. +.It Fl g +Display block counts in 1073741824-byte (1 GiB) blocks. .It Fl h .Dq Human-readable output. Use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte. .It Fl k -Display block counts in 1024-byte (1-Kbyte) blocks. +Display block counts in 1024-byte (1 kiB) blocks. .It Fl l If a file has multiple hard links, count its size multiple times. The default behavior of @@ -112,7 +114,7 @@ When the option is specified, the hard link checks are disabled, and these files are counted (and displayed) as many times as they are found. .It Fl m -Display block counts in 1048576-byte (1-Mbyte) blocks. +Display block counts in 1048576-byte (1 MiB) blocks. .It Fl n Ignore files and directories with user .Dq nodump Modified: head/usr.bin/du/du.c == --- head/usr.bin/du/du.cWed Jul 18 18:10:27 2012(r238601) +++ head/usr.bin/du/du.cWed Jul 18 19:28:22 2012(r238602) @@ -109,7 +109,7 @@ main(int argc, char *argv[]) depth = INT_MAX; SLIST_INIT(&ignores); - while ((ch = getopt(argc, argv, "AB:HI:LPasd:chklmnrt:x")) != -1) + while ((ch = getopt(argc, argv, "AB:HI:LPasd:cghklmnrt:x")) != -1) switch (ch) { case 'A': Aflag = 1; @@ -156,6 +156,10 @@ main(int argc, char *argv[]) case 'c': cflag = 1; break; + case 'g': + hflag = 0; + blocksize = 1073741824; + break; case 'h': hflag = 1; break; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r238102 - head/etc/rc.d
Author: des Date: Wed Jul 4 13:37:44 2012 New Revision: 238102 URL: http://svn.freebsd.org/changeset/base/238102 Log: Name jails automatically. MFC after:1 week Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail == --- head/etc/rc.d/jail Wed Jul 4 13:00:48 2012(r238101) +++ head/etc/rc.d/jail Wed Jul 4 13:37:44 2012(r238102) @@ -641,7 +641,7 @@ jail_start() i=$((i + 1)) done - eval ${_setfib} jail ${_flags} -i ${_rootdir} ${_hostname} \ + eval ${_setfib} jail ${_flags} -n ${_jail} -i ${_rootdir} ${_hostname} \ \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 \ http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r237270 - head/etc
Author: des Date: Tue Jun 19 14:47:07 2012 New Revision: 237270 URL: http://svn.freebsd.org/changeset/base/237270 Log: Passive mode is the default, and has been for a while. MFC after:1 week Modified: head/etc/login.conf Modified: head/etc/login.conf == --- head/etc/login.conf Tue Jun 19 14:46:18 2012(r237269) +++ head/etc/login.conf Tue Jun 19 14:47:07 2012(r237270) @@ -26,7 +26,7 @@ default:\ :passwd_format=sha512:\ :copyright=/etc/COPYRIGHT:\ :welcome=/etc/motd:\ - :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,FTP_PASSIVE_MODE=YES:\ + :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:\ :path=/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin ~/bin:\ :nologin=/var/run/nologin:\ :cputime=unlimited:\ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r237269 - in head: etc lib/libutil
Author: des Date: Tue Jun 19 14:46:18 2012 New Revision: 237269 URL: http://svn.freebsd.org/changeset/base/237269 Log: Switch the default password hash from md5 to sha512. MFC after:1 week Modified: head/etc/login.conf head/lib/libutil/login.conf.5 Modified: head/etc/login.conf == --- head/etc/login.conf Tue Jun 19 11:39:56 2012(r237268) +++ head/etc/login.conf Tue Jun 19 14:46:18 2012(r237269) @@ -23,7 +23,7 @@ # AND SEMANTICS'' section of getcap(3) for more escape sequences). default:\ - :passwd_format=md5:\ + :passwd_format=sha512:\ :copyright=/etc/COPYRIGHT:\ :welcome=/etc/motd:\ :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,FTP_PASSIVE_MODE=YES:\ Modified: head/lib/libutil/login.conf.5 == --- head/lib/libutil/login.conf.5 Tue Jun 19 11:39:56 2012 (r237268) +++ head/lib/libutil/login.conf.5 Tue Jun 19 14:46:18 2012 (r237269) @@ -267,7 +267,7 @@ The backoff delay is the number of tries multiplied by 5 seconds. .It "login-retries number 10 The number of login attempts" allowed before the login fails. -.It "passwd_format string md5 The encryption format that new or" +.It "passwd_format string sha512 The encryption format that new or" changed passwords will use. Valid values include "des", "md5", "blf", "sha256" and "sha512"; see .Xr crypt 3 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r237011 - head
Author: des Date: Wed Jun 13 16:40:47 2012 New Revision: 237011 URL: http://svn.freebsd.org/changeset/base/237011 Log: Also remove /usr/share/examples/etc/auth.conf, which I didn't even realize existed. Noticed by: Andrey Zonov MFC after:3 weeks Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Wed Jun 13 16:12:30 2012(r237010) +++ head/ObsoleteFiles.inc Wed Jun 13 16:40:47 2012(r237011) @@ -40,6 +40,7 @@ # 20120613: auth.conf removed OLD_FILES+=etc/auth.conf +OLD_FILES+=usr/share/examples/etc/auth.conf OLD_FILES+=usr/share/man/man3/auth.3.gz OLD_FILES+=usr/share/man/man5/auth.conf.5.gz # 20120530: kde pam lives now in ports ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r237006 - head
Author: des Date: Wed Jun 13 11:59:47 2012 New Revision: 237006 URL: http://svn.freebsd.org/changeset/base/237006 Log: Remove leading / MFC after:3 weeks Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Wed Jun 13 11:59:03 2012(r237005) +++ head/ObsoleteFiles.inc Wed Jun 13 11:59:47 2012(r237006) @@ -39,11 +39,11 @@ # done # 20120613: auth.conf removed -OLD_FILES+=/etc/auth.conf -OLD_FILES+=/usr/share/man/man3/auth.3.gz -OLD_FILES+=/usr/share/man/man5/auth.conf.5.gz +OLD_FILES+=etc/auth.conf +OLD_FILES+=usr/share/man/man3/auth.3.gz +OLD_FILES+=usr/share/man/man5/auth.conf.5.gz # 20120530: kde pam lives now in ports -OLD_FILES+=/etc/pam.d/kde +OLD_FILES+=etc/pam.d/kde # 20120505: new clang import installed a redundant internal header OLD_FILES+=usr/include/clang/3.1/stdalign.h # 20120428: MD2 removed from libmd ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r237005 - head
Author: des Date: Wed Jun 13 11:59:03 2012 New Revision: 237005 URL: http://svn.freebsd.org/changeset/base/237005 Log: Remove auth.conf and related files. Submitted by: trhodes@ MFC after:3 weeks Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Wed Jun 13 10:42:55 2012(r237004) +++ head/ObsoleteFiles.inc Wed Jun 13 11:59:03 2012(r237005) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20120613: auth.conf removed +OLD_FILES+=/etc/auth.conf +OLD_FILES+=/usr/share/man/man3/auth.3.gz +OLD_FILES+=/usr/share/man/man5/auth.conf.5.gz # 20120530: kde pam lives now in ports OLD_FILES+=/etc/pam.d/kde # 20120505: new clang import installed a redundant internal header ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236967 - head/lib/libcrypt
Author: des Date: Tue Jun 12 17:14:19 2012 New Revision: 236967 URL: http://svn.freebsd.org/changeset/base/236967 Log: Stop using auth_getval() now that it always returns NULL. Instead, hardcode the default to what it would be if we didn't hardcode it, i.e. DES if supported and MD5 otherwise. MFC after:3 weeks Modified: head/lib/libcrypt/Makefile head/lib/libcrypt/crypt.3 head/lib/libcrypt/crypt.c Modified: head/lib/libcrypt/Makefile == --- head/lib/libcrypt/Makefile Tue Jun 12 17:04:56 2012(r236966) +++ head/lib/libcrypt/Makefile Tue Jun 12 17:14:19 2012(r236967) @@ -26,11 +26,7 @@ SRCS+= crypt-des.c crypt-blowfish.c blo CFLAGS+= -I${.CURDIR} -DHAS_DES -DHAS_BLOWFISH .endif -# And the auth_getval() code and support. -.PATH: ${.CURDIR}/../libutil -SRCS+= auth.c property.c -.for sym in auth_getval property_find properties_read properties_free \ - MD4Init MD4Final MD4Update MD4Pad \ +.for sym in MD4Init MD4Final MD4Update MD4Pad \ MD5Init MD5Final MD5Update MD5Pad \ SHA256_Init SHA256_Final SHA256_Update \ SHA512_Init SHA512_Final SHA512_Update Modified: head/lib/libcrypt/crypt.3 == --- head/lib/libcrypt/crypt.3 Tue Jun 12 17:04:56 2012(r236966) +++ head/lib/libcrypt/crypt.3 Tue Jun 12 17:14:19 2012(r236967) @@ -238,12 +238,6 @@ The .Fn crypt_set_format function sets the default encoding format according to the supplied .Fa string . -.Pp -The global default format can be set using the -.Pa /etc/auth.conf -file using the -.Va crypt_default -property. .Sh RETURN VALUES The .Fn crypt @@ -260,9 +254,7 @@ Otherwise, a value of 0 is returned. .Sh SEE ALSO .Xr login 1 , .Xr passwd 1 , -.Xr auth_getval 3 , .Xr getpass 3 , -.Xr auth.conf 5 , .Xr passwd 5 .Sh HISTORY A rotor-based Modified: head/lib/libcrypt/crypt.c == --- head/lib/libcrypt/crypt.c Tue Jun 12 17:04:56 2012(r236966) +++ head/lib/libcrypt/crypt.c Tue Jun 12 17:14:19 2012(r236967) @@ -79,23 +79,23 @@ static const struct { } }; +#ifdef HAS_DES +#define CRYPT_DEFAULT "des" +#else +#define CRYPT_DEFAULT "md5" +#endif + static int crypt_type = -1; static void crypt_setdefault(void) { - char *def; size_t i; if (crypt_type != -1) return; - def = auth_getval("crypt_default"); - if (def == NULL) { - crypt_type = 0; - return; - } for (i = 0; i < sizeof(crypt_types) / sizeof(crypt_types[0]) - 1; i++) { - if (strcmp(def, crypt_types[i].name) == 0) { + if (strcmp(CRYPT_DEFAULT, crypt_types[i].name) == 0) { crypt_type = (int)i; return; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236966 - head/sys/mips/rmi
Author: des Date: Tue Jun 12 17:04:56 2012 New Revision: 236966 URL: http://svn.freebsd.org/changeset/base/236966 Log: auth.conf is dead. Modified: head/sys/mips/rmi/rootfs_list.txt Modified: head/sys/mips/rmi/rootfs_list.txt == --- head/sys/mips/rmi/rootfs_list.txt Tue Jun 12 17:02:53 2012 (r236965) +++ head/sys/mips/rmi/rootfs_list.txt Tue Jun 12 17:04:56 2012 (r236966) @@ -1,3 +1,5 @@ +# $FreeBSD$ +# # This is the list of files that # should be in your rootfs (copy it from # the build world nfsmount dir. When the rge0 @@ -321,7 +323,6 @@ ./etc/ssh/moduli ./etc/ssl ./etc/ssl/openssl.cnf -./etc/auth.conf ./etc/crontab ./etc/devd.conf ./etc/devfs.conf ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236965 - in head: etc include lib/libutil share/examples/etc
Author: des Date: Tue Jun 12 17:02:53 2012 New Revision: 236965 URL: http://svn.freebsd.org/changeset/base/236965 Log: Finally nuke auth.conf, nine years after it was deprecated. The only thing it was still used for was to set the "global default" password hash. Since the stock auth.conf contained nothing but comments, the global default was actually the first algorithm in crypt(3)'s list, which happens to be DES; I take the fact that nobody noticed as proof that it was not used outside of crypt(3). The only other use in our tree was in the Kerberos support code in in tinyware's passwd(1). I removed that code in an earlier commit; it would not have compiled anyway, as it only supported Kerberos IV. The auth_getval() function is now a stub that always returns NULL, which has the same effect as a functional auth_getval() with an empty auth.conf. MFC after:3 weeks Deleted: head/etc/auth.conf head/lib/libutil/auth.3 head/lib/libutil/auth.conf.5 Modified: head/etc/Makefile head/include/paths.h head/lib/libutil/Makefile head/lib/libutil/auth.c head/lib/libutil/property.3 head/share/examples/etc/README.examples Modified: head/etc/Makefile == --- head/etc/Makefile Tue Jun 12 16:07:03 2012(r236964) +++ head/etc/Makefile Tue Jun 12 17:02:53 2012(r236965) @@ -7,8 +7,7 @@ SUBDIR=sendmail .endif -BIN1= auth.conf \ - crontab \ +BIN1= crontab \ devd.conf \ devfs.conf \ ddb.conf \ Modified: head/include/paths.h == --- head/include/paths.hTue Jun 12 16:07:03 2012(r236964) +++ head/include/paths.hTue Jun 12 17:02:53 2012(r236965) @@ -42,7 +42,6 @@ /* Locate system binaries. */ #define_PATH_SYSPATH "/sbin:/usr/sbin" -#define_PATH_AUTHCONF "/etc/auth.conf" #define_PATH_BSHELL"/bin/sh" #define_PATH_CAPABILITY"/etc/capability" #define_PATH_CAPABILITY_DB "/etc/capability.db" Modified: head/lib/libutil/Makefile == --- head/lib/libutil/Makefile Tue Jun 12 16:07:03 2012(r236964) +++ head/lib/libutil/Makefile Tue Jun 12 17:02:53 2012(r236965) @@ -25,14 +25,13 @@ CFLAGS+= -DINET6 CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../libc/gen/ -MAN+= auth.3 expand_number.3 flopen.3 fparseln.3 hexdump.3 \ +MAN+= expand_number.3 flopen.3 fparseln.3 hexdump.3 \ humanize_number.3 kinfo_getallproc.3 kinfo_getfile.3 \ kinfo_getproc.3 kinfo_getvmmap.3 kld.3 login_auth.3 login_cap.3 \ login_class.3 login_ok.3 login_times.3 login_tty.3 pidfile.3 \ property.3 pty.3 quotafile.3 realhostname.3 realhostname_sa.3 \ _secure_path.3 trimdomain.3 uucplock.3 -MAN+= auth.conf.5 login.conf.5 -MLINKS+= auth.3 auth_getval.3 +MAN+= login.conf.5 MLINKS+= kld.3 kld_isloaded.3 kld.3 kld_load.3 MLINKS+=login_auth.3 auth_cat.3 login_auth.3 auth_checknologin.3 MLINKS+=login_cap.3 login_close.3 login_cap.3 login_getcapbool.3 \ Modified: head/lib/libutil/auth.c == --- head/lib/libutil/auth.c Tue Jun 12 16:07:03 2012(r236964) +++ head/lib/libutil/auth.c Tue Jun 12 17:02:53 2012(r236965) @@ -31,40 +31,14 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include -#include -#include -#include - -static properties P; - -static int -initauthconf(const char *path) -{ -int fd; +#include -if (!P) { - if ((fd = open(path, O_RDONLY)) < 0) { - syslog(LOG_ERR, "initauthconf: unable to open file: %s", path); - return 1; - } - P = properties_read(fd); - close(fd); - if (!P) { - syslog(LOG_ERR, "initauthconf: unable to parse file: %s", path); - return 1; - } -} -return 0; -} +#include char * auth_getval(const char *name) { -if (!P && initauthconf(_PATH_AUTHCONF)) - return NULL; -else - return property_find(P, name); + + (void)name; + return (NULL); } Modified: head/lib/libutil/property.3 == --- head/lib/libutil/property.3 Tue Jun 12 16:07:03 2012(r236964) +++ head/lib/libutil/property.3 Tue Jun 12 17:02:53 2012(r236965) @@ -90,8 +90,6 @@ are desired, the entire value should be characters. Any line beginning with a # or ; character is assumed to be a comment and will be ignored. -.Sh SEE ALSO -.Xr auth_getval 3 .Sh AUTHORS .An Jordan Hubbard .Sh BUGS Modified: head/share/examples/etc/README.examples == --- head/share/examples/etc/README.examples Tue Jun 12
svn commit: r236963 - head/release/picobsd/tinyware/passwd
Author: des Date: Tue Jun 12 15:32:14 2012 New Revision: 236963 URL: http://svn.freebsd.org/changeset/base/236963 Log: Remove dead code. Modified: head/release/picobsd/tinyware/passwd/passwd.c Modified: head/release/picobsd/tinyware/passwd/passwd.c == --- head/release/picobsd/tinyware/passwd/passwd.c Tue Jun 12 15:04:18 2012(r236962) +++ head/release/picobsd/tinyware/passwd/passwd.c Tue Jun 12 15:32:14 2012(r236963) @@ -64,10 +64,6 @@ int yp_errno = YP_TRUE; extern int yp_passwd( char * ); #endif -#ifdef KERBEROS -#include "krb.h" -#endif - #include "extern.h" static void usage(void); @@ -81,26 +77,12 @@ main(argc, argv) { int ch; char *uname; -#ifdef KERBEROS - char *iflag = 0, *rflag = 0, *uflag = 0; - char *k; -#endif #ifdef YP -#ifdef KERBEROS - char realm[REALM_SZ]; -#define OPTIONS "d:h:lysfoi:r:u:" -#else #define OPTIONS "d:h:lysfo" -#endif -#else -#ifdef KERBEROS - char realm[REALM_SZ]; -#define OPTIONS "li:r:u:" #else #define OPTIONS "l" #endif -#endif #ifdef YP int res = 0; @@ -113,17 +95,6 @@ main(argc, argv) case 'l': /* change local password file */ use_local_passwd = 1; break; -#ifdef KERBEROS - case 'i': - iflag = optarg; - break; - case 'r': - rflag = optarg; - break; - case 'u': - uflag = optarg; - break; -#endif /* KERBEROS */ #ifdef YP case 'y': /* Change NIS password */ __use_yp = 1; @@ -182,46 +153,29 @@ main(argc, argv) /* * If NIS is turned on in the password database, use it, else punt. */ -#ifdef KERBEROS - if (__use_yp || (iflag == NULL && rflag == NULL && uflag == NULL)) { -#endif - res = use_yp(uname, 0, 0); - if (res == USER_YP_ONLY) { - if (!use_local_passwd) { - exit(yp_passwd(uname)); - } else { + res = use_yp(uname, 0, 0); + if (res == USER_YP_ONLY) { + if (!use_local_passwd) { + exit(yp_passwd(uname)); + } else { /* * Reject -l flag if NIS is turned on and the user * doesn't exist in the local password database. */ - errx(1, "unknown local user: %s", uname); - } - } else if (res == USER_LOCAL_ONLY) { - /* -* Reject -y flag if user only exists locally. -*/ - if (__use_yp) - errx(1, "unknown NIS user: %s", uname); - } else if (res == USER_YP_AND_LOCAL) { - if (!use_local_passwd && (yp_in_pw_file || __use_yp)) - exit(yp_passwd(uname)); + errx(1, "unknown local user: %s", uname); } -#ifdef KERBEROS + } else if (res == USER_LOCAL_ONLY) { + /* +* Reject -y flag if user only exists locally. +*/ + if (__use_yp) + errx(1, "unknown NIS user: %s", uname); + } else if (res == USER_YP_AND_LOCAL) { + if (!use_local_passwd && (yp_in_pw_file || __use_yp)) + exit(yp_passwd(uname)); } #endif -#endif - if (!use_local_passwd) { -#ifdef KERBEROS - k = auth_getval("auth_list"); - if (k && strstr(k, "kerberos")) - if(krb_get_lrealm(realm, 0) == KSUCCESS) { - setuid(getuid()); - fprintf(stderr, "realm %s\n", realm); - exit(krb_passwd(argv[0], iflag, rflag, uflag)); - } -#endif - } exit(local_passwd(uname)); } @@ -230,21 +184,10 @@ usage() { #ifdef YP -#ifdef KERBEROS - fprintf(stderr, "%s\n%s\n", - "usage: passwd [-l] [-i instance] [-r realm] [-u fullname]", - " passwd [-l] [-y] [-o] [-d domain [-h host]] [user]"); -#else (void)fprintf(stderr, "usage: passwd [-l] [-y] [-o] [-d domain [-h host]] [user]\n"); -#endif #else -#ifdef KERBEROS - fprintf(stderr, - "usage: passwd [-l] [-i instance] [-r realm] [-u fullname] [user]\n"); -#else - (void)fprintf(stderr, "usage: passwd user\n"); -#endif + (void)fprintf(stderr, "usage: passwd [-l] user\n"); #endif exit(1); } ___ svn-src-head@freebsd.org mailing list h
svn commit: r236892 - in head: bin/rcp libexec/rshd usr.bin/login usr.bin/passwd usr.bin/rlogin usr.bin/rsh
Author: des Date: Mon Jun 11 16:18:39 2012 New Revision: 236892 URL: http://svn.freebsd.org/changeset/base/236892 Log: None of these programs actually use auth.conf. MFC after:1 week Modified: head/bin/rcp/rcp.1 head/libexec/rshd/rshd.8 head/usr.bin/login/login.1 head/usr.bin/passwd/passwd.1 head/usr.bin/rlogin/rlogin.1 head/usr.bin/rsh/rsh.1 Modified: head/bin/rcp/rcp.1 == --- head/bin/rcp/rcp.1 Mon Jun 11 16:08:03 2012(r236891) +++ head/bin/rcp/rcp.1 Mon Jun 11 16:18:39 2012(r236892) @@ -116,17 +116,11 @@ The .Nm utility handles third party copies, where neither source nor target files are on the current machine. -.Sh FILES -.Bl -tag -width ".Pa /etc/auth.conf" -compact -.It Pa /etc/auth.conf -configure authentication services -.El .Sh SEE ALSO .Xr cp 1 , .Xr ftp 1 , .Xr rlogin 1 , .Xr rsh 1 , -.Xr auth.conf 5 , .Xr hosts.equiv 5 .Sh HISTORY The Modified: head/libexec/rshd/rshd.8 == --- head/libexec/rshd/rshd.8Mon Jun 11 16:08:03 2012(r236891) +++ head/libexec/rshd/rshd.8Mon Jun 11 16:18:39 2012(r236892) @@ -237,7 +237,6 @@ and is not preceded by a flag byte. .Xr gethostbyaddr 3 , .Xr rcmd 3 , .Xr ruserok 3 , -.Xr auth.conf 5 , .Xr hosts 5 , .Xr hosts.equiv 5 , .Xr login.conf 5 , Modified: head/usr.bin/login/login.1 == --- head/usr.bin/login/login.1 Mon Jun 11 16:08:03 2012(r236891) +++ head/usr.bin/login/login.1 Mon Jun 11 16:18:39 2012(r236892) @@ -137,8 +137,6 @@ message-of-the-day system mailboxes .It Pa \&.hushlogin makes login quieter -.It Pa /etc/auth.conf -configure authentication services .It Pa /etc/pam.d/login .Xr pam 8 configuration file Modified: head/usr.bin/passwd/passwd.1 == --- head/usr.bin/passwd/passwd.1Mon Jun 11 16:08:03 2012 (r236891) +++ head/usr.bin/passwd/passwd.1Mon Jun 11 16:18:39 2012 (r236892) @@ -221,8 +221,6 @@ a Version 7 format password file temporary copy of the password file .It Pa /etc/login.conf login class capabilities database -.It Pa /etc/auth.conf -configure authentication services .El .Sh SEE ALSO .Xr chpass 1 , Modified: head/usr.bin/rlogin/rlogin.1 == --- head/usr.bin/rlogin/rlogin.1Mon Jun 11 16:08:03 2012 (r236891) +++ head/usr.bin/rlogin/rlogin.1Mon Jun 11 16:18:39 2012 (r236892) @@ -128,7 +128,6 @@ Determines the user's terminal type. .Bl -tag -width /etc/hosts -compact .It Pa /etc/hosts .It Pa /etc/hosts.equiv -.It Pa /etc/auth.conf .It Ev $HOME Ns Pa /.rhosts .El .Sh SEE ALSO @@ -138,7 +137,6 @@ Determines the user's terminal type. .Xr setsockopt 2 , .Xr ruserok 3 , .Xr tty 4 , -.Xr auth.conf 5 , .Xr hosts 5 , .Xr hosts.equiv 5 , .Xr rlogind 8 , Modified: head/usr.bin/rsh/rsh.1 == --- head/usr.bin/rsh/rsh.1 Mon Jun 11 16:08:03 2012(r236891) +++ head/usr.bin/rsh/rsh.1 Mon Jun 11 16:18:39 2012(r236892) @@ -125,14 +125,12 @@ to .Sh FILES .Bl -tag -width /etc/hosts -compact .It Pa /etc/hosts -.It Pa /etc/auth.conf .El .Sh SEE ALSO .Xr rlogin 1 , .Xr setsockopt 2 , .Xr rcmd 3 , .Xr ruserok 3 , -.Xr auth.conf 5 , .Xr hosts 5 , .Xr hosts.equiv 5 , .Xr rlogind 8 , ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236751 - head/lib/libutil
Author: des Date: Fri Jun 8 12:36:08 2012 New Revision: 236751 URL: http://svn.freebsd.org/changeset/base/236751 Log: Document that we also support sha256 and sha512. MFC after:1 week Modified: head/lib/libutil/login.conf.5 Modified: head/lib/libutil/login.conf.5 == --- head/lib/libutil/login.conf.5 Fri Jun 8 12:35:43 2012 (r236750) +++ head/lib/libutil/login.conf.5 Fri Jun 8 12:36:08 2012 (r236751) @@ -269,7 +269,9 @@ multiplied by 5 seconds. allowed before the login fails. .It "passwd_format string md5 The encryption format that new or" changed passwords will use. -Valid values include "des", "md5" and "blf". +Valid values include "des", "md5", "blf", "sha256" and "sha512"; see +.Xr crypt 3 +for details. NIS clients using a .No non- Ns Fx NIS server should probably use "des". ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236614 - head/gnu/lib/libsupc++
Author: des Date: Tue Jun 5 12:34:08 2012 New Revision: 236614 URL: http://svn.freebsd.org/changeset/base/236614 Log: Add mangled symbols for operator new / delete on 64-bit platforms. Reported by: decke@ MFC after:1 week Modified: head/gnu/lib/libsupc++/Version.map Modified: head/gnu/lib/libsupc++/Version.map == --- head/gnu/lib/libsupc++/Version.map Tue Jun 5 11:48:32 2012 (r236613) +++ head/gnu/lib/libsupc++/Version.map Tue Jun 5 12:34:08 2012 (r236614) @@ -126,11 +126,19 @@ CXXABI_1.3 { # __gnu_cxx::_verbose_terminate_handler() _ZN9__gnu_cxx27__verbose_terminate_handlerEv; -# new / delete operators +# operator new and new[], 32-bit size_t _Znaj; _ZnajRKSt9nothrow_t; _Znwj; _ZnwjRKSt9nothrow_t; + +# operator new and new[], 64-bit size_t +_Znam; +_ZnamRKSt9nothrow_t; +_Znwm; +_ZnwmRKSt9nothrow_t; + +# operator delete and delete[] _ZdaPv; _ZdaPvRKSt9nothrow_t; _ZdlPv; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236226 - head/usr.bin/unzip
Author: des Date: Tue May 29 09:11:19 2012 New Revision: 236226 URL: http://svn.freebsd.org/changeset/base/236226 Log: Pass a filename, rather than a file descriptor, to libarchive. Submitted by: Alex Kozlov MFC after:1 week Modified: head/usr.bin/unzip/unzip.c Modified: head/usr.bin/unzip/unzip.c == --- head/usr.bin/unzip/unzip.c Tue May 29 08:56:56 2012(r236225) +++ head/usr.bin/unzip/unzip.c Tue May 29 09:11:19 2012(r236226) @@ -865,19 +865,14 @@ unzip(const char *fn) { struct archive *a; struct archive_entry *e; - int fd, ret; + int ret; uintmax_t total_size, file_count, error_count; - if (strcmp(fn, "-") == 0) - fd = STDIN_FILENO; - else if ((fd = open(fn, O_RDONLY)) < 0) - error("%s", fn); - if ((a = archive_read_new()) == NULL) error("archive_read_new failed"); ac(archive_read_support_format_zip(a)); - ac(archive_read_open_fd(a, fd, 8192)); + ac(archive_read_open_filename(a, fn, 8192)); if (!zipinfo_mode) { if (!p_opt && !q_opt) @@ -933,9 +928,6 @@ unzip(const char *fn) ac(archive_read_close(a)); (void)archive_read_finish(a); - if (fd != STDIN_FILENO && close(fd) != 0) - error("%s", fn); - if (t_opt) { if (error_count > 0) { errorx("%d checksum error(s) found.", error_count); @@ -1061,6 +1053,9 @@ main(int argc, char *argv[]) usage(); zipfile = argv[nopts++]; + if (strcmp(zipfile, "-") == 0) + zipfile = NULL; /* STDIN */ + while (nopts < argc && *argv[nopts] != '-') add_pattern(&include, argv[nopts++]); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236126 - head/contrib/openpam/lib
Author: des Date: Sat May 26 23:10:21 2012 New Revision: 236126 URL: http://svn.freebsd.org/changeset/base/236126 Log: OpenPAM Micrampelis was re-rolled due to a showstopper bug. Modified: head/contrib/openpam/lib/openpam_configure.c Directory Properties: head/contrib/openpam/ (props changed) Modified: head/contrib/openpam/lib/openpam_configure.c == --- head/contrib/openpam/lib/openpam_configure.cSat May 26 23:08:53 2012(r236125) +++ head/contrib/openpam/lib/openpam_configure.cSat May 26 23:10:21 2012(r236126) @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: openpam_configure.c 601 2012-04-14 20:37:45Z des $ + * $Id: openpam_configure.c 612 2012-05-26 23:02:55Z des $ */ #ifdef HAVE_CONFIG_H @@ -261,6 +261,8 @@ openpam_parse_chain(pam_handle_t *pamh, this->optc = wordc - i; for (i = 0; i < wordc - this->optc; ++i) { FREE(wordv[i]); + } + for (i = 0; i < this->optc; ++i) { wordv[i] = wordv[wordc - this->optc + i]; wordv[wordc - this->optc + i] = NULL; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236110 - head/usr.bin/fetch
Author: des Date: Sat May 26 17:19:41 2012 New Revision: 236110 URL: http://svn.freebsd.org/changeset/base/236110 Log: Revert r232274 - unauthorized, unnecessary and incorrect. Modified: head/usr.bin/fetch/fetch.1 Modified: head/usr.bin/fetch/fetch.1 == --- head/usr.bin/fetch/fetch.1 Sat May 26 17:10:16 2012(r236109) +++ head/usr.bin/fetch/fetch.1 Sat May 26 17:19:41 2012(r236110) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2000-2012 Dag-Erling Smørgrav +.\" Copyright (c) 2000-2011 Dag-Erling Smørgrav .\" All rights reserved. .\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used .\" by permission. @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 28, 2012 +.Dd September 27, 2011 .Dt FETCH 1 .Os .Sh NAME @@ -214,11 +214,6 @@ When the flag is specified, wait this many seconds between successive retries. .El .Pp -.Ar URL -.Bd -literal -:(//((:)?@)?(:)?)?/()? -.Ed -.Pp If .Nm receives a ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r236109 - in head: contrib/openpam contrib/openpam/bin contrib/openpam/bin/openpam_dump_policy contrib/openpam/bin/pamtest contrib/openpam/bin/su contrib/openpam/doc/man contrib/openpam...
Author: des Date: Sat May 26 17:10:16 2012 New Revision: 236109 URL: http://svn.freebsd.org/changeset/base/236109 Log: Update to OpenPAM Micrampelis. Added: head/contrib/openpam/TODO - copied unchanged from r236101, vendor/openpam/dist/TODO head/contrib/openpam/bin/openpam_dump_policy/ - copied from r236101, vendor/openpam/dist/bin/openpam_dump_policy/ head/contrib/openpam/doc/man/openpam_get_feature.3 - copied unchanged from r236101, vendor/openpam/dist/doc/man/openpam_get_feature.3 head/contrib/openpam/doc/man/openpam_readlinev.3 - copied unchanged from r236101, vendor/openpam/dist/doc/man/openpam_readlinev.3 head/contrib/openpam/doc/man/openpam_readword.3 - copied unchanged from r236101, vendor/openpam/dist/doc/man/openpam_readword.3 head/contrib/openpam/doc/man/openpam_set_feature.3 - copied unchanged from r236101, vendor/openpam/dist/doc/man/openpam_set_feature.3 head/contrib/openpam/doc/man/openpam_straddch.3 - copied unchanged from r236101, vendor/openpam/dist/doc/man/openpam_straddch.3 head/contrib/openpam/lib/openpam_ctype.h - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_ctype.h head/contrib/openpam/lib/openpam_features.c - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_features.c head/contrib/openpam/lib/openpam_features.h - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_features.h head/contrib/openpam/lib/openpam_get_feature.c - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_get_feature.c head/contrib/openpam/lib/openpam_readlinev.c - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_readlinev.c head/contrib/openpam/lib/openpam_readword.c - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_readword.c head/contrib/openpam/lib/openpam_set_feature.c - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_set_feature.c head/contrib/openpam/lib/openpam_straddch.c - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_straddch.c head/contrib/openpam/lib/openpam_strlcat.h - copied unchanged from r236101, vendor/openpam/dist/lib/openpam_strlcat.h head/contrib/openpam/pamgdb.in - copied unchanged from r236101, vendor/openpam/dist/pamgdb.in head/contrib/openpam/t/ - copied from r236101, vendor/openpam/dist/t/ head/usr.bin/pamtest/ head/usr.bin/pamtest/Makefile (contents, props changed) Modified: head/contrib/openpam/CREDITS head/contrib/openpam/HISTORY head/contrib/openpam/LICENSE head/contrib/openpam/Makefile.am head/contrib/openpam/Makefile.in head/contrib/openpam/RELNOTES head/contrib/openpam/aclocal.m4 head/contrib/openpam/bin/Makefile.am head/contrib/openpam/bin/Makefile.in head/contrib/openpam/bin/pamtest/pamtest.1 head/contrib/openpam/bin/pamtest/pamtest.c head/contrib/openpam/bin/su/su.1 head/contrib/openpam/config.h.in head/contrib/openpam/configure head/contrib/openpam/configure.ac head/contrib/openpam/doc/man/Makefile.am head/contrib/openpam/doc/man/Makefile.in head/contrib/openpam/doc/man/openpam.3 head/contrib/openpam/doc/man/openpam_borrow_cred.3 head/contrib/openpam/doc/man/openpam_free_data.3 head/contrib/openpam/doc/man/openpam_free_envlist.3 head/contrib/openpam/doc/man/openpam_get_option.3 head/contrib/openpam/doc/man/openpam_log.3 head/contrib/openpam/doc/man/openpam_nullconv.3 head/contrib/openpam/doc/man/openpam_readline.3 head/contrib/openpam/doc/man/openpam_restore_cred.3 head/contrib/openpam/doc/man/openpam_set_option.3 head/contrib/openpam/doc/man/openpam_subst.3 head/contrib/openpam/doc/man/openpam_ttyconv.3 head/contrib/openpam/doc/man/pam.3 head/contrib/openpam/doc/man/pam.conf.5 head/contrib/openpam/doc/man/pam_acct_mgmt.3 head/contrib/openpam/doc/man/pam_authenticate.3 head/contrib/openpam/doc/man/pam_chauthtok.3 head/contrib/openpam/doc/man/pam_close_session.3 head/contrib/openpam/doc/man/pam_conv.3 head/contrib/openpam/doc/man/pam_end.3 head/contrib/openpam/doc/man/pam_error.3 head/contrib/openpam/doc/man/pam_get_authtok.3 head/contrib/openpam/doc/man/pam_get_data.3 head/contrib/openpam/doc/man/pam_get_item.3 head/contrib/openpam/doc/man/pam_get_user.3 head/contrib/openpam/doc/man/pam_getenv.3 head/contrib/openpam/doc/man/pam_getenvlist.3 head/contrib/openpam/doc/man/pam_info.3 head/contrib/openpam/doc/man/pam_open_session.3 head/contrib/openpam/doc/man/pam_prompt.3 head/contrib/openpam/doc/man/pam_putenv.3 head/contrib/openpam/doc/man/pam_set_data.3 head/contrib/openpam/doc/man/pam_set_item.3 head/contrib/openpam/doc/man/pam_setcred.3 head/contrib/openpam/doc/man/pam_setenv.3 head/contrib/openpam/doc/man/pam_sm_acct_mgmt.3 head/contrib/openpam/doc/man/pam_sm_authenticate.3 head/contrib/openpam/doc/man/pam_sm_chauthtok.3 head/contrib/openpam/doc/man/pam_sm_close_session.3 head/contrib/openpam/doc/man/pam_sm_ope
svn commit: r236106 - head/lib/libpam/modules/pam_ssh
Author: des Date: Sat May 26 17:03:45 2012 New Revision: 236106 URL: http://svn.freebsd.org/changeset/base/236106 Log: Passing NULL as a key casues a segfault when loading SSH 1 keys. Use an empty string instead. Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.c Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.c == --- head/lib/libpam/modules/pam_ssh/pam_ssh.c Sat May 26 16:42:47 2012 (r236105) +++ head/lib/libpam/modules/pam_ssh/pam_ssh.c Sat May 26 17:03:45 2012 (r236106) @@ -112,7 +112,7 @@ pam_ssh_load_key(const char *dir, const * with an empty passphrase, and if the key is not encrypted, * accept only an empty passphrase. */ - key = key_load_private(fn, NULL, &comment); + key = key_load_private(fn, "", &comment); if (key != NULL && !(*passphrase == '\0' && nullok)) { key_free(key); return (NULL); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r235788 - in head: . sys/sys
Author: des Date: Tue May 22 15:59:07 2012 New Revision: 235788 URL: http://svn.freebsd.org/changeset/base/235788 Log: Bump __FreeBSD_version for the byacc import, and update _bootstrap_tools. Modified: head/Makefile.inc1 head/sys/sys/param.h Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Tue May 22 15:58:27 2012(r235787) +++ head/Makefile.inc1 Tue May 22 15:59:07 2012(r235788) @@ -1021,6 +1021,9 @@ _sed= usr.bin/sed .if ${BOOTSTRAPPING} < 96 _lex= usr.bin/lex +.endif + +.if ${BOOTSTRAPPING} < 113 _yacc= usr.bin/yacc .endif @@ -1081,8 +1084,8 @@ bootstrap-tools: ${_mklocale} \ usr.bin/rpcgen \ ${_sed} \ -${_lex} \ ${_yacc} \ +${_lex} \ usr.bin/xinstall \ ${_gensnmptree} \ usr.sbin/config Modified: head/sys/sys/param.h == --- head/sys/sys/param.hTue May 22 15:58:27 2012(r235787) +++ head/sys/sys/param.hTue May 22 15:59:07 2012(r235788) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 112 /* Master, propagated to newvers */ +#define __FreeBSD_version 113 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r234838 - head/lib/libfetch
Author: des Date: Mon Apr 30 12:12:48 2012 New Revision: 234838 URL: http://svn.freebsd.org/changeset/base/234838 Log: Don't reuse credentials if redirected to a different host. Submitted by: Niels Heinen MFC after:3 weeks Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c == --- head/lib/libfetch/http.cMon Apr 30 12:11:45 2012(r234837) +++ head/lib/libfetch/http.cMon Apr 30 12:12:48 2012(r234838) @@ -1779,7 +1779,9 @@ http_request(struct url *URL, const char DEBUG(fprintf(stderr, "failed to parse new URL\n")); goto ouch; } - if (!*new->user && !*new->pwd) { + + /* Only copy credentials if the host matches */ + if (!strcmp(new->host, url->host) && !*new->user && !*new->pwd) { strcpy(new->user, url->user); strcpy(new->pwd, url->pwd); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r234837 - head/lib/libfetch
Author: des Date: Mon Apr 30 12:11:45 2012 New Revision: 234837 URL: http://svn.freebsd.org/changeset/base/234837 Log: Since the socket is non-blocking, it is necessary to use select(2) even when there is no timeout, because read(2) will return immediately if there is no data waiting in the TCP buffer, causing fetch_read() to busy-loop on slow connections. MFC after:3 weeks Noticed by: Yanhui Shen Modified: head/lib/libfetch/common.c Modified: head/lib/libfetch/common.c == --- head/lib/libfetch/common.c Mon Apr 30 11:28:17 2012(r234836) +++ head/lib/libfetch/common.c Mon Apr 30 12:11:45 2012(r234837) @@ -455,11 +455,9 @@ fetch_read(conn_t *conn, char *buf, size struct timeval now, timeout, delta; fd_set readfds; ssize_t rlen, total; - int r; char *start; - if (fetchTimeout) { - FD_ZERO(&readfds); + if (fetchTimeout > 0) { gettimeofday(&timeout, NULL); timeout.tv_sec += fetchTimeout; } @@ -523,23 +521,21 @@ fetch_read(conn_t *conn, char *buf, size return (-1); } // assert(rlen == FETCH_READ_WAIT); - while (fetchTimeout && !FD_ISSET(conn->sd, &readfds)) { + FD_ZERO(&readfds); + while (!FD_ISSET(conn->sd, &readfds)) { FD_SET(conn->sd, &readfds); - gettimeofday(&now, NULL); - delta.tv_sec = timeout.tv_sec - now.tv_sec; - delta.tv_usec = timeout.tv_usec - now.tv_usec; - if (delta.tv_usec < 0) { - delta.tv_usec += 100; - delta.tv_sec--; - } - if (delta.tv_sec < 0) { - errno = ETIMEDOUT; - fetch_syserr(); - return (-1); + if (fetchTimeout > 0) { + gettimeofday(&now, NULL); + if (!timercmp(&timeout, &now, >)) { + errno = ETIMEDOUT; + fetch_syserr(); + return (-1); + } + timersub(&timeout, &now, &delta); } errno = 0; - r = select(conn->sd + 1, &readfds, NULL, NULL, &delta); - if (r == -1) { + if (select(conn->sd + 1, &readfds, NULL, NULL, + fetchTimeout > 0 ? &delta : NULL) < 0) { if (errno == EINTR) { if (fetchRestartCalls) continue; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r234729 - head/contrib/openpam/lib
Author: des Date: Fri Apr 27 11:29:09 2012 New Revision: 234729 URL: http://svn.freebsd.org/changeset/base/234729 Log: r234173 missed one instance of FREE(line). Noticed by: glebius@ Modified: head/contrib/openpam/lib/openpam_configure.c Modified: head/contrib/openpam/lib/openpam_configure.c == --- head/contrib/openpam/lib/openpam_configure.cFri Apr 27 09:22:46 2012(r234728) +++ head/contrib/openpam/lib/openpam_configure.cFri Apr 27 11:29:09 2012(r234729) @@ -501,7 +501,7 @@ fail: FREE(this->optv); } FREE(this); - FREE(line); + FREE(line0); FREE(name); fclose(f); return (PAM_SYSTEM_ERR); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r234685 - head/lib/msun/src
Author: des Date: Wed Apr 25 18:07:35 2012 New Revision: 234685 URL: http://svn.freebsd.org/changeset/base/234685 Log: I stopped using my middle name years ago. Modified: head/lib/msun/src/s_fabsl.c Modified: head/lib/msun/src/s_fabsl.c == --- head/lib/msun/src/s_fabsl.c Wed Apr 25 17:54:26 2012(r234684) +++ head/lib/msun/src/s_fabsl.c Wed Apr 25 18:07:35 2012(r234685) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2003 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2003 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r234311 - head/usr.bin/unzip
Author: des Date: Sun Apr 15 13:39:39 2012 New Revision: 234311 URL: http://svn.freebsd.org/changeset/base/234311 Log: Correct my name in the copyright statement. Modified: head/usr.bin/unzip/unzip.1 head/usr.bin/unzip/unzip.c Modified: head/usr.bin/unzip/unzip.1 == --- head/usr.bin/unzip/unzip.1 Sun Apr 15 13:25:51 2012(r234310) +++ head/usr.bin/unzip/unzip.1 Sun Apr 15 13:39:39 2012(r234311) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2007-2008 Dag-Erling Coïdan Smørgrav +.\" Copyright (c) 2007-2008 Dag-Erling Smørgrav .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: head/usr.bin/unzip/unzip.c == --- head/usr.bin/unzip/unzip.c Sun Apr 15 13:25:51 2012(r234310) +++ head/usr.bin/unzip/unzip.c Sun Apr 15 13:39:39 2012(r234311) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2009 Joerg Sonnenberger - * Copyright (c) 2007-2008 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2007-2008 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r234173 - head/contrib/openpam/lib
Author: des Date: Thu Apr 12 11:23:24 2012 New Revision: 234173 URL: http://svn.freebsd.org/changeset/base/234173 Log: Keep a copy of the original pointer returned by openpam_readline() so we can free it later, instead of trying to free a pointer that points to the end of the buffer. Committed to head because this code no longer exists upstream. Submitted by: jasone@ Modified: head/contrib/openpam/lib/openpam_configure.c Modified: head/contrib/openpam/lib/openpam_configure.c == --- head/contrib/openpam/lib/openpam_configure.cThu Apr 12 10:48:43 2012(r234172) +++ head/contrib/openpam/lib/openpam_configure.cThu Apr 12 11:23:24 2012(r234173) @@ -360,7 +360,7 @@ openpam_parse_chain(pam_handle_t *pamh, pam_chain_t *this, **next; pam_facility_t fclt; pam_control_t ctlf; - char *line, *str, *name; + char *line0, *line, *str, *name; char *option, **optv; int len, lineno, ret; FILE *f; @@ -377,18 +377,18 @@ openpam_parse_chain(pam_handle_t *pamh, this = NULL; name = NULL; lineno = 0; - while ((line = openpam_readline(f, &lineno, NULL)) != NULL) { + while ((line0 = line = openpam_readline(f, &lineno, NULL)) != NULL) { /* get service name if necessary */ if (style == pam_conf_style) { if ((len = parse_service_name(&line, &str)) == 0) { openpam_log(PAM_LOG_NOTICE, "%s(%d): invalid service name (ignored)", filename, lineno); - FREE(line); + FREE(line0); continue; } if (strlcmp(service, str, len) != 0) { - FREE(line); + FREE(line0); continue; } } @@ -401,7 +401,7 @@ openpam_parse_chain(pam_handle_t *pamh, goto fail; } if (facility != fclt && facility != PAM_FACILITY_ANY) { - FREE(line); + FREE(line0); continue; } @@ -425,7 +425,7 @@ openpam_parse_chain(pam_handle_t *pamh, FREE(name); if (ret != PAM_SUCCESS) goto fail; - FREE(line); + FREE(line0); continue; } @@ -486,7 +486,7 @@ openpam_parse_chain(pam_handle_t *pamh, this = NULL; /* next please... */ - FREE(line); + FREE(line0); } if (!feof(f)) goto syserr; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r230478 - head/lib/libfetch
Author: des Date: Mon Jan 23 09:23:07 2012 New Revision: 230478 URL: http://svn.freebsd.org/changeset/base/230478 Log: Fix two nits in previous commit pointed out by pjd@. MFC after:3 weeks Modified: head/lib/libfetch/common.c Modified: head/lib/libfetch/common.c == --- head/lib/libfetch/common.c Mon Jan 23 08:30:17 2012(r230477) +++ head/lib/libfetch/common.c Mon Jan 23 09:23:07 2012(r230478) @@ -416,7 +416,6 @@ fetch_cache_data(conn_t *conn, char *src if (conn->cache.size < nbytes) { tmp = realloc(conn->cache.buf, nbytes); if (tmp == NULL) { - errno = ENOMEM; fetch_syserr(); return (-1); } @@ -481,7 +480,7 @@ fetch_read(conn_t *conn, char *buf, size conn->cache.len -= total; conn->cache.pos += total; len -= total; - buf+= total; + buf += total; } while (len > 0) { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r230307 - in head: lib/libfetch usr.bin/fetch
Author: des Date: Wed Jan 18 15:13:21 2012 New Revision: 230307 URL: http://svn.freebsd.org/changeset/base/230307 Log: Fix two issues related to the use of SIGINFO in fetch(1) to display progress information. The first is that fetch_read() (used in the HTTP code but not the FTP code) can enter an infinite loop if it has previously been interrupted by a signal. The second is that when it is interrupted, fetch_read() will discard any data it may have read up to that point. Luckily, both bugs are extremely timing-sensitive and therefore difficult to trigger. PR: bin/153240 Submitted by: Mark MFC after:3 weeks Modified: head/lib/libfetch/common.c head/lib/libfetch/common.h head/lib/libfetch/http.c head/usr.bin/fetch/fetch.c Modified: head/lib/libfetch/common.c == --- head/lib/libfetch/common.c Wed Jan 18 14:41:26 2012(r230306) +++ head/lib/libfetch/common.c Wed Jan 18 15:13:21 2012(r230307) @@ -404,6 +404,34 @@ fetch_ssl_read(SSL *ssl, char *buf, size } #endif +/* + * Cache some data that was read from a socket but cannot be immediately + * returned because of an interrupted system call. + */ +static int +fetch_cache_data(conn_t *conn, char *src, size_t nbytes) +{ + char *tmp; + + if (conn->cache.size < nbytes) { + tmp = realloc(conn->cache.buf, nbytes); + if (tmp == NULL) { + errno = ENOMEM; + fetch_syserr(); + return (-1); + } + conn->cache.buf = tmp; + conn->cache.size = nbytes; + } + + memcpy(conn->cache.buf, src, nbytes); + conn->cache.len = nbytes; + conn->cache.pos = 0; + + return (0); +} + + static ssize_t fetch_socket_read(int sd, char *buf, size_t len) { @@ -429,6 +457,7 @@ fetch_read(conn_t *conn, char *buf, size fd_set readfds; ssize_t rlen, total; int r; + char *start; if (fetchTimeout) { FD_ZERO(&readfds); @@ -437,6 +466,24 @@ fetch_read(conn_t *conn, char *buf, size } total = 0; + start = buf; + + if (conn->cache.len > 0) { + /* +* The last invocation of fetch_read was interrupted by a +* signal after some data had been read from the socket. Copy +* the cached data into the supplied buffer before trying to +* read from the socket again. +*/ + total = (conn->cache.len < len) ? conn->cache.len : len; + memcpy(buf, conn->cache.buf, total); + + conn->cache.len -= total; + conn->cache.pos += total; + len -= total; + buf+= total; + } + while (len > 0) { /* * The socket is non-blocking. Instead of the canonical @@ -472,6 +519,8 @@ fetch_read(conn_t *conn, char *buf, size total += rlen; continue; } else if (rlen == FETCH_READ_ERROR) { + if (errno == EINTR) + fetch_cache_data(conn, start, total); return (-1); } // assert(rlen == FETCH_READ_WAIT); @@ -492,8 +541,12 @@ fetch_read(conn_t *conn, char *buf, size errno = 0; r = select(conn->sd + 1, &readfds, NULL, NULL, &delta); if (r == -1) { - if (errno == EINTR && fetchRestartCalls) - continue; + if (errno == EINTR) { + if (fetchRestartCalls) + continue; + /* Save anything that was read. */ + fetch_cache_data(conn, start, total); + } fetch_syserr(); return (-1); } @@ -677,6 +730,7 @@ fetch_close(conn_t *conn) if (--conn->ref > 0) return (0); ret = close(conn->sd); + free(conn->cache.buf); free(conn->buf); free(conn); return (ret); Modified: head/lib/libfetch/common.h == --- head/lib/libfetch/common.h Wed Jan 18 14:41:26 2012(r230306) +++ head/lib/libfetch/common.h Wed Jan 18 15:13:21 2012(r230307) @@ -52,6 +52,13 @@ struct fetchconn { size_t bufsize; /* buffer size */ size_t buflen;/* length of buffer contents */ int err; /* last protocol reply code */ + struct {
svn commit: r230059 - head/sbin/geom/class/part
Author: des Date: Fri Jan 13 12:40:33 2012 New Revision: 230059 URL: http://svn.freebsd.org/changeset/base/230059 Log: Provide a better explanation for the sizing of the boot partition, and reduce the size of the partition in the example from 128 blocks to 94 blocks so it will end on a 128-block boundary. Also remove the -b option from the next example. MFC after:3 weeks Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 == --- head/sbin/geom/class/part/gpart.8 Fri Jan 13 11:58:06 2012 (r230058) +++ head/sbin/geom/class/part/gpart.8 Fri Jan 13 12:40:33 2012 (r230059) @@ -960,17 +960,21 @@ partition that can boot from a .Cm freebsd-ufs partition, and install bootstrap code into it. -This partition must be larger than -.Pa /boot/gptboot , -or the GPT boot you are planning to write, but smaller than 545 KB. -A size of 15 blocks (7680 bytes) would be sufficient for -booting from UFS but 128 blocks (64 KB) is used in -this example to reserve some space for potential -future need (e.g.\& a larger +This partition must be larger than the bootstrap code +.Po +usually either +.Pa /boot/gptboot +or .Pa /boot/gptzfsboot -for booting from a ZFS partition). +.Pc , +but smaller than 545 kB since the first-stage loader will load the +entire partition into memory during boot, regardless of how much data +it actually contains. +This example uses 94 blocks (47 kB) so the next partition will be +aligned on a 64 kB boundary without the need to specify an explicit +offset or alignment. .Bd -literal -offset indent -/sbin/gpart add -b 34 -s 128 -t freebsd-boot ad0 +/sbin/gpart add -b 34 -s 94 -t freebsd-boot ad0 /sbin/gpart bootcode -p /boot/gptboot -i 1 ad0 .Ed .Pp @@ -978,7 +982,7 @@ Create a 512MB-sized .Cm freebsd-ufs partition to contain a UFS filesystem from which the system can boot. .Bd -literal -offset indent -/sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0 +/sbin/gpart add -s 512M -t freebsd-ufs ad0 .Ed .Pp Create an MBR scheme on ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228810 - head/contrib/openpam/lib
Author: des Date: Thu Dec 22 18:12:51 2011 New Revision: 228810 URL: http://svn.freebsd.org/changeset/base/228810 Log: Merge upstream r509: don't log an error in the common case (ENOENT). Modified: head/contrib/openpam/lib/openpam_check_owner_perms.c Directory Properties: head/contrib/openpam/ (props changed) Modified: head/contrib/openpam/lib/openpam_check_owner_perms.c == --- head/contrib/openpam/lib/openpam_check_owner_perms.cThu Dec 22 18:10:15 2011(r228809) +++ head/contrib/openpam/lib/openpam_check_owner_perms.cThu Dec 22 18:12:51 2011(r228810) @@ -104,9 +104,11 @@ openpam_check_path_owner_perms(const cha len = strlen(pathbuf); while (len > 0) { if (stat(pathbuf, &sb) != 0) { - serrno = errno; - openpam_log(PAM_LOG_ERROR, "%s: %m", pathbuf); - errno = serrno; + if (errno != ENOENT) { + serrno = errno; + openpam_log(PAM_LOG_ERROR, "%s: %m", pathbuf); + errno = serrno; + } return (-1); } if ((sb.st_uid != root && sb.st_uid != arbitrator) || ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228692 - in head: contrib/openpam contrib/openpam/bin contrib/openpam/bin/pamtest contrib/openpam/bin/su contrib/openpam/doc contrib/openpam/doc/man contrib/openpam/include contrib/ope...
Author: des Date: Sun Dec 18 17:22:45 2011 New Revision: 228692 URL: http://svn.freebsd.org/changeset/base/228692 Log: Upgrade to OpenPAM Lycopsida. Added: head/contrib/openpam/bin/pamtest/ - copied from r228691, vendor/openpam/dist/bin/pamtest/ head/contrib/openpam/bin/su/su.1 - copied unchanged from r228691, vendor/openpam/dist/bin/su/su.1 head/contrib/openpam/doc/man/openpam_subst.3 - copied unchanged from r228691, vendor/openpam/dist/doc/man/openpam_subst.3 head/contrib/openpam/lib/openpam_check_owner_perms.c - copied unchanged from r228691, vendor/openpam/dist/lib/openpam_check_owner_perms.c head/contrib/openpam/lib/openpam_constants.c - copied unchanged from r228691, vendor/openpam/dist/lib/openpam_constants.c head/contrib/openpam/lib/openpam_constants.h - copied unchanged from r228691, vendor/openpam/dist/lib/openpam_constants.h head/contrib/openpam/lib/openpam_debug.h - copied unchanged from r228691, vendor/openpam/dist/lib/openpam_debug.h head/contrib/openpam/lib/openpam_strlcmp.h - copied unchanged from r228691, vendor/openpam/dist/lib/openpam_strlcmp.h head/contrib/openpam/lib/openpam_strlcpy.h - copied unchanged from r228691, vendor/openpam/dist/lib/openpam_strlcpy.h head/contrib/openpam/lib/openpam_subst.c - copied unchanged from r228691, vendor/openpam/dist/lib/openpam_subst.c Modified: head/contrib/openpam/CREDITS head/contrib/openpam/HISTORY head/contrib/openpam/LICENSE head/contrib/openpam/Makefile.am head/contrib/openpam/Makefile.in head/contrib/openpam/README head/contrib/openpam/RELNOTES head/contrib/openpam/aclocal.m4 head/contrib/openpam/bin/Makefile.am head/contrib/openpam/bin/Makefile.in head/contrib/openpam/bin/su/Makefile.am head/contrib/openpam/bin/su/Makefile.in head/contrib/openpam/bin/su/su.c head/contrib/openpam/config.h.in head/contrib/openpam/configure head/contrib/openpam/configure.ac head/contrib/openpam/depcomp head/contrib/openpam/doc/Makefile.in head/contrib/openpam/doc/man/Makefile.am head/contrib/openpam/doc/man/Makefile.in head/contrib/openpam/doc/man/openpam.3 head/contrib/openpam/doc/man/openpam_borrow_cred.3 head/contrib/openpam/doc/man/openpam_free_data.3 head/contrib/openpam/doc/man/openpam_free_envlist.3 head/contrib/openpam/doc/man/openpam_get_option.3 head/contrib/openpam/doc/man/openpam_log.3 head/contrib/openpam/doc/man/openpam_nullconv.3 head/contrib/openpam/doc/man/openpam_readline.3 head/contrib/openpam/doc/man/openpam_restore_cred.3 head/contrib/openpam/doc/man/openpam_set_option.3 head/contrib/openpam/doc/man/openpam_ttyconv.3 head/contrib/openpam/doc/man/pam.3 head/contrib/openpam/doc/man/pam.conf.5 head/contrib/openpam/doc/man/pam_acct_mgmt.3 head/contrib/openpam/doc/man/pam_authenticate.3 head/contrib/openpam/doc/man/pam_chauthtok.3 head/contrib/openpam/doc/man/pam_close_session.3 head/contrib/openpam/doc/man/pam_conv.3 head/contrib/openpam/doc/man/pam_end.3 head/contrib/openpam/doc/man/pam_error.3 head/contrib/openpam/doc/man/pam_get_authtok.3 head/contrib/openpam/doc/man/pam_get_data.3 head/contrib/openpam/doc/man/pam_get_item.3 head/contrib/openpam/doc/man/pam_get_user.3 head/contrib/openpam/doc/man/pam_getenv.3 head/contrib/openpam/doc/man/pam_getenvlist.3 head/contrib/openpam/doc/man/pam_info.3 head/contrib/openpam/doc/man/pam_open_session.3 head/contrib/openpam/doc/man/pam_prompt.3 head/contrib/openpam/doc/man/pam_putenv.3 head/contrib/openpam/doc/man/pam_set_data.3 head/contrib/openpam/doc/man/pam_set_item.3 head/contrib/openpam/doc/man/pam_setcred.3 head/contrib/openpam/doc/man/pam_setenv.3 head/contrib/openpam/doc/man/pam_sm_acct_mgmt.3 head/contrib/openpam/doc/man/pam_sm_authenticate.3 head/contrib/openpam/doc/man/pam_sm_chauthtok.3 head/contrib/openpam/doc/man/pam_sm_close_session.3 head/contrib/openpam/doc/man/pam_sm_open_session.3 head/contrib/openpam/doc/man/pam_sm_setcred.3 head/contrib/openpam/doc/man/pam_start.3 head/contrib/openpam/doc/man/pam_strerror.3 head/contrib/openpam/doc/man/pam_verror.3 head/contrib/openpam/doc/man/pam_vinfo.3 head/contrib/openpam/doc/man/pam_vprompt.3 head/contrib/openpam/include/Makefile.in head/contrib/openpam/include/security/Makefile.in head/contrib/openpam/include/security/openpam.h head/contrib/openpam/include/security/openpam_version.h head/contrib/openpam/include/security/pam_appl.h head/contrib/openpam/include/security/pam_constants.h head/contrib/openpam/include/security/pam_modules.h head/contrib/openpam/include/security/pam_types.h head/contrib/openpam/install-sh head/contrib/openpam/lib/Makefile.am head/contrib/openpam/lib/Makefile.in head/contrib/openpam/lib/openpam_borrow_cred.c head/contrib/openpam/lib/openpam_configure.c head/contrib/openpam/lib/openpam_dispatch.c head/contrib/openpam/lib/openpam_dynamic.c head/contrib/openpam/lib/openpam_findenv.c h
svn commit: r228384 - head/contrib/openpam/lib
Author: des Date: Sat Dec 10 01:44:24 2011 New Revision: 228384 URL: http://svn.freebsd.org/changeset/base/228384 Log: Add minimal validation of the service name to fend off at least one attack vector against applications that allow the applicant to specify which policy to apply. Submitted by: Matthias Drochner MFC after:1 week Modified: head/contrib/openpam/lib/openpam_configure.c Modified: head/contrib/openpam/lib/openpam_configure.c == --- head/contrib/openpam/lib/openpam_configure.cSat Dec 10 01:01:44 2011(r228383) +++ head/contrib/openpam/lib/openpam_configure.cSat Dec 10 01:44:24 2011(r228384) @@ -285,6 +285,13 @@ openpam_load_chain(pam_handle_t *pamh, size_t len; int r; + /* don't allow to escape from policy_path */ + if (strchr(service, '/')) { + openpam_log(PAM_LOG_ERROR, "invalid service name: %s", + service); + return (-PAM_SYSTEM_ERR); + } + for (path = openpam_policy_path; *path != NULL; ++path) { len = strlen(*path); if ((*path)[len - 1] == '/') { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r227933 - in head: . lib/libpam/modules
Author: des Date: Thu Nov 24 13:18:58 2011 New Revision: 227933 URL: http://svn.freebsd.org/changeset/base/227933 Log: Revert r227841 and part of r227798. We still build libpam in two passes, but we use STATIC_CFLAGS instead of our own private .c.o rule. MFC after:3 weeks Modified: head/Makefile.inc1 head/lib/libpam/modules/Makefile.inc Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Thu Nov 24 13:13:50 2011(r227932) +++ head/Makefile.inc1 Thu Nov 24 13:18:58 2011(r227933) @@ -1230,7 +1230,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_lib_libgssapi} ${_lib_libipx} \ lib/libkiconv lib/libkvm lib/liblzma lib/libmd \ lib/ncurses/ncurses lib/ncurses/ncursesw \ - lib/libopie ${_lib_libthr} \ + lib/libopie lib/libpam ${_lib_libthr} \ lib/libradius lib/libsbuf lib/libtacplus \ ${_cddl_lib_libumem} \ lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ @@ -1323,7 +1323,7 @@ ${_lib}__PL: .PHONY .endif .endfor -.for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs} +.for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs} ${_lib}__L: .PHONY .if exists(${.CURDIR}/${_lib}) ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ @@ -1335,6 +1335,17 @@ ${_lib}__L: .PHONY .endif .endfor +# libpam is special: we need to build static PAM modules before +# static PAM library, and dynamic PAM library before dynamic PAM +# modules. +lib/libpam__L: .PHONY + ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \ + cd ${.CURDIR}/lib/libpam; \ + ${MAKE} DIRPRFX=lib/libpam/ obj; \ + ${MAKE} DIRPRFX=lib/libpam/ depend; \ + ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \ + ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install + _prereq_libs: ${_prereq_libs:S/$/__PL/} _startup_libs: ${_startup_libs:S/$/__L/} _prebuild_libs: ${_prebuild_libs:S/$/__L/} Modified: head/lib/libpam/modules/Makefile.inc == --- head/lib/libpam/modules/Makefile.incThu Nov 24 13:13:50 2011 (r227932) +++ head/lib/libpam/modules/Makefile.incThu Nov 24 13:18:58 2011 (r227933) @@ -5,8 +5,17 @@ PAMDIR=${.CURDIR}/../../../../contrib/ NO_INSTALLLIB= NO_PROFILE= -CFLAGS+= -I${PAMDIR}/include -I${.CURDIR}/../../libpam +CFLAGS+= -I${PAMDIR}/include -I${.CURDIR}/../../libpam +# This is nasty. +# For the static case, libpam.a depends on the modules. +# For the dynamic case, the modules depend on libpam.so.N +.if defined(_NO_LIBPAM_SO_YET) +NO_PIC= +.else SHLIB_NAME?= ${LIB}.so.${SHLIB_MAJOR} +DPADD+=${LIBPAM} +LDADD+=-lpam +.endif .include "../Makefile.inc" ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r227932 - head/share/mk
Author: des Date: Thu Nov 24 13:13:50 2011 New Revision: 227932 URL: http://svn.freebsd.org/changeset/base/227932 Log: Add CTF magic to the new .c.o rule. MFC after:3 weeks Modified: head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.lib.mk == --- head/share/mk/bsd.lib.mkThu Nov 24 10:58:48 2011(r227931) +++ head/share/mk/bsd.lib.mkThu Nov 24 13:13:50 2011(r227932) @@ -69,6 +69,9 @@ PO_FLAG=-pg .c.o: ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ + (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) .c.po: ${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r227841 - head
Author: des Date: Tue Nov 22 21:18:14 2011 New Revision: 227841 URL: http://svn.freebsd.org/changeset/base/227841 Log: Remove libpam from _prebuild_libs. This should unbreak the -jX build. MFC after:3 weeks Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Tue Nov 22 21:14:46 2011(r227840) +++ head/Makefile.inc1 Tue Nov 22 21:18:14 2011(r227841) @@ -1235,8 +1235,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_cddl_lib_libumem} \ lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_secure_lib_libssh} \ - ${_secure_lib_libssl} \ - lib/libpam + ${_secure_lib_libssl} .if ${MK_LIBTHR} != "no" _lib_libthr= lib/libthr ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r227798 - in head: . lib/libpam lib/libpam/modules
Author: des Date: Mon Nov 21 16:40:39 2011 New Revision: 227798 URL: http://svn.freebsd.org/changeset/base/227798 Log: Simplify the libpam build by removing the shared modules' dependency on the shared library. The modules are loaded by the library, so we know it'll be there when we need it. MFC after:3 weeks Modified: head/Makefile.inc1 head/lib/libpam/Makefile.inc head/lib/libpam/modules/Makefile.inc Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Mon Nov 21 16:35:57 2011(r227797) +++ head/Makefile.inc1 Mon Nov 21 16:40:39 2011(r227798) @@ -1230,12 +1230,13 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_lib_libgssapi} ${_lib_libipx} \ lib/libkiconv lib/libkvm lib/liblzma lib/libmd \ lib/ncurses/ncurses lib/ncurses/ncursesw \ - lib/libopie lib/libpam ${_lib_libthr} \ + lib/libopie ${_lib_libthr} \ lib/libradius lib/libsbuf lib/libtacplus \ ${_cddl_lib_libumem} \ lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_secure_lib_libssh} \ - ${_secure_lib_libssl} + ${_secure_lib_libssl} \ + lib/libpam .if ${MK_LIBTHR} != "no" _lib_libthr= lib/libthr @@ -1323,7 +1324,7 @@ ${_lib}__PL: .PHONY .endif .endfor -.for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs} +.for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs} ${_lib}__L: .PHONY .if exists(${.CURDIR}/${_lib}) ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ @@ -1335,17 +1336,6 @@ ${_lib}__L: .PHONY .endif .endfor -# libpam is special: we need to build static PAM modules before -# static PAM library, and dynamic PAM library before dynamic PAM -# modules. -lib/libpam__L: .PHONY - ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \ - cd ${.CURDIR}/lib/libpam; \ - ${MAKE} DIRPRFX=lib/libpam/ obj; \ - ${MAKE} DIRPRFX=lib/libpam/ depend; \ - ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \ - ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install - _prereq_libs: ${_prereq_libs:S/$/__PL/} _startup_libs: ${_startup_libs:S/$/__L/} _prebuild_libs: ${_prebuild_libs:S/$/__L/} Modified: head/lib/libpam/Makefile.inc == --- head/lib/libpam/Makefile.incMon Nov 21 16:35:57 2011 (r227797) +++ head/lib/libpam/Makefile.incMon Nov 21 16:40:39 2011 (r227798) @@ -31,4 +31,6 @@ DEBUG_FLAGS+= -DDEBUG SHLIB_MAJOR= 5 PAM_MOD_DIR= ${LIBDIR} +STATIC_CFLAGS+=-DOPENPAM_STATIC_MODULES + .include "../Makefile.inc" Modified: head/lib/libpam/modules/Makefile.inc == --- head/lib/libpam/modules/Makefile.incMon Nov 21 16:35:57 2011 (r227797) +++ head/lib/libpam/modules/Makefile.incMon Nov 21 16:40:39 2011 (r227798) @@ -5,20 +5,8 @@ PAMDIR=${.CURDIR}/../../../../contrib/ NO_INSTALLLIB= NO_PROFILE= -CFLAGS+= -I${PAMDIR}/include -I${.CURDIR}/../../libpam +CFLAGS+= -I${PAMDIR}/include -I${.CURDIR}/../../libpam -# This is nasty. -# For the static case, libpam.a depends on the modules. -# For the dynamic case, the modules depend on libpam.so.N -.if defined(_NO_LIBPAM_SO_YET) -NO_PIC= -.else SHLIB_NAME?= ${LIB}.so.${SHLIB_MAJOR} -DPADD+=${LIBPAM} -LDADD+=-lpam -.endif - -.c.o: - ${CC} ${CFLAGS} -DOPENPAM_STATIC_MODULES -c ${.IMPSRC} .include "../Makefile.inc" ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r227797 - head/share/mk
Author: des Date: Mon Nov 21 16:35:57 2011 New Revision: 227797 URL: http://svn.freebsd.org/changeset/base/227797 Log: As threatened on -arch, add {SHARED,STATIC}_{C,CXX}FLAGS, which allow a Makefile to specify different CFLAGS for shared and static libraries. MFC after:3 weeks Modified: head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.lib.mk == --- head/share/mk/bsd.lib.mkMon Nov 21 16:06:23 2011(r227796) +++ head/share/mk/bsd.lib.mkMon Nov 21 16:35:57 2011(r227797) @@ -67,23 +67,29 @@ PICFLAG=-fpic PO_FLAG=-pg +.c.o: + ${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + .c.po: - ${CC} ${PO_FLAG} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) .c.So: - ${CC} ${PICFLAG} -DPIC ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ (${ECHO} ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \ ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}) +.cc.o: + ${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} + .cc.po .C.po .cpp.po .cxx.po: - ${CXX} ${PO_FLAG} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CXX} ${PO_FLAG} ${STATIC_CXXFLAGS} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} .cc.So .C.So .cpp.So .cxx.So: - ${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} .f.po: ${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r227757 - head/lib/libpam/modules/pam_ssh
Author: des Date: Sun Nov 20 15:18:49 2011 New Revision: 227757 URL: http://svn.freebsd.org/changeset/base/227757 Log: key_load_private() ignores the passphrase argument if the private key is unencrypted. This defeats the nullok check, because it means a non-null passphrase will successfully unlock the key. To address this, try at first to load the key without a passphrase. If this succeeds and the user provided a non-empty passphrase *or* nullok is false, reject the key. MFC after:1 week Noticed by: Guy Helmer Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.c Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.c == --- head/lib/libpam/modules/pam_ssh/pam_ssh.c Sun Nov 20 15:06:39 2011 (r227756) +++ head/lib/libpam/modules/pam_ssh/pam_ssh.c Sun Nov 20 15:18:49 2011 (r227757) @@ -93,7 +93,8 @@ static char *const pam_ssh_agent_envp[] * struct pam_ssh_key containing the key and its comment. */ static struct pam_ssh_key * -pam_ssh_load_key(const char *dir, const char *kfn, const char *passphrase) +pam_ssh_load_key(const char *dir, const char *kfn, const char *passphrase, +int nullok) { struct pam_ssh_key *psk; char fn[PATH_MAX]; @@ -103,7 +104,21 @@ pam_ssh_load_key(const char *dir, const if (snprintf(fn, sizeof(fn), "%s/%s", dir, kfn) > (int)sizeof(fn)) return (NULL); comment = NULL; - key = key_load_private(fn, passphrase, &comment); + /* +* If the key is unencrypted, OpenSSL ignores the passphrase, so +* it will seem like the user typed in the right one. This allows +* a user to circumvent nullok by providing a dummy passphrase. +* Verify that the key really *is* encrypted by trying to load it +* with an empty passphrase, and if the key is not encrypted, +* accept only an empty passphrase. +*/ + key = key_load_private(fn, NULL, &comment); + if (key != NULL && !(*passphrase == '\0' && nullok)) { + key_free(key); + return (NULL); + } + if (key == NULL) + key = key_load_private(fn, passphrase, &comment); if (key == NULL) { openpam_log(PAM_LOG_DEBUG, "failed to load key from %s", fn); return (NULL); @@ -170,9 +185,6 @@ pam_sm_authenticate(pam_handle_t *pamh, if (pam_err != PAM_SUCCESS) return (pam_err); - if (*passphrase == '\0' && !nullok) - goto skip_keys; - /* switch to user credentials */ pam_err = openpam_borrow_cred(pamh, pwd); if (pam_err != PAM_SUCCESS) @@ -180,7 +192,7 @@ pam_sm_authenticate(pam_handle_t *pamh, /* try to load keys from all keyfiles we know of */ for (kfn = pam_ssh_keyfiles; *kfn != NULL; ++kfn) { - psk = pam_ssh_load_key(pwd->pw_dir, *kfn, passphrase); + psk = pam_ssh_load_key(pwd->pw_dir, *kfn, passphrase, nullok); if (psk != NULL) { pam_set_data(pamh, *kfn, psk, pam_ssh_free_key); ++nkeys; @@ -190,7 +202,6 @@ pam_sm_authenticate(pam_handle_t *pamh, /* switch back to arbitrator credentials */ openpam_restore_cred(pamh); - skip_keys: /* * If we tried an old token and didn't get anything, and * try_first_pass was specified, try again after prompting the ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r227531 - head/rescue/rescue
Author: des Date: Tue Nov 15 16:20:39 2011 New Revision: 227531 URL: http://svn.freebsd.org/changeset/base/227531 Log: Add netcat (nc) to /rescue. MFC after:3 weeks Modified: head/rescue/rescue/Makefile Modified: head/rescue/rescue/Makefile == --- head/rescue/rescue/Makefile Tue Nov 15 14:40:00 2011(r227530) +++ head/rescue/rescue/Makefile Tue Nov 15 16:20:39 2011(r227531) @@ -181,7 +181,7 @@ CRUNCH_BUILDOPTS_dhclient= -DRELEASE_CRU # CRUNCH_SRCDIRS+= usr.bin -CRUNCH_PROGS_usr.bin= head mt sed tail tee +CRUNCH_PROGS_usr.bin= head mt nc sed tail tee CRUNCH_PROGS_usr.bin+= gzip CRUNCH_ALIAS_gzip= gunzip gzcat zcat ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r227044 - head/lib/libpam/modules/pam_unix
Author: des Date: Wed Nov 2 23:40:21 2011 New Revision: 227044 URL: http://svn.freebsd.org/changeset/base/227044 Log: Note that pam_unix(8) does not respect PAM_CHANGE_EXPIRED_AUTHTOK. Modified: head/lib/libpam/modules/pam_unix/pam_unix.8 Modified: head/lib/libpam/modules/pam_unix/pam_unix.8 == --- head/lib/libpam/modules/pam_unix/pam_unix.8 Wed Nov 2 23:23:19 2011 (r227043) +++ head/lib/libpam/modules/pam_unix/pam_unix.8 Wed Nov 2 23:40:21 2011 (r227044) @@ -199,3 +199,9 @@ password database. .Xr pam 8 , .Xr pw 8 , .Xr yp 8 +.Sh BUGS +The +.Nm +module ignores the +.Dv PAM_CHANGE_EXPIRED_AUTHTOK +flag. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226632 - head/lib/libpam/libpam
Author: des Date: Sat Oct 22 14:08:21 2011 New Revision: 226632 URL: http://svn.freebsd.org/changeset/base/226632 Log: Revert the previous commit and add a comment explaining why it was wrong. Modified: head/lib/libpam/libpam/Makefile Modified: head/lib/libpam/libpam/Makefile == --- head/lib/libpam/libpam/Makefile Sat Oct 22 11:42:48 2011 (r226631) +++ head/lib/libpam/libpam/Makefile Sat Oct 22 14:08:21 2011 (r226632) @@ -55,7 +55,6 @@ SRCS= openpam_borrow_cred.c \ openpam_readline.c \ openpam_restore_cred.c \ openpam_set_option.c \ - openpam_static.c \ openpam_ttyconv.c \ pam_acct_mgmt.c \ pam_authenticate.c \ @@ -149,16 +148,29 @@ HEADERS= security/openpam.h \ ADD_HEADERS= security/pam_mod_misc.h +# # Static modules +# +# We build static versions of all modules and of openpam_static.o, +# then link them all together into openpam_static_modules.o. None of +# the modules export any symbols, but they store structures with +# pointers to their service functions in a linker set which the code +# in openpam_static.c traverses to locate the individual modules. +# MODULE_DIR=../modules .include "${.CURDIR}/${MODULE_DIR}/modules.inc" STATIC_MODULES=${MODULES:C/.*/${MODULE_DIR}\/&\/lib&.a/} STATICOBJS+= openpam_static_modules.o -CLEANFILES+= openpam_static_modules.o +CLEANFILES+= openpam_static.o \ + openpam_static_modules.o openpam_static_modules.o: openpam_static.o ${STATIC_MODULES} ${LD} -o ${.TARGET} -r --whole-archive ${.ALLSRC} +# We can't put openpam_static.c in SRCS, but we still want to scan it +# for dependencies. +DPSRCS=openpam_static.c + # Headers INCS= ${HEADERS} ${ADD_HEADERS} INCSDIR= ${INCLUDEDIR}/security ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226625 - head/lib/libpam/libpam
Author: des Date: Sat Oct 22 04:39:12 2011 New Revision: 226625 URL: http://svn.freebsd.org/changeset/base/226625 Log: openpam_static.c isn't auto-generated. Modified: head/lib/libpam/libpam/Makefile Modified: head/lib/libpam/libpam/Makefile == --- head/lib/libpam/libpam/Makefile Sat Oct 22 01:29:35 2011 (r226624) +++ head/lib/libpam/libpam/Makefile Sat Oct 22 04:39:12 2011 (r226625) @@ -55,6 +55,7 @@ SRCS= openpam_borrow_cred.c \ openpam_readline.c \ openpam_restore_cred.c \ openpam_set_option.c \ + openpam_static.c \ openpam_ttyconv.c \ pam_acct_mgmt.c \ pam_authenticate.c \ @@ -153,15 +154,11 @@ MODULE_DIR= ../modules .include "${.CURDIR}/${MODULE_DIR}/modules.inc" STATIC_MODULES=${MODULES:C/.*/${MODULE_DIR}\/&\/lib&.a/} STATICOBJS+= openpam_static_modules.o -CLEANFILES+= openpam_static.o \ - openpam_static_modules.o +CLEANFILES+= openpam_static_modules.o openpam_static_modules.o: openpam_static.o ${STATIC_MODULES} ${LD} -o ${.TARGET} -r --whole-archive ${.ALLSRC} -# Can't put openpam_static.c in SRCS but want .o in .depend. -DPSRCS=openpam_static.c - # Headers INCS= ${HEADERS} ${ADD_HEADERS} INCSDIR= ${INCLUDEDIR}/security ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226608 - in head/usr.bin: kdump truss
Author: des Date: Fri Oct 21 11:08:25 2011 New Revision: 226608 URL: http://svn.freebsd.org/changeset/base/226608 Log: It turns out that truss also used kdump's mkioctls script, and expected ioctlname() to return a pointer to the name rather than print it. This did not show up in testing because truss had its own prototype for ioctlname(), so it would build fine and run fine as long as the program being traced did not issue an ioctl. Teach mkioctls to generate different versions of ioctlname() based on its first command-line argument. Pointed out by: Garrett Cooper Modified: head/usr.bin/kdump/Makefile head/usr.bin/kdump/mkioctls head/usr.bin/truss/Makefile head/usr.bin/truss/extern.h Modified: head/usr.bin/kdump/Makefile == --- head/usr.bin/kdump/Makefile Fri Oct 21 06:41:46 2011(r226607) +++ head/usr.bin/kdump/Makefile Fri Oct 21 11:08:25 2011(r226608) @@ -22,7 +22,7 @@ CLEANFILES= ioctl.c kdump_subr.c kdump_s ioctl.c: mkioctls env MACHINE=${MACHINE} \ - sh ${.CURDIR}/mkioctls ${DESTDIR}/usr/include > ${.TARGET} + sh ${.CURDIR}/mkioctls print ${DESTDIR}/usr/include > ${.TARGET} kdump_subr.h: mksubr sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include | \ Modified: head/usr.bin/kdump/mkioctls == --- head/usr.bin/kdump/mkioctls Fri Oct 21 06:41:46 2011(r226607) +++ head/usr.bin/kdump/mkioctls Fri Oct 21 11:08:25 2011(r226608) @@ -1,20 +1,26 @@ #!/bin/sh # # $FreeBSD$ +# +# When editing this script, keep in mind that truss also uses it. +# set -e -if [ -z "$1" ]; then - echo "usage: sh $0 include-dir" +if [ $# -ne 2 -o \( $1 != "print" -a $1 != "return" \) ]; then + echo "usage: sh $0 print|return include-dir" exit 1 fi +style="$1" +includedir="$2" + LC_ALL=C; export LC_ALL # Build a list of headers that have ioctls in them. # XXX should we use an ANSI cpp? ioctl_includes=$( - cd $1 + cd $includedir find -H -s * -name '*.h' | grep -v '.*disk.*\.h' | \ xargs egrep -l \ '^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-9_]*[ ]+_IO[^a-z0-9_]' | @@ -33,7 +39,7 @@ esac awk -v x="$ioctl_includes" 'BEGIN {print x}' | gcc -E -I$1 -dM -DCOMPAT_43TTY - | - awk -v ioctl_includes="$ioctl_includes" ' + awk -v ioctl_includes="$ioctl_includes" -v style="$style" ' BEGIN { print "/* XXX obnoxious prerequisites. */" print "#define COMPAT_43" @@ -58,12 +64,19 @@ BEGIN { print "#include " print "#include " print "" - print "void ioctlname(unsigned long val, int decimal);" - print "" print ioctl_includes print "" - print "void" - print "ioctlname(unsigned long val, int decimal)" + if (style == "print") { + print "void ioctlname(unsigned long val, int decimal);" + print "" + print "void" + print "ioctlname(unsigned long val, int decimal)" + } else { + print "const char *ioctlname(unsigned long val);" + print "" + print "const char *" + print "ioctlname(unsigned long val)" + } print "{" print "\tconst char *str = NULL;" print "" @@ -77,20 +90,24 @@ BEGIN { break; ++i; # - print("\t"); + printf("\t"); if (n++ > 0) - print("else "); + printf("else "); printf("if (val == %s)\n", $i); printf("\t\tstr = \"%s\";\n", $i); } END { - print "\n" - print "\tif (str != NULL)\n" - print "\t\tprintf(\"%s\", str);\n" - print "\telse if (decimal)\n" - print "\t\tprintf(\"%lu\", val);\n" - print "\telse\n" - print "\t\tprintf(\"%#lx\", val);\n" + print "" + if (style == "print") { + print "\tif (str != NULL)" + print "\t\tprintf(\"%s\", str);" + print "\telse if (decimal)" + print "\t\tprintf(\"%lu\", val);" + print "\telse" + print "\t\tprintf(\"%#lx\", val);" + } else { + print "\treturn (str);" + } print "}" } ' Modified: head/usr.bin/truss/Makefile == --- head/usr.bin/truss/Makefile Fri Oct 21 06:41:46 2011(r226607) +++ head/usr.bin/truss/Makefile Fri Oct 21 11:08:25 2011(r226608) @@ -23,7 +23,8 @@ syscalls.h: syscalls.master ${.CURDIR}/i386.conf ioctl.c: ${.CURDIR}/../kdump/mkioctls - sh ${.CURDIR}/../kdump/mkioctls ${DESTDIR}/usr/include > ${.TARGET} + env MACHINE=${MACHINE} \ + /bin/sh ${.CURDIR}/../kdump/mkioctls return ${DESTDIR}/usr/include >
svn commit: r226546 - head/bin/ls
Author: des Date: Wed Oct 19 15:35:41 2011 New Revision: 226546 URL: http://svn.freebsd.org/changeset/base/226546 Log: If ls was invoked with -i but neither -l nor -s, blocksize was used in display() to calculate column widths, but was not initialized in main(). This resulted in a division by zero. Noticed by: Michael Butler Modified: head/bin/ls/ls.c Modified: head/bin/ls/ls.c == --- head/bin/ls/ls.cWed Oct 19 14:38:01 2011(r226545) +++ head/bin/ls/ls.cWed Oct 19 15:35:41 2011(r226546) @@ -414,8 +414,8 @@ main(int argc, char *argv[]) fts_options |= FTS_WHITEOUT; #endif - /* If -l or -s, figure out block size. */ - if (f_longform || f_size) { + /* If -i, -l or -s, figure out block size. */ + if (f_inode || f_longform || f_size) { if (f_kblocks) blocksize = 2; else { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226537 - head/lib/libfetch
Author: des Date: Wed Oct 19 11:43:51 2011 New Revision: 226537 URL: http://svn.freebsd.org/changeset/base/226537 Log: latin1 -> utf8 Modified: head/lib/libfetch/common.c head/lib/libfetch/common.h head/lib/libfetch/fetch.3 head/lib/libfetch/fetch.c head/lib/libfetch/fetch.h head/lib/libfetch/file.c head/lib/libfetch/ftp.c head/lib/libfetch/http.c Modified: head/lib/libfetch/common.c == --- head/lib/libfetch/common.c Wed Oct 19 11:04:49 2011(r226536) +++ head/lib/libfetch/common.c Wed Oct 19 11:43:51 2011(r226537) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2011 Dag-Erling Sm�rgrav + * Copyright (c) 1998-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libfetch/common.h == --- head/lib/libfetch/common.h Wed Oct 19 11:04:49 2011(r226536) +++ head/lib/libfetch/common.h Wed Oct 19 11:43:51 2011(r226537) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2011 Dag-Erling Sm�rgrav + * Copyright (c) 1998-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libfetch/fetch.3 == --- head/lib/libfetch/fetch.3 Wed Oct 19 11:04:49 2011(r226536) +++ head/lib/libfetch/fetch.3 Wed Oct 19 11:43:51 2011(r226537) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 1998-2011 Dag-Erling Sm�rgrav +.\" Copyright (c) 1998-2011 Dag-Erling Smørgrav .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: head/lib/libfetch/fetch.c == --- head/lib/libfetch/fetch.c Wed Oct 19 11:04:49 2011(r226536) +++ head/lib/libfetch/fetch.c Wed Oct 19 11:43:51 2011(r226537) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Sm�rgrav + * Copyright (c) 1998-2004 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libfetch/fetch.h == --- head/lib/libfetch/fetch.h Wed Oct 19 11:04:49 2011(r226536) +++ head/lib/libfetch/fetch.h Wed Oct 19 11:43:51 2011(r226537) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Sm�rgrav + * Copyright (c) 1998-2004 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libfetch/file.c == --- head/lib/libfetch/file.cWed Oct 19 11:04:49 2011(r226536) +++ head/lib/libfetch/file.cWed Oct 19 11:43:51 2011(r226537) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2011 Dag-Erling Sm�rgrav + * Copyright (c) 1998-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libfetch/ftp.c == --- head/lib/libfetch/ftp.c Wed Oct 19 11:04:49 2011(r226536) +++ head/lib/libfetch/ftp.c Wed Oct 19 11:43:51 2011(r226537) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2011 Dag-Erling Sm�rgrav + * Copyright (c) 1998-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); * * Major Changelog: * - * Dag-Erling Co�dan Sm�rgrav + * Dag-Erling Smørgrav * 9 Jun 1998 * * Incorporated into libfetch Modified: head/lib/libfetch/http.c == --- head/lib/libfetch/http.cWed Oct 19 11:04:49 2011(r226536) +++ head/lib/libfetch/http.cWed Oct 19 11:43:51 2011(r226537) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2011 Dag-Erling Sm�rgrav + * Copyright (c) 2000-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226509 - head/bin/ls
Author: des Date: Tue Oct 18 13:10:46 2011 New Revision: 226509 URL: http://svn.freebsd.org/changeset/base/226509 Log: When calculating the width of the blocksize column, ls(1) used 512-byte units (as returned by stat(2)) instead of BLOCKSIZE units. Submitted by: Paul Schenkeveld MFC after:3 weeks Modified: head/bin/ls/ls.c Modified: head/bin/ls/ls.c == --- head/bin/ls/ls.cTue Oct 18 12:13:20 2011(r226508) +++ head/bin/ls/ls.cTue Oct 18 13:10:46 2011(r226509) @@ -44,7 +44,7 @@ static char sccsid[] = "@(#)ls.c 8.5 (Be #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include @@ -835,7 +835,7 @@ label_out: d.maxlen = maxlen; if (needstats) { d.btotal = btotal; - d.s_block = snprintf(NULL, 0, "%lu", maxblock); + d.s_block = snprintf(NULL, 0, "%lu", howmany(maxblock, blocksize)); d.s_flags = maxflags; d.s_label = maxlabelstr; d.s_group = maxgroup; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226506 - in head/sys/boot: arm/at91/boot2 arm/ixp425/boot2 i386/boot2 i386/gptboot i386/zfsboot pc98/boot2
Author: des Date: Tue Oct 18 09:46:52 2011 New Revision: 226506 URL: http://svn.freebsd.org/changeset/base/226506 Log: Look for /boot/config in addition to /boot.config, with the former taking precedence over the latter if it exists. MFC after:3 weeks Modified: head/sys/boot/arm/at91/boot2/boot2.c head/sys/boot/arm/ixp425/boot2/boot2.c head/sys/boot/i386/boot2/boot2.c head/sys/boot/i386/gptboot/gptboot.c head/sys/boot/i386/zfsboot/zfsboot.c head/sys/boot/pc98/boot2/boot2.c Modified: head/sys/boot/arm/at91/boot2/boot2.c == --- head/sys/boot/arm/at91/boot2/boot2.cTue Oct 18 09:39:41 2011 (r226505) +++ head/sys/boot/arm/at91/boot2/boot2.cTue Oct 18 09:46:52 2011 (r226506) @@ -64,7 +64,8 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_VERBOSE) | \ OPT_SET(RBX_GDB)) -#define PATH_CONFIG"/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG"/boot/config" //#define PATH_KERNEL "/boot/kernel/kernel" #define PATH_KERNEL"/boot/kernel/kernel.gz.tramp" @@ -160,7 +161,8 @@ main(void) autoboot = 1; /* Process configuration file */ - if ((ino = lookup(PATH_CONFIG))) + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) fsread(ino, cmd, sizeof(cmd)); if (*cmd) { Modified: head/sys/boot/arm/ixp425/boot2/boot2.c == --- head/sys/boot/arm/ixp425/boot2/boot2.c Tue Oct 18 09:39:41 2011 (r226505) +++ head/sys/boot/arm/ixp425/boot2/boot2.c Tue Oct 18 09:46:52 2011 (r226506) @@ -62,7 +62,8 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_VERBOSE) | \ OPT_SET(RBX_GDB)) -#define PATH_CONFIG"/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG"/boot/config" #define PATH_KERNEL"/boot/kernel/kernel" extern uint32_t _end; @@ -168,7 +169,8 @@ main(void) autoboot = 1; /* Process configuration file */ - if ((ino = lookup(PATH_CONFIG))) + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) fsread(ino, cmd, sizeof(cmd)); if (*cmd) { Modified: head/sys/boot/i386/boot2/boot2.c == --- head/sys/boot/i386/boot2/boot2.cTue Oct 18 09:39:41 2011 (r226505) +++ head/sys/boot/i386/boot2/boot2.cTue Oct 18 09:46:52 2011 (r226506) @@ -75,7 +75,8 @@ __FBSDID("$FreeBSD$"); OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) -#define PATH_CONFIG"/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG"/boot/config" #define PATH_BOOT3 "/boot/loader" #define PATH_KERNEL"/boot/kernel/kernel" @@ -241,7 +242,8 @@ main(void) autoboot = 1; -if ((ino = lookup(PATH_CONFIG))) +if ((ino = lookup(PATH_CONFIG)) || +(ino = lookup(PATH_DOTCONFIG))) fsread(ino, cmd, sizeof(cmd)); if (*cmd) { Modified: head/sys/boot/i386/gptboot/gptboot.c == --- head/sys/boot/i386/gptboot/gptboot.cTue Oct 18 09:39:41 2011 (r226505) +++ head/sys/boot/i386/gptboot/gptboot.cTue Oct 18 09:46:52 2011 (r226506) @@ -38,7 +38,8 @@ __FBSDID("$FreeBSD$"); #include "cons.h" #include "gpt.h" -#define PATH_CONFIG"/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG"/boot/config" #define PATH_BOOT3 "/boot/loader" #define PATH_KERNEL"/boot/kernel/kernel" @@ -163,8 +164,8 @@ main(void) for (;;) { *kname = '\0'; - ino = lookup(PATH_CONFIG); - if (ino > 0) + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) fsread(ino, cmd, sizeof(cmd)); if (*cmd != '\0') { Modified: head/sys/boot/i386/zfsboot/zfsboot.c == --- head/sys/boot/i386/zfsboot/zfsboot.cTue Oct 18 09:39:41 2011 (r226505) +++ head/sys/boot/i386/zfsboot/zfsboot.cTue Oct 18 09:46:52 2011 (r226506) @@ -45,7 +45,8 @@ __FBSDID("$FreeBSD$"); /* Hint to loader that we came from ZFS */ #defineKARGS_FLAGS_ZFS 0x4 -#define PATH_CONFIG"/boot.config" +#define PATH_DOTCONFIG "/boot.config" +#define PATH_CONFIG"/boot/config" #define PATH_BOOT3 "/boot/zfsloader" #define PATH_KERNEL"/boot/kernel/kernel" @@ -533,7 +534,8 @@ main(void) zfs_mount_pool(spa); -if (zfs_lookup(spa, PATH_CONFIG, &dn) == 0) { +if (zf
svn commit: r226505 - head/usr.bin/kdump
Author: des Date: Tue Oct 18 09:39:41 2011 New Revision: 226505 URL: http://svn.freebsd.org/changeset/base/226505 Log: Fix copy-pasto in CAPFAIL_INCREASE case. Noticed by: pjd Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c == --- head/usr.bin/kdump/kdump.c Tue Oct 18 08:26:12 2011(r226504) +++ head/usr.bin/kdump/kdump.c Tue Oct 18 09:39:41 2011(r226505) @@ -1603,9 +1603,9 @@ ktrcapfail(struct ktr_cap_fail *ktr) case CAPFAIL_INCREASE: /* requested more capabilities than fd already has */ printf("attempt to increase capabilities from "); - capname((intmax_t)ktr->cap_needed); - printf(" to "); capname((intmax_t)ktr->cap_held); + printf(" to "); + capname((intmax_t)ktr->cap_needed); break; case CAPFAIL_SYSCALL: /* called restricted syscall */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226504 - head/usr.bin/ktrace
Author: des Date: Tue Oct 18 08:26:12 2011 New Revision: 226504 URL: http://svn.freebsd.org/changeset/base/226504 Log: Make ktrace(1) build cleanly at WARNS level 6 by completely rethinking the way in which it handles the -C, -c, -g and -p options. MFC after:3 weeks Modified: head/usr.bin/ktrace/Makefile head/usr.bin/ktrace/ktrace.c Modified: head/usr.bin/ktrace/Makefile == --- head/usr.bin/ktrace/MakefileTue Oct 18 08:20:36 2011 (r226503) +++ head/usr.bin/ktrace/MakefileTue Oct 18 08:26:12 2011 (r226504) @@ -5,6 +5,4 @@ PROG= ktrace SRCS= ktrace.c subr.c MLINKS= ktrace.1 trace.1 -WARNS?=4 - .include Modified: head/usr.bin/ktrace/ktrace.c == --- head/usr.bin/ktrace/ktrace.cTue Oct 18 08:20:36 2011 (r226503) +++ head/usr.bin/ktrace/ktrace.cTue Oct 18 08:26:12 2011 (r226504) @@ -43,14 +43,15 @@ static char sccsid[] = "@(#)ktrace.c8.1 __FBSDID("$FreeBSD$"); #include -#include #include +#include #include -#include #include #include #include +#include +#include #include #include #include @@ -59,21 +60,22 @@ __FBSDID("$FreeBSD$"); static char def_tracefile[] = DEF_TRACEFILE; +static enum clear { NOTSET, CLEAR, CLEARALL } clear = NOTSET; +static int pid; + static void no_ktrace(int); -static int rpid(char *); +static void set_pid_clear(const char *, enum clear); static void usage(void); int main(int argc, char *argv[]) { - enum { NOTSET, CLEAR, CLEARALL } clear; - int append, ch, fd, inherit, ops, pid, pidset, trpoints; + int append, ch, fd, inherit, ops, trpoints; const char *tracefile; mode_t omask; struct stat sb; - clear = NOTSET; - append = ops = pidset = inherit = 0; + append = ops = inherit = 0; trpoints = DEF_POINTS; tracefile = def_tracefile; while ((ch = getopt(argc,argv,"aCcdf:g:ip:t:")) != -1) @@ -82,11 +84,10 @@ main(int argc, char *argv[]) append = 1; break; case 'C': - clear = CLEARALL; - pidset = 1; + set_pid_clear("1", CLEARALL); break; case 'c': - clear = CLEAR; + set_pid_clear(NULL, CLEAR); break; case 'd': ops |= KTRFLAG_DESCEND; @@ -95,15 +96,14 @@ main(int argc, char *argv[]) tracefile = optarg; break; case 'g': - pid = -rpid(optarg); - pidset = 1; + set_pid_clear(optarg, NOTSET); + pid = -pid; break; case 'i': inherit = 1; break; case 'p': - pid = rpid(optarg); - pidset = 1; + set_pid_clear(optarg, NOTSET); break; case 't': trpoints = getpoints(optarg); @@ -115,12 +115,19 @@ main(int argc, char *argv[]) default: usage(); } + argv += optind; argc -= optind; - - if ((pidset && *argv) || (!pidset && clear == NOTSET && !*argv)) + + /* must have either -[Cc], a pid or a command */ + if (clear == NOTSET && pid == 0 && argc == 0) + usage(); + /* can't have both a pid and a command */ + /* (note that -C sets pid to 1) */ + if (pid != 0 && argc > 0) { usage(); - + } + if (inherit) trpoints |= KTRFAC_INHERIT; @@ -129,10 +136,9 @@ main(int argc, char *argv[]) if (clear == CLEARALL) { ops = KTROP_CLEAR | KTRFLAG_DESCEND; trpoints = ALL_POINTS; - pid = 1; - } else - ops |= pidset ? KTROP_CLEAR : KTROP_CLEARFILE; - + } else { + ops |= pid ? KTROP_CLEAR : KTROP_CLEARFILE; + } if (ktrace(tracefile, ops, trpoints, pid) < 0) err(1, "%s", tracefile); exit(0); @@ -160,46 +166,75 @@ main(int argc, char *argv[]) trpoints |= PROC_ABI_POINTS; - if (*argv) { + if (argc > 0) { if (ktrace(tracefile, ops, trpoints, getpid()) < 0) err(1, "%s", tracefile); - execvp(argv[0], &argv[0]); - err(1, "exec of '%s' failed", argv[0]); + execvp(*argv, argv); +
svn commit: r226503 - head/bin/df
Author: des Date: Tue Oct 18 08:20:36 2011 New Revision: 226503 URL: http://svn.freebsd.org/changeset/base/226503 Log: Minor clarification MFC after:3 weeks Modified: head/bin/df/df.1 Modified: head/bin/df/df.1 == --- head/bin/df/df.1Tue Oct 18 08:18:26 2011(r226502) +++ head/bin/df/df.1Tue Oct 18 08:20:36 2011(r226503) @@ -29,7 +29,7 @@ .\" @(#)df.1 8.3 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd November 23, 2008 +.Dd October 18, 2011 .Dt DF 1 .Os .Sh NAME @@ -63,6 +63,7 @@ The following options are available: Show all mount points, including those that were mounted with the .Dv MNT_IGNORE flag. +This is implied for file systems specified on the command line. .It Fl b Use 512-byte blocks rather than the default. Note that ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226502 - head/bin/df
Author: des Date: Tue Oct 18 08:18:26 2011 New Revision: 226502 URL: http://svn.freebsd.org/changeset/base/226502 Log: Simplify df(1) by factoring out most of the common code: - In the argc == 0 case, just populate the mount list as before, but do not calculate widths, update totals or print anything. - In the argv > 0 case, collect information about the requested file systems and store it in the mount list, but do not calculate widths, update totals or print anything. - In either case, once all the information has been collected, iterate once through the mount list to calculate widths and totals, then once more to print everything. This also fixes two bugs: firstly, column widths were not calculated correctly if more than one file system was specified on the command line; and secondly, file systems with MNT_IGNORE were included in the totals even if -a was not specified. Noticed by: Paul Schenkeveld MFC after:3 weeks Modified: head/bin/df/df.c Modified: head/bin/df/df.c == --- head/bin/df/df.cTue Oct 18 08:10:23 2011(r226501) +++ head/bin/df/df.cTue Oct 18 08:18:26 2011(r226502) @@ -107,7 +107,7 @@ main(int argc, char *argv[]) const char *fstype; char *mntpath, *mntpt; const char **vfslist; - size_t i, mntsize; + int i, mntsize; int ch, rv; fstype = "ufs"; @@ -187,30 +187,21 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); - bzero(&maxwidths, sizeof(maxwidths)); - for (i = 0; i < mntsize; i++) - update_maxwidths(&maxwidths, &mntbuf[i]); - rv = 0; if (!*argv) { + /* everything (modulo -t) */ + mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); mntsize = regetmntinfo(&mntbuf, mntsize, vfslist); - bzero(&maxwidths, sizeof(maxwidths)); - for (i = 0; i < mntsize; i++) { - if (cflag) - addstat(&totalbuf, &mntbuf[i]); - update_maxwidths(&maxwidths, &mntbuf[i]); - } - if (cflag) - update_maxwidths(&maxwidths, &totalbuf); - for (i = 0; i < mntsize; i++) - if (aflag || (mntbuf[i].f_flags & MNT_IGNORE) == 0) - prtstat(&mntbuf[i], &maxwidths); - if (cflag) - prtstat(&totalbuf, &maxwidths); - exit(rv); + } else { + /* just the filesystems specified on the command line */ + mntbuf = malloc(argc * sizeof(*mntbuf)); + if (mntbuf == 0) + err(1, "malloc()"); + mntsize = 0; + /* continued in for loop below */ } + /* iterate through specified filesystems */ for (; *argv; argv++) { if (stat(*argv, &stbuf) < 0) { if ((mntpt = getmntpt(*argv)) == 0) { @@ -279,14 +270,24 @@ main(int argc, char *argv[]) continue; } - if (argc == 1) { - bzero(&maxwidths, sizeof(maxwidths)); - update_maxwidths(&maxwidths, &statfsbuf); + /* the user asked for it, so ignore the ignore flag */ + statfsbuf.f_flags &= ~MNT_IGNORE; + + /* add to list */ + mntbuf[mntsize++] = statfsbuf; + } + + bzero(&maxwidths, sizeof(maxwidths)); + for (i = 0; i < mntsize; i++) { + if (aflag || (mntbuf[i].f_flags & MNT_IGNORE) == 0) { + update_maxwidths(&maxwidths, &mntbuf[i]); + if (cflag) + addstat(&totalbuf, &mntbuf[i]); } - prtstat(&statfsbuf, &maxwidths); - if (cflag) - addstat(&totalbuf, &statfsbuf); } + for (i = 0; i < mntsize; i++) + if (aflag || (mntbuf[i].f_flags & MNT_IGNORE) == 0) + prtstat(&mntbuf[i], &maxwidths); if (cflag) prtstat(&totalbuf, &maxwidths); return (rv); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226498 - in head/sys: amd64/amd64 arm/arm i386/i386 sparc64/sparc64
Author: des Date: Tue Oct 18 07:39:27 2011 New Revision: 226498 URL: http://svn.freebsd.org/changeset/base/226498 Log: Trace attempts to call restricted MD syscalls. Modified: head/sys/amd64/amd64/sys_machdep.c head/sys/arm/arm/sys_machdep.c head/sys/i386/i386/sys_machdep.c head/sys/sparc64/sparc64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c == --- head/sys/amd64/amd64/sys_machdep.c Tue Oct 18 07:31:49 2011 (r226497) +++ head/sys/amd64/amd64/sys_machdep.c Tue Oct 18 07:39:27 2011 (r226498) @@ -203,6 +203,10 @@ sysarch(td, uap) case I386_SET_IOPERM: default: +#ifdef KTRACE + if (KTRPOINT(td, KTR_CAPFAIL)) + ktrcapfail(CAPFAIL_SYSCALL, 0, 0); +#endif return (ECAPMODE); } } Modified: head/sys/arm/arm/sys_machdep.c == --- head/sys/arm/arm/sys_machdep.c Tue Oct 18 07:31:49 2011 (r226497) +++ head/sys/arm/arm/sys_machdep.c Tue Oct 18 07:39:27 2011 (r226498) @@ -122,6 +122,10 @@ sysarch(td, uap) break; default: +#ifdef KTRACE + if (KTRPOINT(td, KTR_CAPFAIL)) + ktrcapfail(CAPFAIL_SYSCALL, 0, 0); +#endif return (ECAPMODE); } } Modified: head/sys/i386/i386/sys_machdep.c == --- head/sys/i386/i386/sys_machdep.cTue Oct 18 07:31:49 2011 (r226497) +++ head/sys/i386/i386/sys_machdep.cTue Oct 18 07:39:27 2011 (r226498) @@ -130,6 +130,10 @@ sysarch(td, uap) case I386_SET_IOPERM: default: +#ifdef KTRACE + if (KTRPOINT(td, KTR_CAPFAIL)) + ktrcapfail(CAPFAIL_SYSCALL, 0, 0); +#endif return (ECAPMODE); } } Modified: head/sys/sparc64/sparc64/sys_machdep.c == --- head/sys/sparc64/sparc64/sys_machdep.c Tue Oct 18 07:31:49 2011 (r226497) +++ head/sys/sparc64/sparc64/sys_machdep.c Tue Oct 18 07:39:27 2011 (r226498) @@ -69,6 +69,10 @@ sysarch(struct thread *td, struct sysarc break; default: +#ifdef KTRACE + if (KTRPOINT(td, KTR_CAPFAIL)) + ktrcapfail(CAPFAIL_SYSCALL, 0, 0); +#endif return (ECAPMODE); } } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226497 - head/sys/fs/portalfs
Author: des Date: Tue Oct 18 07:31:49 2011 New Revision: 226497 URL: http://svn.freebsd.org/changeset/base/226497 Log: Trace attempts to open a portal device. Ceterum censeo portalfs esse delendam. Modified: head/sys/fs/portalfs/portal_vnops.c Modified: head/sys/fs/portalfs/portal_vnops.c == --- head/sys/fs/portalfs/portal_vnops.c Tue Oct 18 07:29:21 2011 (r226496) +++ head/sys/fs/portalfs/portal_vnops.c Tue Oct 18 07:31:49 2011 (r226497) @@ -240,8 +240,13 @@ portal_open(ap) * This may require access to a global namespace (e.g. an IP address); * disallow it entirely, as we do open(2). */ - if (IN_CAPABILITY_MODE(td)) + if (IN_CAPABILITY_MODE(td)) { +#ifdef KTRACE + if (KTRPOINT(td, KTR_CAPFAIL)) + ktrcapfail(CAPFAIL_SYSCALL, 0, 0); +#endif return (ECAPMODE); + } #endif /* ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226495 - in head: sys/kern sys/sys usr.bin/kdump
Author: des Date: Tue Oct 18 07:28:58 2011 New Revision: 226495 URL: http://svn.freebsd.org/changeset/base/226495 Log: Revisit the capability failure trace points. The initial implementation only logged instances where an operation on a file descriptor required capabilities which the file descriptor did not have. By adding a type enum to struct ktr_cap_fail, we can catch other types of capability failures as well, such as disallowed system calls or attempts to wrap a file descriptor with more capabilities than it had to begin with. Modified: head/sys/kern/kern_ktrace.c head/sys/kern/sys_capability.c head/sys/kern/vfs_lookup.c head/sys/sys/ktrace.h head/usr.bin/kdump/kdump.c Modified: head/sys/kern/kern_ktrace.c == --- head/sys/kern/kern_ktrace.c Tue Oct 18 07:17:44 2011(r226494) +++ head/sys/kern/kern_ktrace.c Tue Oct 18 07:28:58 2011(r226495) @@ -772,7 +772,8 @@ ktrstruct(name, data, datalen) } void -ktrcapfail(needed, held) +ktrcapfail(type, needed, held) + enum ktr_cap_fail_type type; cap_rights_t needed; cap_rights_t held; { @@ -784,6 +785,7 @@ ktrcapfail(needed, held) if (req == NULL) return; kcf = &req->ktr_data.ktr_cap_fail; + kcf->cap_type = type; kcf->cap_needed = needed; kcf->cap_held = held; ktr_enqueuerequest(td, req); Modified: head/sys/kern/sys_capability.c == --- head/sys/kern/sys_capability.c Tue Oct 18 07:17:44 2011 (r226494) +++ head/sys/kern/sys_capability.c Tue Oct 18 07:28:58 2011 (r226495) @@ -218,7 +218,7 @@ cap_check(struct capability *c, cap_righ if ((c->cap_rights | rights) != c->cap_rights) { #ifdef KTRACE if (KTRPOINT(curthread, KTR_CAPFAIL)) - ktrcapfail(rights, c->cap_rights); + ktrcapfail(CAPFAIL_NOTCAPABLE, rights, c->cap_rights); #endif return (ENOTCAPABLE); } @@ -314,8 +314,14 @@ kern_capwrap(struct thread *td, struct f */ if (fp->f_type == DTYPE_CAPABILITY) { cp_old = fp->f_data; - if ((cp_old->cap_rights | rights) != cp_old->cap_rights) + if ((cp_old->cap_rights | rights) != cp_old->cap_rights) { +#ifdef KTRACE + if (KTRPOINT(curthread, KTR_CAPFAIL)) + ktrcapfail(CAPFAIL_INCREASE, + rights, cp_old->cap_rights); +#endif return (ENOTCAPABLE); + } } /* Modified: head/sys/kern/vfs_lookup.c == --- head/sys/kern/vfs_lookup.c Tue Oct 18 07:17:44 2011(r226494) +++ head/sys/kern/vfs_lookup.c Tue Oct 18 07:28:58 2011(r226495) @@ -188,8 +188,13 @@ namei(struct nameidata *ndp) */ if (IN_CAPABILITY_MODE(td)) { ndp->ni_strictrelative = 1; - if (ndp->ni_dirfd == AT_FDCWD) + if (ndp->ni_dirfd == AT_FDCWD) { +#ifdef KTRACE + if (KTRPOINT(td, KTR_CAPFAIL)) + ktrcapfail(CAPFAIL_LOOKUP, 0, 0); +#endif error = ECAPMODE; + } } #endif if (error) { @@ -281,8 +286,13 @@ namei(struct nameidata *ndp) if (*(cnp->cn_nameptr) == '/') { vrele(dp); VFS_UNLOCK_GIANT(vfslocked); - if (ndp->ni_strictrelative != 0) + if (ndp->ni_strictrelative != 0) { +#ifdef KTRACE + if (KTRPOINT(curthread, KTR_CAPFAIL)) + ktrcapfail(CAPFAIL_LOOKUP, 0, 0); +#endif return (ENOTCAPABLE); + } while (*(cnp->cn_nameptr) == '/') { cnp->cn_nameptr++; ndp->ni_pathlen--; @@ -644,6 +654,10 @@ dirloop: */ if (cnp->cn_flags & ISDOTDOT) { if (ndp->ni_strictrelative != 0) { +#ifdef KTRACE + if (KTRPOINT(curthread, KTR_CAPFAIL)) + ktrcapfail(CAPFAIL_LOOKUP, 0, 0); +#endif error = ENOTCAPABLE; goto bad; } Modified: head/sys/sys/ktrace.h == --- head/sys/sys/ktrace.h Tue Oct 18 07:17:44 2011(r226494) +++ head/sys/sys/ktrace.h Tue Oct 18 07:28:58 2011(r226495) @@ -181,7 +181,14 @@ struct ktr_proc_ctor { * KTR_CAPFAIL - trace capability check failures */ #define KTR_CAPFAIL12 +enum ktr_cap_fail_type { + CAPFAIL_
svn commit: r226464 - head/etc/rc.d
Author: des Date: Mon Oct 17 13:05:57 2011 New Revision: 226464 URL: http://svn.freebsd.org/changeset/base/226464 Log: The rc_force test was inverted in the previous commit, so that dhclient ran for interfaces which were not configured for DHCP *unless* rc_force was set; the correct logic is to run dhclient for those interfaces *only if* rc_force is set. Broken by:des@ Noticed by: everybody and his dog Submitted by: rea@ PR: bin/161733 Modified: head/etc/rc.d/dhclient Modified: head/etc/rc.d/dhclient == --- head/etc/rc.d/dhclient Mon Oct 17 12:22:09 2011(r226463) +++ head/etc/rc.d/dhclient Mon Oct 17 13:05:57 2011(r226464) @@ -41,7 +41,7 @@ if [ -z $ifn ] ; then echo 1>&2 "$0: no interface specified" return 1 fi -elif [ -n "${rc_force}" ] && ! dhcpif $ifn; then +elif [ -z "${rc_force}" ] && ! dhcpif $ifn; then return 1 fi ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226345 - in head: etc/rc.d sbin/dhclient
Author: des Date: Thu Oct 13 17:20:45 2011 New Revision: 226345 URL: http://svn.freebsd.org/changeset/base/226345 Log: Make dhclient use a pid file. Modify the rc script accordingly; while there, clean it up and add some error checks. Glanced at by:brooks@ MFC after:3 weeks Modified: head/etc/rc.d/dhclient head/sbin/dhclient/Makefile head/sbin/dhclient/dhclient.8 head/sbin/dhclient/dhclient.c head/sbin/dhclient/dhcpd.h head/sbin/dhclient/errwarn.c Modified: head/etc/rc.d/dhclient == --- head/etc/rc.d/dhclient Thu Oct 13 16:29:24 2011(r226344) +++ head/etc/rc.d/dhclient Thu Oct 13 17:20:45 2011(r226345) @@ -9,55 +9,39 @@ . /etc/rc.subr . /etc/network.subr +ifn="$2" + name="dhclient" rcvar= -start_cmd="dhclient_start" -stop_cmd="dhclient_stop" +pidfile="/var/run/${name}.${ifn}.pid" +start_precmd="dhclient_prestart" -dhclient_start() +dhclient_prestart() { - # prevent unnecessary restarts - # XXX: dhclient had better create a pidfile - if [ -x /bin/pgrep ]; then - pids=`/bin/pgrep -f "dhclient: $ifn(\$| .*)"` - if [ -n "$pids" ]; then - sleep 1 - pids=`/bin/pgrep -f "dhclient: $ifn(\$| .*)"` - if [ -n "$pids" ]; then - exit 0 - fi - elif [ -e /var/run/dhclient.pid ]; then - if [ -n "`pgrep -F /var/run/dhclient.pid`" ]; then - exit 0 - fi - fi - fi - - # Override for $ifn specific flags (see rc.subr for $flags setting) - specific=`get_if_var $ifn dhclient_flags_IF` + # Interface-specific flags (see rc.subr for $flags setting) + specific=$(get_if_var $ifn dhclient_flags_IF) if [ -z "$flags" -a -n "$specific" ]; then rc_flags=$specific fi - background_dhclient=`get_if_var $ifn background_dhclient_IF $background_dhclient` + background_dhclient=$(get_if_var $ifn background_dhclient_IF $background_dhclient) if checkyesno background_dhclient; then rc_flags="${rc_flags} -b" fi - ${dhclient_program} ${rc_flags} $ifn -} - -dhclient_stop() -{ - ifconfig $ifn down # cause dhclient to die + rc_flags="${rc_flags} ${ifn}" } -ifn="$2" - load_rc_config $name load_rc_config network -if ! dhcpif $ifn; then +if [ -z $ifn ] ; then + # only complain if a command was specified but no interface + if [ -n "$1" ] ; then + echo 1>&2 "$0: no interface specified" + return 1 + fi +elif [ -n "${rc_force}" ] && ! dhcpif $ifn; then return 1 fi Modified: head/sbin/dhclient/Makefile == --- head/sbin/dhclient/Makefile Thu Oct 13 16:29:24 2011(r226344) +++ head/sbin/dhclient/Makefile Thu Oct 13 17:20:45 2011(r226345) @@ -39,6 +39,8 @@ PROG= dhclient SCRIPTS=dhclient-script MAN= dhclient.8 dhclient.conf.5 dhclient.leases.5 dhcp-options.5 \ dhclient-script.8 +DPADD= ${LIBUTIL} +LDADD= -lutil WARNS?=2 Modified: head/sbin/dhclient/dhclient.8 == --- head/sbin/dhclient/dhclient.8 Thu Oct 13 16:29:24 2011 (r226344) +++ head/sbin/dhclient/dhclient.8 Thu Oct 13 17:20:45 2011 (r226345) @@ -38,7 +38,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 13, 2007 +.Dd October 13, 2011 .Dt DHCLIENT 8 .Os .Sh NAME @@ -49,6 +49,7 @@ .Op Fl bdqu .Op Fl c Ar file .Op Fl l Ar file +.Op Fl p Ar file .Ar interface .Sh DESCRIPTION The @@ -83,6 +84,10 @@ will revert to running in the background Specify an alternate location, .Ar file , for the leases file. +.It Fl p Ar file +Specify an alternate location for the PID file. +The default is +.Pa /var/run/dhclient. Ns Ar interface Ns Pa .pid . .It Fl q Forces .Nm Modified: head/sbin/dhclient/dhclient.c == --- head/sbin/dhclient/dhclient.c Thu Oct 13 16:29:24 2011 (r226344) +++ head/sbin/dhclient/dhclient.c Thu Oct 13 17:20:45 2011 (r226345) @@ -95,6 +95,9 @@ struct iaddr iaddr_broadcast = { 4, { 25 struct in_addr inaddr_any; struct sockaddr_in sockaddr_broadcast; +char *path_dhclient_pidfile; +struct pidfh *pidfile; + /* * ASSERT_STATE() does nothing now; it used to be * assert (state_is == state_shouldbe). @@ -316,6 +319,8 @@ die: if (ifi->client->alias) script_write_params("alias_", ifi->client->alias); script_go(); + if (pidfile != NULL) + pidfile_remove(pidfile); exit(1); } @@ -327,12 +332,13 @@ main(int argc, char *arg
svn commit: r226344 - head/usr.bin/kdump
Author: des Date: Thu Oct 13 16:29:24 2011 New Revision: 226344 URL: http://svn.freebsd.org/changeset/base/226344 Log: Clean up mkioctls a bit, and fix cross-building by checking ${MACHINE} instead of $(uname -m). Pointed out by: nyan@ Modified: head/usr.bin/kdump/Makefile head/usr.bin/kdump/mkioctls Modified: head/usr.bin/kdump/Makefile == --- head/usr.bin/kdump/Makefile Thu Oct 13 16:20:10 2011(r226343) +++ head/usr.bin/kdump/Makefile Thu Oct 13 16:29:24 2011(r226344) @@ -21,7 +21,8 @@ NO_WERROR?= YES CLEANFILES=ioctl.c kdump_subr.c kdump_subr.h linux_syscalls.c ioctl.c: mkioctls - sh ${.CURDIR}/mkioctls ${DESTDIR}/usr/include > ${.TARGET} + env MACHINE=${MACHINE} \ + sh ${.CURDIR}/mkioctls ${DESTDIR}/usr/include > ${.TARGET} kdump_subr.h: mksubr sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include | \ Modified: head/usr.bin/kdump/mkioctls == --- head/usr.bin/kdump/mkioctls Thu Oct 13 16:20:10 2011(r226343) +++ head/usr.bin/kdump/mkioctls Thu Oct 13 16:29:24 2011(r226344) @@ -13,15 +13,16 @@ LC_ALL=C; export LC_ALL # Build a list of headers that have ioctls in them. # XXX should we use an ANSI cpp? -ioctl_includes=` +ioctl_includes=$( cd $1 find -H -s * -name '*.h' | grep -v '.*disk.*\.h' | \ xargs egrep -l \ '^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-9_]*[ ]+_IO[^a-z0-9_]' | - awk '{printf("#include <%s>n", $1)}' -` + awk '{printf("#include <%s>\\n", $1)}' +) -case "`uname -m`" in +: ${MACHINE=$(uname -m)} +case "${MACHINE}" in *pc98*) ioctl_includes="$ioctl_includes#include \\n" ;; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226329 - head/usr.bin/kdump
Author: des Date: Wed Oct 12 21:45:12 2011 New Revision: 226329 URL: http://svn.freebsd.org/changeset/base/226329 Log: Make kdump compile cleanly at WARNS level 6, with one exception: the ipfilter headers contain a duplicated function declaration. Turn off -Werror to allow kdump to compile in spite of this. It would be neat to be able to turn off -Werror on a file-by-file basis... PR: bin/161478 Submitted by: Garrett Cooper Modified: head/usr.bin/kdump/Makefile head/usr.bin/kdump/kdump.c head/usr.bin/kdump/mkioctls Modified: head/usr.bin/kdump/Makefile == --- head/usr.bin/kdump/Makefile Wed Oct 12 21:38:48 2011(r226328) +++ head/usr.bin/kdump/Makefile Wed Oct 12 21:45:12 2011(r226329) @@ -16,9 +16,9 @@ CFLAGS+= -I${.CURDIR}/../ktrace -I${.CUR SRCS+= linux_syscalls.c .endif -WARNS?=0 +NO_WERROR?=YES -CLEANFILES=ioctl.c kdump_subr.c linux_syscalls.c +CLEANFILES=ioctl.c kdump_subr.c kdump_subr.h linux_syscalls.c ioctl.c: mkioctls sh ${.CURDIR}/mkioctls ${DESTDIR}/usr/include > ${.TARGET} Modified: head/usr.bin/kdump/kdump.c == --- head/usr.bin/kdump/kdump.c Wed Oct 12 21:38:48 2011(r226328) +++ head/usr.bin/kdump/kdump.c Wed Oct 12 21:45:12 2011(r226329) @@ -95,6 +95,8 @@ void visdump(char *, int, int); void ktrgenio(struct ktr_genio *, int); void ktrpsig(struct ktr_psig *); void ktrcsw(struct ktr_csw *); +void ktruser_malloc(unsigned char *); +void ktruser_rtld(int, unsigned char *); void ktruser(int, unsigned char *); void ktrsockaddr(struct sockaddr *); void ktrstat(struct stat *); @@ -508,7 +510,6 @@ ktrsyscall(struct ktr_syscall *ktr, u_in (flags == 0 || (flags & SV_ABI_MASK) == SV_ABI_FREEBSD)) { switch (ktr->ktr_code) { case SYS_ioctl: { - const char *cp; print_number(ip, narg, c); putchar(c); ioctlname(*ip, decimal); @@ -1334,7 +1335,7 @@ struct utrace_malloc { }; void -ktruser_malloc(int len, unsigned char *p) +ktruser_malloc(unsigned char *p) { struct utrace_malloc *ut = (struct utrace_malloc *)p; @@ -1358,7 +1359,7 @@ ktruser(int len, unsigned char *p) } if (len == sizeof(struct utrace_malloc)) { - ktruser_malloc(len, p); + ktruser_malloc(p); return; } @@ -1393,61 +1394,67 @@ ktrsockaddr(struct sockaddr *sa) printf(", "); #define check_sockaddr_len(n) \ - if (sa_##n->s##n##_len < sizeof(struct sockaddr_##n)) { \ + if (sa_##n.s##n##_len < sizeof(struct sockaddr_##n)) { \ printf("invalid"); \ break; \ } switch(sa->sa_family) { case AF_INET: { - struct sockaddr_in *sa_in; + struct sockaddr_in sa_in; - sa_in = (struct sockaddr_in *)sa; + memset(&sa_in, 0, sizeof(sa_in)); + memcpy(&sa_in, sa, sizeof(sa)); check_sockaddr_len(in); - inet_ntop(AF_INET, &sa_in->sin_addr, addr, sizeof addr); - printf("%s:%u", addr, ntohs(sa_in->sin_port)); + inet_ntop(AF_INET, &sa_in.sin_addr, addr, sizeof addr); + printf("%s:%u", addr, ntohs(sa_in.sin_port)); break; } #ifdef NETATALK case AF_APPLETALK: { - struct sockaddr_at *sa_at; + struct sockaddr_at sa_at; struct netrange *nr; - sa_at = (struct sockaddr_at *)sa; + memset(&sa_at, 0, sizeof(sa_at)); + memcpy(&sa_at, sa, sizeof(sa)); check_sockaddr_len(at); - nr = &sa_at->sat_range.r_netrange; - printf("%d.%d, %d-%d, %d", ntohs(sa_at->sat_addr.s_net), - sa_at->sat_addr.s_node, ntohs(nr->nr_firstnet), + nr = &sa_at.sat_range.r_netrange; + printf("%d.%d, %d-%d, %d", ntohs(sa_at.sat_addr.s_net), + sa_at.sat_addr.s_node, ntohs(nr->nr_firstnet), ntohs(nr->nr_lastnet), nr->nr_phase); break; } #endif case AF_INET6: { - struct sockaddr_in6 *sa_in6; + struct sockaddr_in6 sa_in6; - sa_in6 = (struct sockaddr_in6 *)sa; + memset(&sa_in6, 0, sizeof(sa_in6)); + memcpy(&sa_in6, sa, sizeof(sa)); check_sockaddr_len(in6); - inet_ntop(AF_INET6, &sa_in6->sin6_addr, addr, sizeof addr); -
svn commit: r226269 - in head: lib/libc/sys sys/kern sys/sys usr.bin/kdump usr.bin/ktrace
Author: des Date: Tue Oct 11 20:37:10 2011 New Revision: 226269 URL: http://svn.freebsd.org/changeset/base/226269 Log: Add a new trace point, KTRFAC_CAPFAIL, which traces capability check failures. It is included in the default set for ktrace(1) and kdump(1). Modified: head/lib/libc/sys/ktrace.2 head/sys/kern/kern_ktrace.c head/sys/kern/sys_capability.c head/sys/sys/ktrace.h head/usr.bin/kdump/kdump.c head/usr.bin/ktrace/ktrace.1 head/usr.bin/ktrace/ktrace.h head/usr.bin/ktrace/subr.c Modified: head/lib/libc/sys/ktrace.2 == --- head/lib/libc/sys/ktrace.2 Tue Oct 11 19:31:02 2011(r226268) +++ head/lib/libc/sys/ktrace.2 Tue Oct 11 20:37:10 2011(r226269) @@ -28,7 +28,7 @@ .\" @(#)ktrace.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd October 9, 2011 +.Dd October 10, 2011 .Dt KTRACE 2 .Os .Sh NAME @@ -67,9 +67,9 @@ The argument specifies the requested ktrace operation. The defined operations are: .Bl -column KTRFLAG_DESCENDXXX -offset indent -.It "KTROP_SET Enable trace points specified in" +.It "KTROP_SET Enable trace points specified in" .Fa trpoints . -.It "KTROP_CLEAR Disable trace points specified in +.It "KTROP_CLEAR Disable trace points specified in" .Fa trpoints . .It "KTROP_CLEARFILE Stop all tracing." .It "KTRFLAG_DESCEND The tracing change should apply to the" @@ -93,6 +93,7 @@ generate much output). .It "KTRFAC_SYSCTL Trace sysctls." .It "KTRFAC_PROCCTOR Trace process construction." .It "KTRFAC_PROCDTOR Trace process destruction." +.It "KTRFAC_CAPFAILTrace capability failures." .It "KTRFAC_INHERITInherit tracing to future children." .El .Pp Modified: head/sys/kern/kern_ktrace.c == --- head/sys/kern/kern_ktrace.c Tue Oct 11 19:31:02 2011(r226268) +++ head/sys/kern/kern_ktrace.c Tue Oct 11 20:37:10 2011(r226269) @@ -95,6 +95,7 @@ struct ktr_request { void*ktr_buffer; union { struct ktr_proc_ctor ktr_proc_ctor; + struct ktr_cap_fail ktr_cap_fail; struct ktr_syscall ktr_syscall; struct ktr_sysret ktr_sysret; struct ktr_genio ktr_genio; @@ -117,6 +118,7 @@ static int data_lengths[] = { 0, /* KTR_SYSCTL */ sizeof(struct ktr_proc_ctor), /* KTR_PROCCTOR */ 0, /* KTR_PROCDTOR */ + sizeof(struct ktr_cap_fail),/* KTR_CAPFAIL */ }; static STAILQ_HEAD(, ktr_request) ktr_free; @@ -768,6 +770,25 @@ ktrstruct(name, data, datalen) req->ktr_header.ktr_len = buflen; ktr_submitrequest(curthread, req); } + +void +ktrcapfail(needed, held) + cap_rights_t needed; + cap_rights_t held; +{ + struct thread *td = curthread; + struct ktr_request *req; + struct ktr_cap_fail *kcf; + + req = ktr_getrequest(KTR_CAPFAIL); + if (req == NULL) + return; + kcf = &req->ktr_data.ktr_cap_fail; + kcf->cap_needed = needed; + kcf->cap_held = held; + ktr_enqueuerequest(td, req); + ktrace_exit(td); +} #endif /* KTRACE */ /* Interface and common routines */ Modified: head/sys/kern/sys_capability.c == --- head/sys/kern/sys_capability.c Tue Oct 11 19:31:02 2011 (r226268) +++ head/sys/kern/sys_capability.c Tue Oct 11 20:37:10 2011 (r226269) @@ -52,6 +52,7 @@ */ #include "opt_capsicum.h" +#include "opt_ktrace.h" #include __FBSDID("$FreeBSD$"); @@ -68,6 +69,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include @@ -212,8 +215,13 @@ static int cap_check(struct capability *c, cap_rights_t rights) { - if ((c->cap_rights | rights) != c->cap_rights) + if ((c->cap_rights | rights) != c->cap_rights) { +#ifdef KTRACE + if (KTRPOINT(curthread, KTR_CAPFAIL)) + ktrcapfail(rights, c->cap_rights); +#endif return (ENOTCAPABLE); + } return (0); } Modified: head/sys/sys/ktrace.h == --- head/sys/sys/ktrace.h Tue Oct 11 19:31:02 2011(r226268) +++ head/sys/sys/ktrace.h Tue Oct 11 20:37:10 2011(r226269) @@ -178,6 +178,15 @@ struct ktr_proc_ctor { #define KTR_PROCDTOR 11 /* + * KTR_CAPFAIL - trace capability check failures + */ +#define KTR_CAPFAIL12 +struct ktr_cap_fail { + cap_rights_tcap_needed; + cap_rights_tcap_held; +}; + +/* * KTR_DROP - If this bit is set in ktr_type, then at least one event * between the previous record and this record was dropped. */ @@ -198,6 +207,7 @@ struct ktr_pr
svn commit: r226262 - head/usr.bin/kdump
Author: des Date: Tue Oct 11 15:04:58 2011 New Revision: 226262 URL: http://svn.freebsd.org/changeset/base/226262 Log: The previous commit did not fix the issue since it did not prevent sign extension. Cast to u_register_t first, then to uintmax_t. Submitted by: bde@ Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c == --- head/usr.bin/kdump/kdump.c Tue Oct 11 15:03:42 2011(r226261) +++ head/usr.bin/kdump/kdump.c Tue Oct 11 15:04:58 2011(r226262) @@ -110,14 +110,14 @@ struct ktr_header ktr_header; #define TIME_FORMAT"%b %e %T %Y" #define eqs(s1, s2)(strcmp((s1), (s2)) == 0) -#define print_number(i,n,c) do { \ - if (decimal)\ - printf("%c%jd", c, (intmax_t)*i); \ - else\ - printf("%c%#jx", c, (uintmax_t)*i); \ - i++;\ - n--;\ - c = ',';\ +#define print_number(i,n,c) do { \ + if (decimal)\ + printf("%c%jd", c, (intmax_t)*i); \ + else\ + printf("%c%#jx", c, (uintmax_t)(u_register_t)*i); \ + i++;\ + n--;\ + c = ',';\ } while (0) #if defined(__amd64__) || defined(__i386__) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226246 - head/usr.bin/kdump
Author: des Date: Tue Oct 11 07:46:45 2011 New Revision: 226246 URL: http://svn.freebsd.org/changeset/base/226246 Log: Cast to unsigned for %#jx. Noticed by: jh@ Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c == --- head/usr.bin/kdump/kdump.c Tue Oct 11 05:17:45 2011(r226245) +++ head/usr.bin/kdump/kdump.c Tue Oct 11 07:46:45 2011(r226246) @@ -114,7 +114,7 @@ struct ktr_header ktr_header; if (decimal)\ printf("%c%jd", c, (intmax_t)*i); \ else\ - printf("%c%#jx", c, (intmax_t)*i); \ + printf("%c%#jx", c, (uintmax_t)*i); \ i++;\ n--;\ c = ',';\ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226167 - head/lib/libc/sys
Author: des Date: Sun Oct 9 10:58:58 2011 New Revision: 226167 URL: http://svn.freebsd.org/changeset/base/226167 Log: Line up the struct declaration (yes, I know this isn't what it looks like in the header file) Modified: head/lib/libc/sys/ktrace.2 Modified: head/lib/libc/sys/ktrace.2 == --- head/lib/libc/sys/ktrace.2 Sun Oct 9 10:55:15 2011(r226166) +++ head/lib/libc/sys/ktrace.2 Sun Oct 9 10:58:58 2011(r226167) @@ -101,12 +101,12 @@ followed by a trace point specific struc The generic header is: .Bd -literal struct ktr_header { - int ktr_len;/* length of buf */ - short ktr_type; /* trace record type */ - pid_t ktr_pid;/* process id */ - charktr_comm[MAXCOMLEN+1]; /* command name */ - struct timeval ktr_time; /* timestamp */ - intptr_tktr_tid;/* was ktr_buffer */ + int ktr_len;/* length of buf */ + short ktr_type; /* trace record type */ + pid_t ktr_pid;/* process id */ + charktr_comm[MAXCOMLEN+1]; /* command name */ + struct timeval ktr_time; /* timestamp */ + intptr_tktr_tid;/* was ktr_buffer */ }; .Ed .Pp ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226166 - head/lib/libc/sys
Author: des Date: Sun Oct 9 10:55:15 2011 New Revision: 226166 URL: http://svn.freebsd.org/changeset/base/226166 Log: Document some not-so-recently added trace points. MFC after:1 week Modified: head/lib/libc/sys/ktrace.2 Modified: head/lib/libc/sys/ktrace.2 == --- head/lib/libc/sys/ktrace.2 Sat Oct 8 21:15:39 2011(r226165) +++ head/lib/libc/sys/ktrace.2 Sun Oct 9 10:55:15 2011(r226166) @@ -28,7 +28,7 @@ .\" @(#)ktrace.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 13, 2008 +.Dd October 9, 2011 .Dt KTRACE 2 .Os .Sh NAME @@ -80,7 +80,7 @@ The .Fa trpoints argument specifies the trace points of interest. The defined trace points are: -.Bl -column KTRFAC_SYSCALLXXX -offset indent +.Bl -column KTRFAC_PROCCTORXXX -offset indent .It "KTRFAC_SYSCALLTrace system calls." .It "KTRFAC_SYSRET Trace return values from system calls." .It "KTRFAC_NAMEI Trace name lookup operations." @@ -88,6 +88,11 @@ The defined trace points are: generate much output). .It "KTRFAC_PSIG Trace posted signals." .It "KTRFAC_CSWTrace context switch points." +.It "KTRFAC_USER Trace application-specific events." +.It "KTRFAC_STRUCT Trace certain data structures." +.It "KTRFAC_SYSCTL Trace sysctls." +.It "KTRFAC_PROCCTOR Trace process construction." +.It "KTRFAC_PROCDTOR Trace process destruction." .It "KTRFAC_INHERITInherit tracing to future children." .El .Pp ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226164 - head/usr.bin/kdump
Author: des Date: Sat Oct 8 21:02:08 2011 New Revision: 226164 URL: http://svn.freebsd.org/changeset/base/226164 Log: Address some of bde@'s concerns with the new code. Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c == --- head/usr.bin/kdump/kdump.c Sat Oct 8 18:29:30 2011(r226163) +++ head/usr.bin/kdump/kdump.c Sat Oct 8 21:02:08 2011(r226164) @@ -110,16 +110,15 @@ struct ktr_header ktr_header; #define TIME_FORMAT"%b %e %T %Y" #define eqs(s1, s2)(strcmp((s1), (s2)) == 0) -#define print_number(i,n,c)\ - do {\ - if (decimal)\ - printf("%c%jd", c, (intmax_t)*i); \ - else\ - printf("%c%#jx", c, (intmax_t)*i); \ - i++;\ - n--;\ - c = ',';\ - } while (0) +#define print_number(i,n,c) do { \ + if (decimal)\ + printf("%c%jd", c, (intmax_t)*i); \ + else\ + printf("%c%#jx", c, (intmax_t)*i); \ + i++;\ + n--;\ + c = ',';\ +} while (0) #if defined(__amd64__) || defined(__i386__) @@ -513,7 +512,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_in } case SYS_ptrace: putchar('('); - ptraceopname((intmax_t)*ip); + ptraceopname(*ip); c = ','; ip++; narg--; @@ -522,14 +521,14 @@ ktrsyscall(struct ktr_syscall *ktr, u_in case SYS_eaccess: print_number(ip, narg, c); putchar(','); - accessmodename((intmax_t)*ip); + accessmodename(*ip); ip++; narg--; break; case SYS_open: print_number(ip, narg, c); putchar(','); - flagsandmodename((int)ip[0], (int)ip[1], decimal); + flagsandmodename(ip[0], ip[1], decimal); ip += 2; narg -= 2; break; @@ -537,7 +536,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_in print_number(ip, narg, c); print_number(ip, narg, c); putchar(','); - wait4optname((intmax_t)*ip); + wait4optname(*ip); ip++; narg--; break; @@ -546,14 +545,14 @@ ktrsyscall(struct ktr_syscall *ktr, u_in case SYS_lchmod: print_number(ip, narg, c); putchar(','); - modename((intmax_t)*ip); + modename(*ip); ip++; narg--; break; case SYS_mknod: print_number(ip, narg, c); putchar(','); - modename((intmax_t)*ip); + modename(*ip); ip++; narg--; break; @@ -561,7 +560,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_in print_number(ip, narg, c); print_number(ip, narg, c); putchar(','); - getfsstatflagsname((intmax_t)*ip); + getfsstatflagsname(*ip); ip++; narg--; break; @@ -569,14 +568,14 @@ ktrsyscall(struct ktr_syscall *ktr, u_in print_number(ip, narg, c); print_number(ip, narg, c);
svn commit: r226159 - head/usr.bin/kdump
Author: des Date: Sat Oct 8 13:01:38 2011 New Revision: 226159 URL: http://svn.freebsd.org/changeset/base/226159 Log: Teach kdump(1) to decode capability bitmasks. MFC after:3 weeks Modified: head/usr.bin/kdump/kdump.c head/usr.bin/kdump/mksubr Modified: head/usr.bin/kdump/kdump.c == --- head/usr.bin/kdump/kdump.c Sat Oct 8 12:59:41 2011(r226158) +++ head/usr.bin/kdump/kdump.c Sat Oct 8 13:01:38 2011(r226159) @@ -979,6 +979,13 @@ ktrsyscall(struct ktr_syscall *ktr, u_in ip++; narg--; break; +case SYS_cap_new: +print_number(ip, narg, c); +putchar(','); +capname((intmax_t)*ip); +ip++; +narg--; + break; } } while (narg > 0) { Modified: head/usr.bin/kdump/mksubr == --- head/usr.bin/kdump/mksubr Sat Oct 8 12:59:41 2011(r226158) +++ head/usr.bin/kdump/mksubr Sat Oct 8 13:01:38 2011(r226159) @@ -186,6 +186,7 @@ cat <<_EOF_ #include #include #include +#include #include "kdump_subr.h" @@ -337,6 +338,7 @@ _EOF_ auto_or_type "accessmodename" "[A-Z]_OK[[:space:]]+0?x?[0-9A-Fa-f]+" "sys/unistd.h" auto_switch_type "acltypename" "ACL_TYPE_[A-Z4_]+[[:space:]]+0x[0-9]+" "sys/acl.h" +auto_or_type "capname" "CAP_[A-Z]+[[:space:]]+0x[01248]{16}ULL" "sys/capability.h" auto_switch_type "extattrctlname" "EXTATTR_NAMESPACE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/extattr.h" auto_or_type "flagsname" "O_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/fcntl.h" auto_or_type "flockname" "LOCK_[A-Z]+[[:space:]]+0x[0-9]+" "sys/fcntl.h" ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226158 - head/usr.bin/kdump
Author: des Date: Sat Oct 8 12:59:41 2011 New Revision: 226158 URL: http://svn.freebsd.org/changeset/base/226158 Log: Fix the dependency issue properly by a) moving kdump_subr.c to the front of the SRCS list and b) listing kdump_subr.h in DPSRCS. Modified: head/usr.bin/kdump/Makefile Modified: head/usr.bin/kdump/Makefile == --- head/usr.bin/kdump/Makefile Sat Oct 8 12:47:00 2011(r226157) +++ head/usr.bin/kdump/Makefile Sat Oct 8 12:59:41 2011(r226158) @@ -8,7 +8,8 @@ SFX=32 .PATH: ${.CURDIR}/../ktrace PROG= kdump -SRCS= kdump.c ioctl.c kdump_subr.c subr.c +SRCS= kdump_subr.c kdump.c ioctl.c subr.c +DPSRCS=kdump_subr.h CFLAGS+= -I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../.. -I. .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" @@ -29,11 +30,6 @@ kdump_subr.h: mksubr kdump_subr.c: mksubr kdump_subr.h sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include >${.TARGET} -# kdump.c includes kdump_subr.h, which is auto-generated. Add a -# manual dependency to make sure kdump_subr.h is generated before we -# try to either compile or preprocess kdump.c. -${.CURDIR}/kdump.c: kdump_subr.h - linux_syscalls.c: /bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh \ ${.CURDIR}/../../sys/${MACHINE_ARCH}/linux${SFX}/syscalls.master ${.CURDIR}/linux_syscalls.conf ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226157 - head/usr.bin/kdump
Author: des Date: Sat Oct 8 12:47:00 2011 New Revision: 226157 URL: http://svn.freebsd.org/changeset/base/226157 Log: Bring ioctlname() in line with all the other *name() functions, which actually print the name (or the numeric value, if they can't figure out the correct name) instead of just returning a pointer to it. Also, since ioctl numbers are not and probably never will be unique, drop support for using a switch statement instead of an if/else chain. Modified: head/usr.bin/kdump/kdump.c head/usr.bin/kdump/mkioctls Modified: head/usr.bin/kdump/kdump.c == --- head/usr.bin/kdump/kdump.c Sat Oct 8 12:42:19 2011(r226156) +++ head/usr.bin/kdump/kdump.c Sat Oct 8 12:47:00 2011(r226157) @@ -100,7 +100,7 @@ void ktrsockaddr(struct sockaddr *); void ktrstat(struct stat *); void ktrstruct(char *, size_t); void usage(void); -const char *ioctlname(u_long); +void ioctlname(unsigned long, int); int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata, resolv = 0, abiflag = 0; @@ -504,14 +504,8 @@ ktrsyscall(struct ktr_syscall *ktr, u_in case SYS_ioctl: { const char *cp; print_number(ip, narg, c); - if ((cp = ioctlname(*ip)) != NULL) - printf(",%s", cp); - else { - if (decimal) - printf(",%jd", (intmax_t)*ip); - else - printf(",%#jx ", (intmax_t)*ip); - } + putchar(c); + ioctlname(*ip, decimal); c = ','; ip++; narg--; Modified: head/usr.bin/kdump/mkioctls == --- head/usr.bin/kdump/mkioctls Sat Oct 8 12:42:19 2011(r226156) +++ head/usr.bin/kdump/mkioctls Sat Oct 8 12:47:00 2011(r226157) @@ -4,15 +4,8 @@ set -e -if [ "x$1" = "x-s" ]; then - use_switch=1 - shift -else - use_switch=0 -fi - if [ -z "$1" ]; then - echo "usage: sh $0 [-s] include-dir" + echo "usage: sh $0 include-dir" exit 1 fi @@ -30,7 +23,7 @@ ioctl_includes=` awk -v x="$ioctl_includes" 'BEGIN {print x}' | gcc -E -I$1 -dM -DCOMPAT_43TTY - | - awk -v ioctl_includes="$ioctl_includes" -v use_switch="$use_switch" ' + awk -v ioctl_includes="$ioctl_includes" ' BEGIN { print "/* XXX obnoxious prerequisites. */" print "#define COMPAT_43" @@ -55,16 +48,15 @@ BEGIN { print "#include " print "#include " print "" - print "const char *ioctlname(u_long val);" + print "void ioctlname(unsigned long val, int decimal);" print "" print ioctl_includes print "" - print "const char *" - print "ioctlname(u_long val)" + print "void" + print "ioctlname(unsigned long val, int decimal)" print "{" + print "\tconst char *str = NULL;" print "" - if (use_switch) - print "\tswitch(val) {" } /^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-9_]*[ ]+_IO/ { @@ -75,16 +67,20 @@ BEGIN { break; ++i; # - if (use_switch) - printf("\tcase %s:\n\t\treturn(\"%s\");\n", $i, $i); - else - printf("\tif (val == %s)\n\t\treturn(\"%s\");\n", $i, $i); - + print("\t"); + if (n++ > 0) + print("else "); + printf("if (val == %s)\n", $i); + printf("\t\tstr = \"%s\";\n", $i); } END { - if (use_switch) - print "\t}" - print "\n\treturn(NULL);" + print "\n" + print "\tif (str != NULL)\n" + print "\t\tprintf(\"%s\", str);\n" + print "\telse if (decimal)\n" + print "\t\tprintf(\"%lu\", val);\n" + print "\telse\n" + print "\t\tprintf(\"%#lx\", val);\n" print "}" } ' ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226153 - head/usr.bin/kdump
Author: des Date: Sat Oct 8 12:28:06 2011 New Revision: 226153 URL: http://svn.freebsd.org/changeset/base/226153 Log: I appreciate the logic behind using a (void) cast to indicate that the return value is intentionally ignored, but frankly, all it does is get in the way of the code. Also fix a few other incorrect casts, such as (void *)malloc(foo) and passing signed values to %x. Modified: head/usr.bin/kdump/kdump.c head/usr.bin/kdump/mksubr Modified: head/usr.bin/kdump/kdump.c == --- head/usr.bin/kdump/kdump.c Sat Oct 8 12:27:12 2011(r226152) +++ head/usr.bin/kdump/kdump.c Sat Oct 8 12:28:06 2011(r226153) @@ -165,10 +165,10 @@ main(int argc, char *argv[]) pid_t pid = 0; u_int sv_flags; - (void) setlocale(LC_CTYPE, ""); + setlocale(LC_CTYPE, ""); while ((ch = getopt(argc,argv,"f:dElm:np:AHRrsTt:")) != -1) - switch((char)ch) { + switch (ch) { case 'A': abiflag = 1; break; @@ -220,7 +220,7 @@ main(int argc, char *argv[]) if (argc > optind) usage(); - m = (void *)malloc(size = 1025); + m = malloc(size = 1025); if (m == NULL) errx(1, "%s", strerror(ENOMEM)); if (!freopen(tracefile, "r", stdin)) @@ -231,7 +231,7 @@ main(int argc, char *argv[]) if (ktr_header.ktr_type & KTR_DROP) { ktr_header.ktr_type &= ~KTR_DROP; if (!drop_logged && threads) { - (void)printf( + printf( "%6jd %6jd %-8.*s Events dropped.\n", (intmax_t)ktr_header.ktr_pid, ktr_header.ktr_tid > 0 ? @@ -239,7 +239,7 @@ main(int argc, char *argv[]) MAXCOMLEN, ktr_header.ktr_comm); drop_logged = 1; } else if (!drop_logged) { - (void)printf("%6jd %-8.*s Events dropped.\n", + printf("%6jd %-8.*s Events dropped.\n", (intmax_t)ktr_header.ktr_pid, MAXCOMLEN, ktr_header.ktr_comm); drop_logged = 1; @@ -251,7 +251,7 @@ main(int argc, char *argv[]) if ((ktrlen = ktr_header.ktr_len) < 0) errx(1, "bogus length 0x%x", ktrlen); if (ktrlen > size) { - m = (void *)realloc(m, ktrlen+1); + m = realloc(m, ktrlen+1); if (m == NULL) errx(1, "%s", strerror(ENOMEM)); size = ktrlen; @@ -307,7 +307,7 @@ main(int argc, char *argv[]) break; } if (tail) - (void)fflush(stdout); + fflush(stdout); } return 0; } @@ -318,7 +318,7 @@ fread_tail(void *buf, int size, int num) int i; while ((i = fread(buf, size, num, stdin)) == 0 && tail) { - (void)sleep(1); + sleep(1); clearerr(stdin); } return (i); @@ -442,7 +442,7 @@ dumpheader(struct ktr_header *kth) case KTR_PROCDTOR: return; default: - (void)sprintf(unknown, "UNKNOWN(%d)", kth->ktr_type); + sprintf(unknown, "UNKNOWN(%d)", kth->ktr_type); type = unknown; } @@ -455,11 +455,11 @@ dumpheader(struct ktr_header *kth) * negative tid's as 0. */ if (threads) - (void)printf("%6jd %6jd %-8.*s ", (intmax_t)kth->ktr_pid, + printf("%6jd %6jd %-8.*s ", (intmax_t)kth->ktr_pid, kth->ktr_tid > 0 ? (intmax_t)kth->ktr_tid : 0, MAXCOMLEN, kth->ktr_comm); else - (void)printf("%6jd %-8.*s ", (intmax_t)kth->ktr_pid, MAXCOMLEN, + printf("%6jd %-8.*s ", (intmax_t)kth->ktr_pid, MAXCOMLEN, kth->ktr_comm); if (timestamp) { if (timestamp == 3) { @@ -472,10 +472,10 @@ dumpheader(struct ktr_header *kth) timevalsub(&kth->ktr_time, &prevtime); prevtime = temp; } - (void)printf("%jd.%06ld ", (intmax_t)kth->ktr_time.tv_sec, + printf("%jd.%06ld ", (intmax_t)kth->ktr_time.tv_sec, kth->ktr_time.tv_usec); } - (void)printf("%s ", type); + printf("%s ", type); } #include @@ -492,9 +492,9 @@ ktrsyscall(struct ktr_syscall *ktr, u_in if ((flags != 0 && ((flags & SV_ABI_MASK) != SV_ABI_FREEBSD)) || (ktr-
svn commit: r226151 - head/usr.bin/kdump
Author: des Date: Sat Oct 8 12:21:51 2011 New Revision: 226151 URL: http://svn.freebsd.org/changeset/base/226151 Log: Fix casting. Modified: head/usr.bin/kdump/kdump.c head/usr.bin/kdump/mksubr Modified: head/usr.bin/kdump/kdump.c == --- head/usr.bin/kdump/kdump.c Sat Oct 8 12:10:16 2011(r226150) +++ head/usr.bin/kdump/kdump.c Sat Oct 8 12:21:51 2011(r226151) @@ -110,15 +110,16 @@ struct ktr_header ktr_header; #define TIME_FORMAT"%b %e %T %Y" #define eqs(s1, s2)(strcmp((s1), (s2)) == 0) -#define print_number(i,n,c) do { \ - if (decimal)\ - printf("%c%ld", c, (long)*i); \ - else\ - printf("%c%#lx", c, (long)*i); \ - i++;\ - n--;\ - c = ',';\ - } while (0); +#define print_number(i,n,c)\ + do {\ + if (decimal)\ + printf("%c%jd", c, (intmax_t)*i); \ + else\ + printf("%c%#jx", c, (intmax_t)*i); \ + i++;\ + n--;\ + c = ',';\ + } while (0) #if defined(__amd64__) || defined(__i386__) @@ -507,9 +508,9 @@ ktrsyscall(struct ktr_syscall *ktr, u_in (void)printf(",%s", cp); else { if (decimal) - (void)printf(",%ld", (long)*ip); + (void)printf(",%jd", (intmax_t)*ip); else - (void)printf(",%#lx ", (long)*ip); + (void)printf(",%#jx ", (intmax_t)*ip); } c = ','; ip++; @@ -518,7 +519,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_in } case SYS_ptrace: (void)putchar('('); - ptraceopname((int)*ip); + ptraceopname((intmax_t)*ip); c = ','; ip++; narg--; @@ -527,14 +528,14 @@ ktrsyscall(struct ktr_syscall *ktr, u_in case SYS_eaccess: print_number(ip, narg, c); (void)putchar(','); - accessmodename((int)*ip); + accessmodename((intmax_t)*ip); ip++; narg--; break; case SYS_open: print_number(ip, narg, c); (void)putchar(','); - flagsandmodename(ip[0], ip[1], decimal); + flagsandmodename((int)ip[0], (int)ip[1], decimal); ip += 2; narg -= 2; break; @@ -542,7 +543,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_in print_number(ip, narg, c); print_number(ip, narg, c); (void)putchar(','); - wait4optname((int)*ip); + wait4optname((intmax_t)*ip); ip++; narg--; break; @@ -551,14 +552,14 @@ ktrsyscall(struct ktr_syscall *ktr, u_in case SYS_lchmod: print_number(ip, narg, c); (void)putchar(','); - modename((int)*ip); + modename((intmax_t)*ip); ip++; narg--; break; case SYS_mknod: print_number(ip, narg, c); (void)putchar(','); - modename((int)*ip); + modename((intmax_t)*ip); ip++; narg--; break; @@ -566
svn commit: r226150 - head/usr.bin/kdump
Author: des Date: Sat Oct 8 12:10:16 2011 New Revision: 226150 URL: http://svn.freebsd.org/changeset/base/226150 Log: Whitespace. Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c == --- head/usr.bin/kdump/kdump.c Sat Oct 8 12:09:57 2011(r226149) +++ head/usr.bin/kdump/kdump.c Sat Oct 8 12:10:16 2011(r226150) @@ -502,7 +502,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_in switch (ktr->ktr_code) { case SYS_ioctl: { const char *cp; - print_number(ip,narg,c); + print_number(ip, narg, c); if ((cp = ioctlname(*ip)) != NULL) (void)printf(",%s", cp); else { @@ -518,103 +518,103 @@ ktrsyscall(struct ktr_syscall *ktr, u_in } case SYS_ptrace: (void)putchar('('); - ptraceopname ((int)*ip); + ptraceopname((int)*ip); c = ','; ip++; narg--; break; case SYS_access: case SYS_eaccess: - print_number(ip,narg,c); + print_number(ip, narg, c); (void)putchar(','); - accessmodename ((int)*ip); + accessmodename((int)*ip); ip++; narg--; break; case SYS_open: - print_number(ip,narg,c); + print_number(ip, narg, c); (void)putchar(','); flagsandmodename(ip[0], ip[1], decimal); ip += 2; narg -= 2; break; case SYS_wait4: - print_number(ip,narg,c); - print_number(ip,narg,c); + print_number(ip, narg, c); + print_number(ip, narg, c); (void)putchar(','); - wait4optname ((int)*ip); + wait4optname((int)*ip); ip++; narg--; break; case SYS_chmod: case SYS_fchmod: case SYS_lchmod: - print_number(ip,narg,c); + print_number(ip, narg, c); (void)putchar(','); - modename ((int)*ip); + modename((int)*ip); ip++; narg--; break; case SYS_mknod: - print_number(ip,narg,c); + print_number(ip, narg, c); (void)putchar(','); - modename ((int)*ip); + modename((int)*ip); ip++; narg--; break; case SYS_getfsstat: - print_number(ip,narg,c); - print_number(ip,narg,c); + print_number(ip, narg, c); + print_number(ip, narg, c); (void)putchar(','); - getfsstatflagsname ((int)*ip); + getfsstatflagsname((int)*ip); ip++; narg--; break; case SYS_mount: - print_number(ip,narg,c); - print_number(ip,narg,c); + print_number(ip, narg, c); + print_number(ip, narg, c); (void)putchar(','); - mountflagsname ((int)*ip); + mountflagsname((int)*ip); ip++; narg--; break; case SYS_unmount: - print_number(ip,narg,c); +
svn commit: r226148 - head/usr.bin/kdump
Author: des Date: Sat Oct 8 11:51:48 2011 New Revision: 226148 URL: http://svn.freebsd.org/changeset/base/226148 Log: C has had swicth statements for 40 years or so. It's about time we started using them. Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c == --- head/usr.bin/kdump/kdump.c Sat Oct 8 11:39:00 2011(r226147) +++ head/usr.bin/kdump/kdump.c Sat Oct 8 11:51:48 2011(r226148) @@ -499,7 +499,8 @@ ktrsyscall(struct ktr_syscall *ktr, u_in char c = '('; if (fancy && (flags == 0 || (flags & SV_ABI_MASK) == SV_ABI_FREEBSD)) { - if (ktr->ktr_code == SYS_ioctl) { + switch (ktr->ktr_code) { + case SYS_ioctl: { const char *cp; print_number(ip,narg,c); if ((cp = ioctlname(*ip)) != NULL) @@ -513,80 +514,88 @@ ktrsyscall(struct ktr_syscall *ktr, u_in c = ','; ip++; narg--; - } else if (ktr->ktr_code == SYS_ptrace) { + break; + } + case SYS_ptrace: (void)putchar('('); ptraceopname ((int)*ip); c = ','; ip++; narg--; - } else if (ktr->ktr_code == SYS_access || - ktr->ktr_code == SYS_eaccess) { + break; + case SYS_access: + case SYS_eaccess: print_number(ip,narg,c); (void)putchar(','); accessmodename ((int)*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_open) { - int flags; - int mode; + break; + case SYS_open: print_number(ip,narg,c); - flags = *ip; - mode = *++ip; (void)putchar(','); - flagsandmodename (flags, mode, decimal); - ip++; - narg-=2; - } else if (ktr->ktr_code == SYS_wait4) { + flagsandmodename(ip[0], ip[1], decimal); + ip += 2; + narg -= 2; + break; + case SYS_wait4: print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); wait4optname ((int)*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_chmod || - ktr->ktr_code == SYS_fchmod || - ktr->ktr_code == SYS_lchmod) { + break; + case SYS_chmod: + case SYS_fchmod: + case SYS_lchmod: print_number(ip,narg,c); (void)putchar(','); modename ((int)*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_mknod) { + break; + case SYS_mknod: print_number(ip,narg,c); (void)putchar(','); modename ((int)*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_getfsstat) { + break; + case SYS_getfsstat: print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); getfsstatflagsname ((int)*ip); ip++; narg--; - } else if (ktr->ktr_code == SYS_mount) { + break; + case SYS_mount: print_number(ip,narg,c); print_number(ip,
svn commit: r226147 - head/usr.bin/kdump
Author: des Date: Sat Oct 8 11:39:00 2011 New Revision: 226147 URL: http://svn.freebsd.org/changeset/base/226147 Log: Sort and line up. Modified: head/usr.bin/kdump/mksubr Modified: head/usr.bin/kdump/mksubr == --- head/usr.bin/kdump/mksubr Sat Oct 8 10:50:48 2011(r226146) +++ head/usr.bin/kdump/mksubr Sat Oct 8 11:39:00 2011(r226147) @@ -335,44 +335,43 @@ sockoptlevelname(int level, int decimal) _EOF_ -auto_or_type "modename" "S_[A-Z]+[[:space:]]+[0-6]{7}" "sys/stat.h" -auto_or_type "flagsname" "O_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/fcntl.h" -auto_or_type "accessmodename" "[A-Z]_OK[[:space:]]+0?x?[0-9A-Fa-f]+" "sys/unistd.h" -auto_or_type "mmapprotname" "PROT_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/mman.h" -auto_or_type "mmapflagsname" "MAP_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/mman.h" -auto_or_type "wait4optname" "W[A-Z]+[[:space:]]+[0-9]+" "sys/wait.h" -auto_or_type "getfsstatflagsname" "MNT_[A-Z]+[[:space:]]+[1-9][0-9]*" "sys/mount.h" -auto_or_type "mountflagsname" "MNT_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mount.h" -auto_or_type "rebootoptname" "RB_[A-Z]+[[:space:]]+0x[0-9]+" "sys/reboot.h" -auto_or_type "flockname" "LOCK_[A-Z]+[[:space:]]+0x[0-9]+" "sys/fcntl.h" -auto_or_type "thrcreateflagsname" "THR_[A-Z]+[[:space:]]+0x[0-9]+" "sys/thr.h" -auto_or_type "mlockallname" "MCL_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h" -auto_or_type "shmatname" "SHM_[A-Z]+[[:space:]]+[0-9]{6}+" "sys/shm.h" -auto_or_type "rforkname" "RF[A-Z]+[[:space:]]+\([0-9]+<<[0-9]+\)" "sys/unistd.h" -auto_or_type "nfssvcname" "NFSSVC_[A-Z]+[[:space:]]+0x[0-9]+" "nfsserver/nfs.h" - -auto_switch_type "whencename" "SEEK_[A-Z]+[[:space:]]+[0-9]+" "sys/unistd.h" -auto_switch_type "rlimitname" "RLIMIT_[A-Z]+[[:space:]]+[0-9]+" "sys/resource.h" -auto_switch_type "shutdownhowname" "SHUT_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h" -auto_switch_type "prioname" "PRIO_[A-Z]+[[:space:]]+[0-9]" "sys/resource.h" -auto_switch_type "madvisebehavname" "_?MADV_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h" -auto_switch_type "msyncflagsname" "MS_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h" -auto_switch_type "schedpolicyname" "SCHED_[A-Z]+[[:space:]]+[0-9]+" "sched.h" -auto_switch_type "kldunloadfflagsname" "LINKER_UNLOAD_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h" -auto_switch_type "extattrctlname" "EXTATTR_NAMESPACE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/extattr.h" -auto_switch_type "kldsymcmdname" "KLDSYM_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h" -auto_switch_type "sendfileflagsname" "SF_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h" -auto_switch_type "acltypename" "ACL_TYPE_[A-Z4_]+[[:space:]]+0x[0-9]+" "sys/acl.h" -auto_switch_type "sigprocmaskhowname" "SIG_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h" -auto_switch_type "lio_listioname" "LIO_(NO)?WAIT[[:space:]]+[0-9]+" "aio.h" -auto_switch_type "minheritname" "INHERIT_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h" -auto_switch_type "quotactlname" "Q_[A-Z]+[[:space:]]+0x[0-9]+" "ufs/ufs/quota.h" -auto_if_type "sockdomainname" "PF_[[:alnum:]]+[[:space:]]+" "sys/socket.h" -auto_if_type "sockfamilyname" "AF_[[:alnum:]]+[[:space:]]+" "sys/socket.h" -auto_if_type "sockipprotoname" "IPPROTO_[[:alnum:]]+[[:space:]]+" "netinet/in.h" -auto_switch_type "sockoptname" "SO_[A-Z]+[[:space:]]+0x[0-9]+" "sys/socket.h" -auto_switch_type "socktypename" "SOCK_[A-Z]+[[:space:]]+[1-9]+[0-9]*" "sys/socket.h" -auto_switch_type "ptraceopname" "PT_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/ptrace.h" +auto_or_type "accessmodename" "[A-Z]_OK[[:space:]]+0?x?[0-9A-Fa-f]+" "sys/unistd.h" +auto_switch_type "acltypename" "ACL_TYPE_[A-Z4_]+[[:space:]]+0x[0-9]+" "sys/acl.h" +auto_switch_type "extattrctlname" "EXTATTR_NAMESPACE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/extattr.h" +auto_or_type "flagsname" "O_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/fcntl.h" +auto_or_type "flockname" "LOCK_[A-Z]+[[:space:]]+0x[0-9]+" "sys/fcntl.h" +auto_or_type "getfsstatflagsname" "MNT_[A-Z]+[[:space:]]+[1-9][0-9]*" "sys/mount.h" +auto_switch_type "kldsymcmdname" "KLDSYM_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h" +auto_switch_type "kldunloadfflagsname" "LINKER_UNLOAD_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h" +auto_switch_type "lio_listioname" "LIO_(NO)?WAIT[[:space:]]+[0-9]+" "aio.h" +auto_switch_type "madvisebehavname""_?MADV_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h" +auto_switch_type "minheritname""INHERIT_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h" +auto_or_type "mlockallname""MCL_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h" +auto_or_type "mmapflagsname" "MAP_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/mman.h" +auto_or_type "mmapprotname""PROT_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/mman.h" +auto_or_type "modename""S_[A-Z]+[[:space
svn commit: r226145 - head/usr.bin/kdump
Author: des Date: Sat Oct 8 09:57:29 2011 New Revision: 226145 URL: http://svn.freebsd.org/changeset/base/226145 Log: 1) Some of the #defines or enums for which we auto-generate naming functions may be wider than int, so use intmax_t throughout. Also add missing casts in printf() calls. 2) Clean up some of the auto-generated code to improve readability. 3) Auto-generate kdump_subr.h. Note that this requires a semi-ugly hack in the Makefile to make sure it is generated before make(1) tries to build kdump.c, or preprocess it for 'make depend'. MFC after:3 weeks Deleted: head/usr.bin/kdump/kdump_subr.h Modified: head/usr.bin/kdump/Makefile head/usr.bin/kdump/kdump.c head/usr.bin/kdump/mksubr Modified: head/usr.bin/kdump/Makefile == --- head/usr.bin/kdump/Makefile Sat Oct 8 09:15:04 2011(r226144) +++ head/usr.bin/kdump/Makefile Sat Oct 8 09:57:29 2011(r226145) @@ -9,7 +9,7 @@ SFX=32 PROG= kdump SRCS= kdump.c ioctl.c kdump_subr.c subr.c -CFLAGS+= -I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../.. +CFLAGS+= -I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../.. -I. .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" SRCS+= linux_syscalls.c @@ -22,8 +22,17 @@ CLEANFILES= ioctl.c kdump_subr.c linux_s ioctl.c: mkioctls sh ${.CURDIR}/mkioctls ${DESTDIR}/usr/include > ${.TARGET} -kdump_subr.c: mksubr - sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include > ${.TARGET} +kdump_subr.h: mksubr + sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include | \ + sed -n 's/^\([a-z].*)\)$$/void \1;/p' >${.TARGET} + +kdump_subr.c: mksubr kdump_subr.h + sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include >${.TARGET} + +# kdump.c includes kdump_subr.h, which is auto-generated. Add a +# manual dependency to make sure kdump_subr.h is generated before we +# try to either compile or preprocess kdump.c. +${.CURDIR}/kdump.c: kdump_subr.h linux_syscalls.c: /bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh \ Modified: head/usr.bin/kdump/kdump.c == --- head/usr.bin/kdump/kdump.c Sat Oct 8 09:15:04 2011(r226144) +++ head/usr.bin/kdump/kdump.c Sat Oct 8 09:57:29 2011(r226145) @@ -100,7 +100,6 @@ void ktrsockaddr(struct sockaddr *); void ktrstat(struct stat *); void ktrstruct(char *, size_t); void usage(void); -void sockfamilyname(int); const char *ioctlname(u_long); int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata, Modified: head/usr.bin/kdump/mksubr == --- head/usr.bin/kdump/mksubr Sat Oct 8 09:15:04 2011(r226144) +++ head/usr.bin/kdump/mksubr Sat Oct 8 09:57:29 2011(r226145) @@ -69,10 +69,10 @@ auto_or_type () { cat <<_EOF_ /* AUTO */ void -$name (int arg) +$name(intmax_t arg) { - int or = 0; - printf("%#x<", arg); + int or = 0; + printf("%#jx<", (uintmax_t)arg); _EOF_ egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \ $include_dir/$file | \ @@ -80,11 +80,11 @@ _EOF_ if ($i ~ /define/) \ break; \ ++i; \ - printf "\tif(!((arg>0)^((%s)>0)))\n\t\tif_print_or(arg, %s, or);\n", $i, $i }' + printf "\tif (!((arg > 0) ^ ((%s) > 0)))\n\t\tif_print_or(arg, %s, or);\n", $i, $i }' cat <<_EOF_ printf(">"); if (or == 0) - (void)printf("%ld", (long)arg); + (void)printf("%jd", arg); } _EOF_ @@ -103,7 +103,7 @@ auto_switch_type () { cat <<_EOF_ /* AUTO */ void -$name (int arg) +$name(intmax_t arg) { switch (arg) { _EOF_ @@ -116,7 +116,7 @@ _EOF_ printf "\tcase %s:\n\t\t(void)printf(\"%s\");\n\t\tbreak;\n", $i, $i }' cat <<_EOF_ default: /* Should not reach */ - (void)printf("", (long)arg); + (void)printf("", arg); } } @@ -136,7 +136,7 @@ auto_if_type () { cat <<_EOF_ /* AUTO */ void -$name (int arg) +$name(intmax_t arg) { _EOF_ egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \ @@ -147,7 +147,7 @@ _EOF_ printf "if (arg == %s) \n\t\tprintf(\"%s\");\n", $2, $2 }' cat <<_EOF_ else /* Should not reach */ - (void)printf("", (long)arg); + (void)printf("", arg); } _EOF_ @@ -156,6 +156,7 @@ _EOF_ # C start cat <<_EOF_ +#include #include #include #include @@ -207,7 +208,7 @@ cat <<_EOF_ /* MANUAL */ extern char *signames[]; /* from kdump.c */ void -signame (int sig) +signame(int sig) { if (sig > 0 && sig < NSIG) (void)printf("SIG%s",signames[sig]); @@ -217,7 +218,7 @@ signame (int sig) /
svn commit: r226119 - head/share/man/man9
Author: des Date: Fri Oct 7 22:14:18 2011 New Revision: 226119 URL: http://svn.freebsd.org/changeset/base/226119 Log: Mention tdsignal(9). MFC after:1 week Modified: head/share/man/man9/Makefile head/share/man/man9/psignal.9 Modified: head/share/man/man9/Makefile == --- head/share/man/man9/MakefileFri Oct 7 21:23:42 2011 (r226118) +++ head/share/man/man9/MakefileFri Oct 7 22:14:18 2011 (r226119) @@ -972,7 +972,8 @@ MLINKS+=printf.9 log.9 \ MLINKS+=priv.9 priv_check.9 \ priv.9 priv_check_cred.9 MLINKS+=psignal.9 gsignal.9 \ - psignal.9 pgsignal.9 + psignal.9 pgsignal.9 \ + psignal.9 tdsignal.9 MLINKS+=random.9 arc4rand.9 \ random.9 arc4random.9 \ random.9 read_random.9 \ Modified: head/share/man/man9/psignal.9 == --- head/share/man/man9/psignal.9 Fri Oct 7 21:23:42 2011 (r226118) +++ head/share/man/man9/psignal.9 Fri Oct 7 22:14:18 2011 (r226119) @@ -28,14 +28,15 @@ .\"$NetBSD: psignal.9,v 1.1 1996/06/22 22:57:35 pk Exp $ .\" $FreeBSD$ .\" -.Dd June 22, 1996 +.Dd October 8, 2011 .Dt PSIGNAL 9 .Os .Sh NAME .Nm psignal , .Nm pgsignal , -.Nm gsignal -.Nd post signal to a process or process group +.Nm gsignal , +.Nm tdsignal +.Nd post signal to a thread, process, or process group .Sh SYNOPSIS .In sys/types.h .In sys/signalvar.h @@ -45,8 +46,10 @@ .Fn pgsignal "struct pgrp *pgrp" "int signum" "int checkctty" .Ft void .Fn gsignal "int pgid" "int signum" +.Ft void +.Fn tdsignal "struct thread *td" "int signum" .Sh DESCRIPTION -These functions post a signal to one or more processes. +These functions post a signal to a thread or one or more processes. The argument .Fa signum common to all three functions should be in the range @@ -135,6 +138,13 @@ set to zero. If .Fa pgid is zero no action is taken. +.Pp +The +.Fn tdsignal +function posts signal number +.Fa signum +to the thread represented by the thread structure +.Fa td . .Sh SEE ALSO .Xr sigaction 2 , .Xr signal 9 , ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226103 - head/crypto/openssh
Author: des Date: Fri Oct 7 13:10:16 2011 New Revision: 226103 URL: http://svn.freebsd.org/changeset/base/226103 Log: Add a -x option that causes ssh-agent(1) to exit when all clients have disconnected. MFC after:1 week Modified: head/crypto/openssh/ssh-agent.1 head/crypto/openssh/ssh-agent.c Modified: head/crypto/openssh/ssh-agent.1 == --- head/crypto/openssh/ssh-agent.1 Fri Oct 7 12:59:04 2011 (r226102) +++ head/crypto/openssh/ssh-agent.1 Fri Oct 7 13:10:16 2011 (r226103) @@ -44,7 +44,7 @@ .Sh SYNOPSIS .Nm ssh-agent .Op Fl c | s -.Op Fl d +.Op Fl dx .Op Fl a Ar bind_address .Op Fl t Ar life .Op Ar command Op Ar arg ... @@ -103,6 +103,8 @@ A lifetime specified for an identity wit .Xr ssh-add 1 overrides this value. Without this option the default maximum lifetime is forever. +.It Fl x +Exit after the last client has disconnected. .El .Pp If a commandline is given, this is executed as a subprocess of the agent. Modified: head/crypto/openssh/ssh-agent.c == --- head/crypto/openssh/ssh-agent.c Fri Oct 7 12:59:04 2011 (r226102) +++ head/crypto/openssh/ssh-agent.c Fri Oct 7 13:10:16 2011 (r226103) @@ -138,15 +138,34 @@ extern char *__progname; /* Default lifetime (0 == forever) */ static int lifetime = 0; +/* + * Client connection count; incremented in new_socket() and decremented in + * close_socket(). When it reaches 0, ssh-agent will exit. Since it is + * normally initialized to 1, it will never reach 0. However, if the -x + * option is specified, it is initialized to 0 in main(); in that case, + * ssh-agent will exit as soon as it has had at least one client but no + * longer has any. + */ +static int xcount = 1; + static void close_socket(SocketEntry *e) { + int last = 0; + + if (e->type == AUTH_CONNECTION) { + debug("xcount %d -> %d", xcount, xcount - 1); + if (--xcount == 0) + last = 1; + } close(e->fd); e->fd = -1; e->type = AUTH_UNUSED; buffer_free(&e->input); buffer_free(&e->output); buffer_free(&e->request); + if (last) + cleanup_exit(0); } static void @@ -901,6 +920,10 @@ new_socket(sock_type type, int fd) { u_int i, old_alloc, new_alloc; + if (type == AUTH_CONNECTION) { + debug("xcount %d -> %d", xcount, xcount + 1); + ++xcount; + } set_nonblock(fd); if (fd > max_fd) @@ -1121,6 +1144,7 @@ usage(void) fprintf(stderr, " -d Debug mode.\n"); fprintf(stderr, " -a socket Bind agent socket to given name.\n"); fprintf(stderr, " -t life Default identity lifetime (seconds).\n"); + fprintf(stderr, " -x Exit when the last client disconnects.\n"); exit(1); } @@ -1162,7 +1186,7 @@ main(int ac, char **av) __progname = ssh_get_progname(av[0]); seed_rng(); - while ((ch = getopt(ac, av, "cdksa:t:")) != -1) { + while ((ch = getopt(ac, av, "cdksa:t:x")) != -1) { switch (ch) { case 'c': if (s_flag) @@ -1191,6 +1215,9 @@ main(int ac, char **av) usage(); } break; + case 'x': + xcount = 0; + break; default: usage(); } @@ -1350,8 +1377,7 @@ skip: if (ac > 0) parent_alive_interval = 10; idtab_init(); - if (!d_flag) - signal(SIGINT, SIG_IGN); + signal(SIGINT, d_flag ? cleanup_handler : SIG_IGN); signal(SIGPIPE, SIG_IGN); signal(SIGHUP, cleanup_handler); signal(SIGTERM, cleanup_handler); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226101 - head/lib/libpam/modules/pam_ssh
Author: des Date: Fri Oct 7 12:58:33 2011 New Revision: 226101 URL: http://svn.freebsd.org/changeset/base/226101 Log: Load the ECDSA key if there is one. MFC after:1 week Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.8 head/lib/libpam/modules/pam_ssh/pam_ssh.c Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.8 == --- head/lib/libpam/modules/pam_ssh/pam_ssh.8 Fri Oct 7 12:42:03 2011 (r226100) +++ head/lib/libpam/modules/pam_ssh/pam_ssh.8 Fri Oct 7 12:58:33 2011 (r226101) @@ -1,6 +1,6 @@ .\" Copyright (c) 2001 Mark R V Murray -.\" All rights reserved. .\" Copyright (c) 2001-2003 Networks Associates Technology, Inc. +.\" Copyright (c) 2004-2011 Dag-Erling Smørgrav .\" All rights reserved. .\" .\" This software was developed for the FreeBSD Project by ThinkSec AS and @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 26, 2001 +.Dd October 7, 2011 .Dt PAM_SSH 8 .Os .Sh NAME @@ -135,6 +135,8 @@ SSH1 RSA key SSH2 RSA key .It Pa $HOME/.ssh/id_dsa SSH2 DSA key +.It Pa $HOME/.ssh/id_ecdsa +SSH2 ECDSA key .El .Sh SEE ALSO .Xr ssh-agent 1 , Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.c == --- head/lib/libpam/modules/pam_ssh/pam_ssh.c Fri Oct 7 12:42:03 2011 (r226100) +++ head/lib/libpam/modules/pam_ssh/pam_ssh.c Fri Oct 7 12:58:33 2011 (r226101) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2003 Networks Associates Technology, Inc. + * Copyright (c) 2004-2011 Dag-Erling Smørgrav * All rights reserved. * * This software was developed for the FreeBSD Project by ThinkSec AS and @@ -78,6 +79,7 @@ static const char *pam_ssh_keyfiles[] = ".ssh/identity",/* SSH1 RSA key */ ".ssh/id_rsa", /* SSH2 RSA key */ ".ssh/id_dsa", /* SSH2 DSA key */ + ".ssh/id_ecdsa",/* SSH2 ECDSA key */ NULL }; @@ -324,6 +326,7 @@ pam_ssh_add_keys_to_agent(pam_handle_t * /* get a connection to the agent */ if ((ac = ssh_get_authentication_connection()) == NULL) { + openpam_log(PAM_LOG_DEBUG, "failed to connect to the agent"); pam_err = PAM_SYSTEM_ERR; goto end; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r226046 - in head: crypto/openssh crypto/openssh/openbsd-compat secure/usr.sbin/sshd
Author: des Date: Wed Oct 5 22:08:17 2011 New Revision: 226046 URL: http://svn.freebsd.org/changeset/base/226046 Log: Upgrade to OpenSSH 5.9p1. MFC after:3 months Added: head/crypto/openssh/sandbox-darwin.c - copied unchanged from r225834, vendor-crypto/openssh/dist/sandbox-darwin.c head/crypto/openssh/sandbox-null.c - copied unchanged from r225834, vendor-crypto/openssh/dist/sandbox-null.c head/crypto/openssh/sandbox-rlimit.c - copied unchanged from r225834, vendor-crypto/openssh/dist/sandbox-rlimit.c head/crypto/openssh/sandbox-systrace.c - copied unchanged from r225834, vendor-crypto/openssh/dist/sandbox-systrace.c head/crypto/openssh/ssh-sandbox.h - copied unchanged from r225834, vendor-crypto/openssh/dist/ssh-sandbox.h Deleted: head/crypto/openssh/WARNING.RNG head/crypto/openssh/ssh-rand-helper.8 head/crypto/openssh/ssh-rand-helper.c Modified: head/crypto/openssh/ChangeLog head/crypto/openssh/INSTALL head/crypto/openssh/PROTOCOL.mux head/crypto/openssh/README head/crypto/openssh/aclocal.m4 head/crypto/openssh/audit-linux.c (contents, props changed) head/crypto/openssh/auth-rsa.c head/crypto/openssh/auth-skey.c head/crypto/openssh/auth.c head/crypto/openssh/auth.h head/crypto/openssh/auth2-gss.c head/crypto/openssh/auth2-pubkey.c head/crypto/openssh/auth2.c head/crypto/openssh/authfd.c head/crypto/openssh/authfile.c head/crypto/openssh/authfile.h head/crypto/openssh/channels.c head/crypto/openssh/channels.h head/crypto/openssh/clientloop.c head/crypto/openssh/clientloop.h head/crypto/openssh/config.guess head/crypto/openssh/config.h head/crypto/openssh/config.h.in head/crypto/openssh/defines.h head/crypto/openssh/entropy.c head/crypto/openssh/gss-serv.c head/crypto/openssh/key.c head/crypto/openssh/log.c head/crypto/openssh/log.h head/crypto/openssh/mac.c head/crypto/openssh/misc.c head/crypto/openssh/misc.h head/crypto/openssh/moduli.5 head/crypto/openssh/monitor.c head/crypto/openssh/monitor.h head/crypto/openssh/monitor_wrap.c head/crypto/openssh/monitor_wrap.h head/crypto/openssh/mux.c head/crypto/openssh/myproposal.h head/crypto/openssh/openbsd-compat/bsd-cygwin_util.c head/crypto/openssh/openbsd-compat/bsd-cygwin_util.h head/crypto/openssh/openbsd-compat/openssl-compat.c head/crypto/openssh/openbsd-compat/openssl-compat.h head/crypto/openssh/openbsd-compat/port-linux.c head/crypto/openssh/openbsd-compat/port-linux.h head/crypto/openssh/packet.c head/crypto/openssh/packet.h head/crypto/openssh/pathnames.h head/crypto/openssh/readconf.c head/crypto/openssh/readconf.h head/crypto/openssh/servconf.c head/crypto/openssh/servconf.h head/crypto/openssh/serverloop.c head/crypto/openssh/session.c head/crypto/openssh/sftp-server.c head/crypto/openssh/sftp.1 head/crypto/openssh/ssh-add.c head/crypto/openssh/ssh-agent.c head/crypto/openssh/ssh-keygen.1 head/crypto/openssh/ssh-keygen.c head/crypto/openssh/ssh-keyscan.c head/crypto/openssh/ssh-keysign.c head/crypto/openssh/ssh-pkcs11-helper.c head/crypto/openssh/ssh-pkcs11.c head/crypto/openssh/ssh.1 head/crypto/openssh/ssh.c head/crypto/openssh/ssh_config head/crypto/openssh/ssh_config.5 head/crypto/openssh/ssh_namespace.h head/crypto/openssh/sshconnect.c head/crypto/openssh/sshconnect2.c head/crypto/openssh/sshd.8 head/crypto/openssh/sshd.c head/crypto/openssh/sshd_config head/crypto/openssh/sshd_config.5 head/crypto/openssh/version.h head/secure/usr.sbin/sshd/Makefile Directory Properties: head/crypto/openssh/ (props changed) head/crypto/openssh/bufec.c (props changed) head/crypto/openssh/kexecdh.c (props changed) head/crypto/openssh/kexecdhc.c (props changed) head/crypto/openssh/kexecdhs.c (props changed) head/crypto/openssh/openbsd-compat/charclass.h (props changed) head/crypto/openssh/openbsd-compat/sha2.c (props changed) head/crypto/openssh/openbsd-compat/sha2.h (props changed) head/crypto/openssh/openbsd-compat/strptime.c (props changed) head/crypto/openssh/openbsd-compat/timingsafe_bcmp.c (props changed) head/crypto/openssh/ssh-ecdsa.c (props changed) Modified: head/crypto/openssh/ChangeLog == --- head/crypto/openssh/ChangeLog Wed Oct 5 20:00:50 2011 (r226045) +++ head/crypto/openssh/ChangeLog Wed Oct 5 22:08:17 2011 (r226046) @@ -1,13 +1,463 @@ -20110403 +20110906 + - (djm) [README version.h] Correct version + - (djm) [contrib/redhat/openssh.spec] Correct restorcon => restorecon + - (djm) Respin OpenSSH-5.9p1 release + +20110905 - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec] - [contrib/suse/openssh.spec] Prepare for 5.8p2 release. - - (djm) [version.h] crank version - - Release 5.8p2 - -20110329 - - (djm) [entropy.c] closefrom() before running ssh-rand-helper; l
svn commit: r225982 - head/usr.bin/fetch
Author: des Date: Tue Oct 4 15:00:54 2011 New Revision: 225982 URL: http://svn.freebsd.org/changeset/base/225982 Log: latin1 -> utf8 Modified: head/usr.bin/fetch/fetch.1 Modified: head/usr.bin/fetch/fetch.1 == --- head/usr.bin/fetch/fetch.1 Tue Oct 4 14:56:33 2011(r225981) +++ head/usr.bin/fetch/fetch.1 Tue Oct 4 15:00:54 2011(r225982) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2000-2011 Dag-Erling Sm�rgrav +.\" Copyright (c) 2000-2011 Dag-Erling Smørgrav .\" All rights reserved. .\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used .\" by permission. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r225852 - head/crypto/openssh
Author: des Date: Wed Sep 28 20:42:22 2011 New Revision: 225852 URL: http://svn.freebsd.org/changeset/base/225852 Log: Belatedly regenerate after application of the HPN patch. Modified: head/crypto/openssh/ssh_namespace.h Modified: head/crypto/openssh/ssh_namespace.h == --- head/crypto/openssh/ssh_namespace.h Wed Sep 28 19:38:47 2011 (r225851) +++ head/crypto/openssh/ssh_namespace.h Wed Sep 28 20:42:22 2011 (r225852) @@ -7,7 +7,7 @@ * * A list of symbols which need munging is obtained as follows: * - * nm libssh.a | awk '/[0-9a-z] [A-Z] / && $3 !~ /^ssh_/ { print "#define" $3 "\t\tssh_" $3 }' + * nm libssh.a | awk '/[0-9a-z] [A-Z] / && $3 !~ /^ssh_/ { print "#define " $3 "\t\tssh_" $3 }' * * $FreeBSD$ */ @@ -58,6 +58,7 @@ #define buffer_get_int64 ssh_buffer_get_int64 #define buffer_get_int64_ret ssh_buffer_get_int64_ret #define buffer_get_int_ret ssh_buffer_get_int_ret +#define buffer_get_max_len ssh_buffer_get_max_len #define buffer_get_ret ssh_buffer_get_ret #define buffer_get_short ssh_buffer_get_short #define buffer_get_short_ret ssh_buffer_get_short_ret @@ -139,6 +140,7 @@ #define channel_send_window_changesssh_channel_send_window_changes #define channel_set_af ssh_channel_set_af #define channel_set_fdsssh_channel_set_fds +#define channel_set_hpnssh_channel_set_hpn #define channel_setup_local_fwd_listener ssh_channel_setup_local_fwd_listener #define channel_setup_remote_fwd_listener ssh_channel_setup_remote_fwd_listener #define channel_still_open ssh_channel_still_open @@ -438,6 +440,7 @@ #define set_nonblock ssh_set_nonblock #define shadow_pw ssh_shadow_pw #define sigdie ssh_sigdie +#define sock_get_rcvbufssh_sock_get_rcvbuf #define sock_set_v6onlyssh_sock_set_v6only #define ssh1_3des_iv ssh_ssh1_3des_iv #define start_progress_meter ssh_start_progress_meter ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r225817 - head/release
Author: des Date: Tue Sep 27 19:54:58 2011 New Revision: 225817 URL: http://svn.freebsd.org/changeset/base/225817 Log: Don't force active mode FTP. Modified: head/release/Makefile.sysinstall Modified: head/release/Makefile.sysinstall == --- head/release/Makefile.sysinstallTue Sep 27 19:08:27 2011 (r225816) +++ head/release/Makefile.sysinstallTue Sep 27 19:54:58 2011 (r225817) @@ -588,7 +588,7 @@ release rerelease: echo " for i in ${MAKEINDEXPORTS}" >> ${_MK} echo " do" >> ${_MK} echo " cd /usr/ports/\$${i}" >> ${_MK} - echo " env -i HTTP_PROXY=$${HTTP_PROXY} FTP_PROXY=$${FTP_PROXY} FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \\" >> ${_MK} + echo " env -i HTTP_PROXY=$${HTTP_PROXY} FTP_PROXY=$${FTP_PROXY} FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-yes} PATH=$${PATH} \\" >> ${_MK} echo " make all install clean BATCH=yes FORCE_PKG_REGISTER=yes" >> ${_MK} echo " done" >> ${_MK} echo " cd /usr/ports" >> ${_MK} ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r225815 - head/usr.bin/fetch
Author: des Date: Tue Sep 27 19:02:44 2011 New Revision: 225815 URL: http://svn.freebsd.org/changeset/base/225815 Log: Document the fact that passive mode is now the default. Update copyright dates and strip my middle name. Modified: head/usr.bin/fetch/fetch.1 head/usr.bin/fetch/fetch.c Modified: head/usr.bin/fetch/fetch.1 == --- head/usr.bin/fetch/fetch.1 Tue Sep 27 18:57:26 2011(r225814) +++ head/usr.bin/fetch/fetch.1 Tue Sep 27 19:02:44 2011(r225815) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2000-2004 Dag-Erling Co�dan Sm�rgrav +.\" Copyright (c) 2000-2011 Dag-Erling Sm�rgrav .\" All rights reserved. .\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used .\" by permission. @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 2008 +.Dd September 27, 2011 .Dt FETCH 1 .Os .Sh NAME @@ -165,11 +165,13 @@ directory, with name(s) selected as in t .It Fl P .It Fl p Use passive FTP. -This is useful if you are behind a firewall which blocks incoming -connections. -Try this flag if -.Nm -seems to hang when retrieving FTP URLs. +These flags have no effect, since passive FTP is the default, but are +provided for compatibility with earlier versions where active FTP was +the default. +To force active mode, set the +.Ev FTP_PASSIVE_MODE +environment variable to +.Ql NO . .It Fl q Quiet mode. .It Fl R Modified: head/usr.bin/fetch/fetch.c == --- head/usr.bin/fetch/fetch.c Tue Sep 27 18:57:26 2011(r225814) +++ head/usr.bin/fetch/fetch.c Tue Sep 27 19:02:44 2011(r225815) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2000-2011 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r225814 - head/lib/libfetch
Author: des Date: Tue Sep 27 18:57:26 2011 New Revision: 225814 URL: http://svn.freebsd.org/changeset/base/225814 Log: Update copyright dates and strip my middle name. Modified: head/lib/libfetch/common.c head/lib/libfetch/common.h head/lib/libfetch/fetch.3 head/lib/libfetch/fetch.c head/lib/libfetch/fetch.h head/lib/libfetch/file.c head/lib/libfetch/ftp.c head/lib/libfetch/http.c Modified: head/lib/libfetch/common.c == --- head/lib/libfetch/common.c Tue Sep 27 18:53:35 2011(r225813) +++ head/lib/libfetch/common.c Tue Sep 27 18:57:26 2011(r225814) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Co�dan Sm�rgrav + * Copyright (c) 1998-2011 Dag-Erling Sm�rgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libfetch/common.h == --- head/lib/libfetch/common.h Tue Sep 27 18:53:35 2011(r225813) +++ head/lib/libfetch/common.h Tue Sep 27 18:57:26 2011(r225814) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Co�dan Sm�rgrav + * Copyright (c) 1998-2011 Dag-Erling Sm�rgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libfetch/fetch.3 == --- head/lib/libfetch/fetch.3 Tue Sep 27 18:53:35 2011(r225813) +++ head/lib/libfetch/fetch.3 Tue Sep 27 18:57:26 2011(r225814) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 1998-2004 Dag-Erling Co�dan Sm�rgrav +.\" Copyright (c) 1998-2011 Dag-Erling Sm�rgrav .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: head/lib/libfetch/fetch.c == --- head/lib/libfetch/fetch.c Tue Sep 27 18:53:35 2011(r225813) +++ head/lib/libfetch/fetch.c Tue Sep 27 18:57:26 2011(r225814) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Co�dan Sm�rgrav + * Copyright (c) 1998-2004 Dag-Erling Sm�rgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libfetch/fetch.h == --- head/lib/libfetch/fetch.h Tue Sep 27 18:53:35 2011(r225813) +++ head/lib/libfetch/fetch.h Tue Sep 27 18:57:26 2011(r225814) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Co�dan Sm�rgrav + * Copyright (c) 1998-2004 Dag-Erling Sm�rgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libfetch/file.c == --- head/lib/libfetch/file.cTue Sep 27 18:53:35 2011(r225813) +++ head/lib/libfetch/file.cTue Sep 27 18:57:26 2011(r225814) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Co�dan Sm�rgrav + * Copyright (c) 1998-2011 Dag-Erling Sm�rgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libfetch/ftp.c == --- head/lib/libfetch/ftp.c Tue Sep 27 18:53:35 2011(r225813) +++ head/lib/libfetch/ftp.c Tue Sep 27 18:57:26 2011(r225814) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998-2004 Dag-Erling Co�dan Sm�rgrav + * Copyright (c) 1998-2011 Dag-Erling Sm�rgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libfetch/http.c == --- head/lib/libfetch/http.cTue Sep 27 18:53:35 2011(r225813) +++ head/lib/libfetch/http.cTue Sep 27 18:57:26 2011(r225814) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2004 Dag-Erling Co�dan Sm�rgrav + * Copyright (c) 2000-2011 Dag-Erling Sm�rgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r225813 - head/lib/libfetch
Author: des Date: Tue Sep 27 18:53:35 2011 New Revision: 225813 URL: http://svn.freebsd.org/changeset/base/225813 Log: Bump date. Modified: head/lib/libfetch/fetch.3 Modified: head/lib/libfetch/fetch.3 == --- head/lib/libfetch/fetch.3 Tue Sep 27 18:42:09 2011(r225812) +++ head/lib/libfetch/fetch.3 Tue Sep 27 18:53:35 2011(r225813) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 26, 2010 +.Dd September 27, 2011 .Dt FETCH 3 .Os .Sh NAME ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r225812 - head/lib/libfetch
Author: des Date: Tue Sep 27 18:42:09 2011 New Revision: 225812 URL: http://svn.freebsd.org/changeset/base/225812 Log: Think first, commit second. 1. Allow the caller to select active mode. 2. Fix the envar logic so it *always* overrides the caller's flags. 3. Document the change from active to passive. Modified: head/lib/libfetch/fetch.3 head/lib/libfetch/ftp.c Modified: head/lib/libfetch/fetch.3 == --- head/lib/libfetch/fetch.3 Tue Sep 27 18:40:13 2011(r225811) +++ head/lib/libfetch/fetch.3 Tue Sep 27 18:42:09 2011(r225812) @@ -318,9 +318,19 @@ and implement the FTP protocol as described in RFC959. .Pp If the +.Ql P +(not passive) flag is specified, an active (rather than passive) +connection will be attempted. +.Pp +The .Ql p -(passive) flag is specified, a passive (rather than active) connection -will be attempted. +flag is supported for compatibility with earlier versions where active +connections were the default. +It has precedence over the +.Ql P +flag, so if both are specified, +.Nm +will use a passive connection. .Pp If the .Ql l @@ -475,9 +485,11 @@ connections will be bound. .It Ev FTP_LOGIN Default FTP login if none was provided in the URL. .It Ev FTP_PASSIVE_MODE -If set to anything but +If set to .Ql no , -forces the FTP code to use passive mode. +forces the FTP code to use active mode. +If set to any other value, forces passive mode even if the application +requested active mode. .It Ev FTP_PASSWORD Default FTP password if the remote server requests one and none was provided in the URL. Modified: head/lib/libfetch/ftp.c == --- head/lib/libfetch/ftp.c Tue Sep 27 18:40:13 2011(r225811) +++ head/lib/libfetch/ftp.c Tue Sep 27 18:42:09 2011(r225812) @@ -633,13 +633,12 @@ ftp_transfer(conn_t *conn, const char *o /* check flags */ low = CHECK_FLAG('l'); - pasv = CHECK_FLAG('p'); + pasv = CHECK_FLAG('p') || !CHECK_FLAG('P'); verbose = CHECK_FLAG('v'); /* passive mode */ - if (!pasv) - pasv = ((s = getenv("FTP_PASSIVE_MODE")) == NULL || - strncasecmp(s, "no", 2) == 0); + if ((s = getenv("FTP_PASSIVE_MODE")) != NULL) + pasv = (strncasecmp(s, "no", 2) != 0); /* isolate filename */ filename = ftp_filename(file, &filenamelen, &type); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r225810 - head/lib/libfetch
Author: des Date: Tue Sep 27 18:23:58 2011 New Revision: 225810 URL: http://svn.freebsd.org/changeset/base/225810 Log: Long overdue: make passive mode the default for ftp. Modified: head/lib/libfetch/ftp.c Modified: head/lib/libfetch/ftp.c == --- head/lib/libfetch/ftp.c Tue Sep 27 18:14:04 2011(r225809) +++ head/lib/libfetch/ftp.c Tue Sep 27 18:23:58 2011(r225810) @@ -638,8 +638,8 @@ ftp_transfer(conn_t *conn, const char *o /* passive mode */ if (!pasv) - pasv = ((s = getenv("FTP_PASSIVE_MODE")) != NULL && - strncasecmp(s, "no", 2) != 0); + pasv = ((s = getenv("FTP_PASSIVE_MODE")) == NULL || + strncasecmp(s, "no", 2) == 0); /* isolate filename */ filename = ftp_filename(file, &filenamelen, &type); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r225805 - head/usr.bin/fetch
Author: des Date: Tue Sep 27 17:11:31 2011 New Revision: 225805 URL: http://svn.freebsd.org/changeset/base/225805 Log: Use fseeko() instead of fseek(). The rest of the code is off_t-aware, but the use of fseek() means fetch(1) can't correctly resume a transfer that was interrupted past the 2 GB mark. Pointed out by: ache@ MFC after:3 weeks Modified: head/usr.bin/fetch/fetch.c Modified: head/usr.bin/fetch/fetch.c == --- head/usr.bin/fetch/fetch.c Tue Sep 27 17:11:09 2011(r225804) +++ head/usr.bin/fetch/fetch.c Tue Sep 27 17:11:31 2011(r225805) @@ -561,8 +561,8 @@ fetch(char *URL, const char *path) } } /* seek to where we left off */ - if (of != NULL && fseek(of, url->offset, SEEK_SET) != 0) { - warn("%s: fseek()", path); + if (of != NULL && fseeko(of, url->offset, SEEK_SET) != 0) { + warn("%s: fseeko()", path); fclose(of); of = NULL; /* picked up again later */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r225800 - head/usr.bin/fetch
Author: des Date: Tue Sep 27 15:57:13 2011 New Revision: 225800 URL: http://svn.freebsd.org/changeset/base/225800 Log: Followup to r225599: the fseek() was a no-op since the file was opened in append mode. Open it in read-write mode instead. Also move the fseek up one level to cover the (unlikely but not impossible) case where the server accepts ranges but does not send a Content-Size header. PR: bin/117277 MFC after:3 weeks Modified: head/usr.bin/fetch/fetch.c Modified: head/usr.bin/fetch/fetch.c == --- head/usr.bin/fetch/fetch.c Tue Sep 27 15:08:59 2011(r225799) +++ head/usr.bin/fetch/fetch.c Tue Sep 27 15:57:13 2011(r225800) @@ -540,7 +540,7 @@ fetch(char *URL, const char *path) goto failure; } /* we got it, open local file */ - if ((of = fopen(path, "a")) == NULL) { + if ((of = fopen(path, "r+")) == NULL) { warn("%s: fopen()", path); goto failure; } @@ -559,13 +559,13 @@ fetch(char *URL, const char *path) sb = nsb; /* picked up again later */ } - /* seek to where we left off */ - if (of != NULL && fseek(of, url->offset, SEEK_SET) != 0) { - warn("%s: fseek()", path); - fclose(of); - of = NULL; - /* picked up again later */ - } + } + /* seek to where we left off */ + if (of != NULL && fseek(of, url->offset, SEEK_SET) != 0) { + warn("%s: fseek()", path); + fclose(of); + of = NULL; + /* picked up again later */ } } else if (m_flag && sb.st_size != -1) { /* mirror mode, local file exists */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r225614 - head/crypto/openssh
Author: des Date: Fri Sep 16 11:14:10 2011 New Revision: 225614 URL: http://svn.freebsd.org/changeset/base/225614 Log: Remove the svn:keywords property and restore the historical $FreeBSD$ tag. Approved by: re (kib) MFC after:3 weeks Modified: head/crypto/openssh/auth-pam.c (contents, props changed) Modified: head/crypto/openssh/auth-pam.c == --- head/crypto/openssh/auth-pam.c Fri Sep 16 09:38:01 2011 (r225613) +++ head/crypto/openssh/auth-pam.c Fri Sep 16 11:14:10 2011 (r225614) @@ -45,7 +45,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* Based on $FreeBSD$ */ +/* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */ #include "includes.h" #include ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r225599 - head/usr.bin/fetch
Author: des Date: Thu Sep 15 22:50:31 2011 New Revision: 225599 URL: http://svn.freebsd.org/changeset/base/225599 Log: When resuming an HTTP download, we failed to verify that the range returned by the server matched what we requested, and blindly appended what we received to what we already had. This could go two ways: if the delivered offset was higher than expected, the local file would contain duplicate data, while if it was lower than expected, there would be data missing from the middle of the file. Furthermore, if the transfer was interrupted again, each subsequent attempt would compound the error. Fix the first problem by restarting the transfer from scratch if there is a gap, and the second by explicitly seeking to the correct location in the local file so as to overwrite any duplicated data. PR: bin/117277 Approved by: re (kib) MFC after:3 weeks Modified: head/usr.bin/fetch/fetch.c Modified: head/usr.bin/fetch/fetch.c == --- head/usr.bin/fetch/fetch.c Thu Sep 15 22:14:35 2011(r225598) +++ head/usr.bin/fetch/fetch.c Thu Sep 15 22:50:31 2011(r225599) @@ -522,6 +522,12 @@ fetch(char *URL, const char *path) "does not match remote", path); goto failure_keep; } + } else if (url->offset > sb.st_size) { + /* gap between what we asked for and what we got */ + warnx("%s: gap in resume mode", URL); + fclose(of); + of = NULL; + /* picked up again later */ } else if (us.size != -1) { if (us.size == sb.st_size) /* nothing to do */ @@ -551,6 +557,14 @@ fetch(char *URL, const char *path) fclose(of); of = NULL; sb = nsb; + /* picked up again later */ + } + /* seek to where we left off */ + if (of != NULL && fseek(of, url->offset, SEEK_SET) != 0) { + warn("%s: fseek()", path); + fclose(of); + of = NULL; + /* picked up again later */ } } } else if (m_flag && sb.st_size != -1) { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r225359 - head/sbin/fsck_ffs
Author: des Date: Sat Sep 3 03:12:33 2011 New Revision: 225359 URL: http://svn.freebsd.org/changeset/base/225359 Log: Forgot this nit in r221107. Approved by: re (kib) Modified: head/sbin/fsck_ffs/main.c Modified: head/sbin/fsck_ffs/main.c == --- head/sbin/fsck_ffs/main.c Sat Sep 3 01:45:37 2011(r225358) +++ head/sbin/fsck_ffs/main.c Sat Sep 3 03:12:33 2011(r225359) @@ -636,7 +636,7 @@ static void usage(void) { (void) fprintf(stderr, - "usage: %s [-BEFprfny] [-b block] [-c level] [-m mode] " + "usage: %s [-BEFfnpry] [-b block] [-c level] [-m mode] " "filesystem ...\n", getprogname()); exit(1); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r221830 - head/lib/libfetch
Author: des Date: Fri May 13 07:21:41 2011 New Revision: 221830 URL: http://svn.freebsd.org/changeset/base/221830 Log: Mark all socket and file descriptors close-on-exec. PR: bin/151866 MFC after:3 weeks Modified: head/lib/libfetch/common.c head/lib/libfetch/file.c Modified: head/lib/libfetch/common.c == --- head/lib/libfetch/common.c Fri May 13 05:27:58 2011(r221829) +++ head/lib/libfetch/common.c Fri May 13 07:21:41 2011(r221830) @@ -213,6 +213,7 @@ fetch_reopen(int sd) /* allocate and fill connection structure */ if ((conn = calloc(1, sizeof(*conn))) == NULL) return (NULL); + fcntl(sd, F_SETFD, FD_CLOEXEC); conn->sd = sd; ++conn->ref; return (conn); Modified: head/lib/libfetch/file.c == --- head/lib/libfetch/file.cFri May 13 05:27:58 2011(r221829) +++ head/lib/libfetch/file.cFri May 13 07:21:41 2011(r221830) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -57,6 +58,7 @@ fetchXGetFile(struct url *u, struct url_ fetch_syserr(); } + fcntl(fileno(f), F_SETFD, FD_CLOEXEC); return (f); } @@ -84,6 +86,7 @@ fetchPutFile(struct url *u, const char * fetch_syserr(); } + fcntl(fileno(f), F_SETFD, FD_CLOEXEC); return (f); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r221823 - head/lib/libfetch
Author: des Date: Thu May 12 21:30:46 2011 New Revision: 221823 URL: http://svn.freebsd.org/changeset/base/221823 Log: Builds cleanly at the default WARNS level (WARNS=6). Modified: head/lib/libfetch/Makefile Modified: head/lib/libfetch/Makefile == --- head/lib/libfetch/Makefile Thu May 12 21:26:42 2011(r221822) +++ head/lib/libfetch/Makefile Thu May 12 21:30:46 2011(r221823) @@ -26,7 +26,6 @@ LDADD=-lmd CFLAGS+= -DFTP_COMBINE_CWDS CSTD?= c99 -WARNS?=4 SHLIB_MAJOR=6 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r221822 - head/lib/libfetch
Author: des Date: Thu May 12 21:26:42 2011 New Revision: 221822 URL: http://svn.freebsd.org/changeset/base/221822 Log: Increase WARNS to 4. Modified: head/lib/libfetch/Makefile head/lib/libfetch/ftp.c head/lib/libfetch/http.c Modified: head/lib/libfetch/Makefile == --- head/lib/libfetch/Makefile Thu May 12 21:18:55 2011(r221821) +++ head/lib/libfetch/Makefile Thu May 12 21:26:42 2011(r221822) @@ -26,7 +26,7 @@ LDADD=-lmd CFLAGS+= -DFTP_COMBINE_CWDS CSTD?= c99 -WARNS?=3 +WARNS?=4 SHLIB_MAJOR=6 Modified: head/lib/libfetch/ftp.c == --- head/lib/libfetch/ftp.c Thu May 12 21:18:55 2011(r221821) +++ head/lib/libfetch/ftp.c Thu May 12 21:26:42 2011(r221822) @@ -127,7 +127,7 @@ unmappedaddr(struct sockaddr_in6 *sin6) !IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) return; sin4 = (struct sockaddr_in *)sin6; - addr = *(u_int32_t *)&sin6->sin6_addr.s6_addr[12]; + addr = *(u_int32_t *)(uintptr_t)&sin6->sin6_addr.s6_addr[12]; port = sin6->sin6_port; memset(sin4, 0, sizeof(struct sockaddr_in)); sin4->sin_addr.s_addr = addr; Modified: head/lib/libfetch/http.c == --- head/lib/libfetch/http.cThu May 12 21:18:55 2011(r221821) +++ head/lib/libfetch/http.cThu May 12 21:26:42 2011(r221822) @@ -1087,7 +1087,7 @@ out: * Digest response: the code to compute the digest is taken from the * sample implementation in RFC2616 */ -#define IN +#define IN const #define OUT #define HASHLEN 16 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r221821 - head/lib/libfetch
Author: des Date: Thu May 12 21:18:55 2011 New Revision: 221821 URL: http://svn.freebsd.org/changeset/base/221821 Log: Mechanical whitespace cleanup. Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c == --- head/lib/libfetch/http.cThu May 12 21:12:24 2011(r221820) +++ head/lib/libfetch/http.cThu May 12 21:18:55 2011(r221821) @@ -454,7 +454,7 @@ http_match(const char *str, const char * * Get the next header and return the appropriate symbolic code. We * need to read one line ahead for checking for a continuation line * belonging to the current header (continuation lines start with - * white space). + * white space). * * We get called with a fresh line already in the conn buffer, either * from the previous http_next_header() invocation, or, the first @@ -462,7 +462,7 @@ http_match(const char *str, const char * * * This stops when we encounter an empty line (we dont read beyond the header * area). - * + * * Note that the "headerbuf" is just a place to return the result. Its * contents are not used for the next call. This means that no cleanup * is needed when ie doing another connection, just call the cleanup when @@ -487,7 +487,7 @@ init_http_headerbuf(http_headerbuf_t *bu buf->buflen = 0; } -static void +static void clean_http_headerbuf(http_headerbuf_t *buf) { if (buf->buf) @@ -496,10 +496,10 @@ clean_http_headerbuf(http_headerbuf_t *b } /* Remove whitespace at the end of the buffer */ -static void +static void http_conn_trimright(conn_t *conn) { - while (conn->buflen && + while (conn->buflen && isspace((unsigned char)conn->buf[conn->buflen - 1])) conn->buflen--; conn->buf[conn->buflen] = '\0'; @@ -510,9 +510,9 @@ http_next_header(conn_t *conn, http_head { unsigned int i, len; - /* + /* * Have to do the stripping here because of the first line. So -* it's done twice for the subsequent lines. No big deal +* it's done twice for the subsequent lines. No big deal */ http_conn_trimright(conn); if (conn->buflen == 0) @@ -527,19 +527,19 @@ http_next_header(conn_t *conn, http_head strcpy(hbuf->buf, conn->buf); hbuf->buflen = conn->buflen; - /* + /* * Fetch possible continuation lines. Stop at 1st non-continuation -* and leave it in the conn buffer - */ +* and leave it in the conn buffer +*/ for (i = 0; i < HTTP_MAX_CONT_LINES; i++) { if (fetch_getln(conn) == -1) return (hdr_syserror); - /* + /* * Note: we carry on the idea from the previous version * that a pure whitespace line is equivalent to an empty * one (so it's not continuation and will be handled when -* we are called next) +* we are called next) */ http_conn_trimright(conn); if (conn->buf[0] != ' ' && conn->buf[0] != "\t"[0]) @@ -555,7 +555,7 @@ http_next_header(conn_t *conn, http_head } strcpy(hbuf->buf + hbuf->buflen, conn->buf); hbuf->buflen += conn->buflen; - } + } /* * We could check for malformed headers but we don't really care. @@ -574,12 +574,12 @@ http_next_header(conn_t *conn, http_head * [Proxy-]Authenticate header parsing */ -/* - * Read doublequote-delimited string into output buffer obuf (allocated +/* + * Read doublequote-delimited string into output buffer obuf (allocated * by caller, whose responsibility it is to ensure that it's big enough) * cp points to the first char after the initial '"' - * Handles \ quoting - * Returns pointer to the first char after the terminating double quote, or + * Handles \ quoting + * Returns pointer to the first char after the terminating double quote, or * NULL for error. */ static const char * @@ -620,7 +620,7 @@ typedef struct { int nc; /* Nonce count */ } http_auth_challenge_t; -static void +static void init_http_auth_challenge(http_auth_challenge_t *b) { b->scheme = HTTPAS_UNKNOWN; @@ -628,18 +628,18 @@ init_http_auth_challenge(http_auth_chall b->stale = b->nc = 0; } -static void +static void clean_http_auth_challenge(http_auth_challenge_t *b) { - if (b->realm) + if (b->realm) free(b->realm); - if (b->qop) + if (b->qop) free(b->qop); - if (b->nonce) + if (b->nonce) free(b->nonce); - if (b->opaque) + if (b->opaque) free(b->opaque); - if (b->algo) + if (b->algo) free(b->algo); init_http_auth_challenge(b); } @@ -652,7 +652,7 @@ type
svn commit: r221820 - head/lib/libfetch
Author: des Date: Thu May 12 21:12:24 2011 New Revision: 221820 URL: http://svn.freebsd.org/changeset/base/221820 Log: Increase WARNS to 3. Modified: head/lib/libfetch/Makefile head/lib/libfetch/http.c Modified: head/lib/libfetch/Makefile == --- head/lib/libfetch/Makefile Thu May 12 19:10:00 2011(r221819) +++ head/lib/libfetch/Makefile Thu May 12 21:12:24 2011(r221820) @@ -26,7 +26,7 @@ LDADD=-lmd CFLAGS+= -DFTP_COMBINE_CWDS CSTD?= c99 -WARNS?=2 +WARNS?=3 SHLIB_MAJOR=6 Modified: head/lib/libfetch/http.c == --- head/lib/libfetch/http.cThu May 12 19:10:00 2011(r221819) +++ head/lib/libfetch/http.cThu May 12 21:12:24 2011(r221820) @@ -508,7 +508,7 @@ http_conn_trimright(conn_t *conn) static hdr_t http_next_header(conn_t *conn, http_headerbuf_t *hbuf, const char **p) { - int i, len; + unsigned int i, len; /* * Have to do the stripping here because of the first line. So ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r221487 - head/crypto/openssh
Author: des Date: Thu May 5 08:08:18 2011 New Revision: 221487 URL: http://svn.freebsd.org/changeset/base/221487 Log: Merge two upstream patches from vendor branch. No functional changes. Modified: head/crypto/openssh/ChangeLog head/crypto/openssh/defines.h Directory Properties: head/crypto/openssh/ (props changed) Modified: head/crypto/openssh/ChangeLog == --- head/crypto/openssh/ChangeLog Thu May 5 08:04:31 2011 (r221486) +++ head/crypto/openssh/ChangeLog Thu May 5 08:08:18 2011 (r221487) @@ -1,6 +1,7 @@ 20110403 - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec] [contrib/suse/openssh.spec] Prepare for 5.8p2 release. + - (djm) [version.h] crank version - Release 5.8p2 20110329 Modified: head/crypto/openssh/defines.h == --- head/crypto/openssh/defines.h Thu May 5 08:04:31 2011 (r221486) +++ head/crypto/openssh/defines.h Thu May 5 08:08:18 2011 (r221487) @@ -25,7 +25,7 @@ #ifndef _DEFINES_H #define _DEFINES_H -/* $Id: defines.h,v 1.164 2011/01/17 10:15:31 dtucker Exp $ */ +/* $Id: defines.h,v 1.165 2011/05/05 01:19:15 djm Exp $ */ /* Constants */ @@ -45,6 +45,7 @@ enum /* * Definitions for IP type of service (ip_tos) */ +#include #include #ifndef IPTOS_LOWDELAY # define IPTOS_LOWDELAY 0x10 @@ -57,7 +58,6 @@ enum /* * Definitions for DiffServ Codepoints as per RFC2474 */ -#include #ifndef IPTOS_DSCP_AF11 # define IPTOS_DSCP_AF11 0x28 # define IPTOS_DSCP_AF12 0x30 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r221420 - in head: crypto/openssh crypto/openssh/openbsd-compat etc/rc.d secure/lib/libssh secure/usr.sbin/sshd
Author: des Date: Wed May 4 07:34:44 2011 New Revision: 221420 URL: http://svn.freebsd.org/changeset/base/221420 Log: Upgrade to OpenSSH 5.8p2. Added: head/crypto/openssh/audit-linux.c - copied unchanged from r221394, vendor-crypto/openssh/dist/audit-linux.c head/crypto/openssh/bufec.c - copied unchanged from r221394, vendor-crypto/openssh/dist/bufec.c head/crypto/openssh/kexecdh.c - copied unchanged from r221394, vendor-crypto/openssh/dist/kexecdh.c head/crypto/openssh/kexecdhc.c - copied unchanged from r221394, vendor-crypto/openssh/dist/kexecdhc.c head/crypto/openssh/kexecdhs.c - copied unchanged from r221394, vendor-crypto/openssh/dist/kexecdhs.c head/crypto/openssh/openbsd-compat/charclass.h - copied unchanged from r221394, vendor-crypto/openssh/dist/openbsd-compat/charclass.h head/crypto/openssh/openbsd-compat/timingsafe_bcmp.c - copied unchanged from r221394, vendor-crypto/openssh/dist/openbsd-compat/timingsafe_bcmp.c head/crypto/openssh/ssh-ecdsa.c - copied unchanged from r221394, vendor-crypto/openssh/dist/ssh-ecdsa.c Modified: head/crypto/openssh/ChangeLog head/crypto/openssh/LICENCE head/crypto/openssh/PROTOCOL head/crypto/openssh/PROTOCOL.agent head/crypto/openssh/PROTOCOL.certkeys head/crypto/openssh/PROTOCOL.mux head/crypto/openssh/README head/crypto/openssh/atomicio.c head/crypto/openssh/atomicio.h head/crypto/openssh/audit-bsm.c head/crypto/openssh/audit.c head/crypto/openssh/audit.h head/crypto/openssh/auth-options.c head/crypto/openssh/auth-rsa.c head/crypto/openssh/auth.c head/crypto/openssh/auth1.c head/crypto/openssh/auth2-jpake.c head/crypto/openssh/auth2-pubkey.c head/crypto/openssh/auth2.c head/crypto/openssh/authfd.c head/crypto/openssh/authfile.c head/crypto/openssh/bufaux.c head/crypto/openssh/buffer.h head/crypto/openssh/canohost.c head/crypto/openssh/channels.c head/crypto/openssh/cipher-3des1.c head/crypto/openssh/cipher-acss.c head/crypto/openssh/cipher-aes.c head/crypto/openssh/cipher-bf1.c head/crypto/openssh/cipher-ctr.c head/crypto/openssh/clientloop.c head/crypto/openssh/compress.c head/crypto/openssh/config.h head/crypto/openssh/config.h.in head/crypto/openssh/defines.h head/crypto/openssh/dns.c head/crypto/openssh/entropy.c head/crypto/openssh/hostfile.c head/crypto/openssh/hostfile.h head/crypto/openssh/includes.h head/crypto/openssh/jpake.c head/crypto/openssh/kex.c head/crypto/openssh/kex.h head/crypto/openssh/kexdhc.c head/crypto/openssh/kexdhs.c head/crypto/openssh/kexgexc.c head/crypto/openssh/kexgexs.c head/crypto/openssh/key.c head/crypto/openssh/key.h head/crypto/openssh/loginrec.c head/crypto/openssh/loginrec.h head/crypto/openssh/misc.c head/crypto/openssh/misc.h head/crypto/openssh/moduli.c head/crypto/openssh/monitor.c head/crypto/openssh/monitor_wrap.c head/crypto/openssh/mux.c head/crypto/openssh/myproposal.h head/crypto/openssh/openbsd-compat/bindresvport.c head/crypto/openssh/openbsd-compat/bsd-misc.c head/crypto/openssh/openbsd-compat/bsd-misc.h head/crypto/openssh/openbsd-compat/glob.c head/crypto/openssh/openbsd-compat/glob.h head/crypto/openssh/openbsd-compat/openbsd-compat.h head/crypto/openssh/openbsd-compat/openssl-compat.c head/crypto/openssh/openbsd-compat/openssl-compat.h head/crypto/openssh/openbsd-compat/port-linux.c head/crypto/openssh/openbsd-compat/port-linux.h head/crypto/openssh/openbsd-compat/port-solaris.c head/crypto/openssh/openbsd-compat/port-solaris.h head/crypto/openssh/packet.c head/crypto/openssh/packet.h head/crypto/openssh/pathnames.h head/crypto/openssh/platform.c head/crypto/openssh/platform.h head/crypto/openssh/readconf.c head/crypto/openssh/readconf.h head/crypto/openssh/readpass.c head/crypto/openssh/schnorr.c head/crypto/openssh/scp.1 head/crypto/openssh/scp.c head/crypto/openssh/servconf.c head/crypto/openssh/servconf.h head/crypto/openssh/session.c head/crypto/openssh/sftp-client.c head/crypto/openssh/sftp-client.h head/crypto/openssh/sftp-server.c head/crypto/openssh/sftp.1 head/crypto/openssh/sftp.c head/crypto/openssh/ssh-add.1 head/crypto/openssh/ssh-add.c head/crypto/openssh/ssh-agent.1 head/crypto/openssh/ssh-agent.c head/crypto/openssh/ssh-dss.c head/crypto/openssh/ssh-keygen.1 head/crypto/openssh/ssh-keygen.c head/crypto/openssh/ssh-keyscan.1 head/crypto/openssh/ssh-keyscan.c head/crypto/openssh/ssh-keysign.8 head/crypto/openssh/ssh-keysign.c head/crypto/openssh/ssh-rsa.c head/crypto/openssh/ssh.1 head/crypto/openssh/ssh.c head/crypto/openssh/ssh2.h head/crypto/openssh/ssh_config head/crypto/openssh/ssh_config.5 head/crypto/openssh/ssh_namespace.h head/crypto/openssh/sshconnect.c head/crypto/openssh/sshconnect.h head/crypto/openssh/sshconnect2.c head/crypto/openssh/sshd.8 head/crypto/openssh/sshd.c head/crypto/openssh/sshd_c
svn commit: r221233 - head/sbin/fsck_ffs
Author: des Date: Fri Apr 29 23:00:23 2011 New Revision: 221233 URL: http://svn.freebsd.org/changeset/base/221233 Log: Add an -E option to mirror newfs's. The idea is that if you have a system that was built before ffs grew support for TRIM, your filesystem will have plenty of free blocks that the flash chip doesn't know are free, so it can't take advantage of them for wear leveling. Once you've upgraded your kernel, you enable TRIM on the filesystem (tunefs -t enable), then run fsck_ffs -E on it before mounting it. I tested this patch by half-filling an mdconfig'ed filesystem image, running fsck_ffs -E on it, then verifying that the contents were not damaged by comparing them to a pristine copy using rsync's checksum functionality. There is no reliable way to test it on real hardware. Many thanks to mckusick@, who provided the tricky parts of this patch and reviewed the final version. Reviewed by: mckusick@ MFC after:3 weeks Modified: head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/fsck_ffs.8 head/sbin/fsck_ffs/fsutil.c head/sbin/fsck_ffs/main.c head/sbin/fsck_ffs/pass5.c Modified: head/sbin/fsck_ffs/fsck.h == --- head/sbin/fsck_ffs/fsck.h Fri Apr 29 22:40:11 2011(r221232) +++ head/sbin/fsck_ffs/fsck.h Fri Apr 29 23:00:23 2011(r221233) @@ -274,6 +274,7 @@ charyflag; /* assume a yes response * intbkgrdflag; /* use a snapshot to run on an active system */ intbflag; /* location of alternate super block */ intdebug; /* output debugging info */ +intEflag; /* zero out empty data blocks */ intinoopt; /* trim out unused inodes */ char ckclean;/* only do work if not cleanly unmounted */ intcvtlevel; /* convert to newer file system format */ @@ -337,6 +338,7 @@ char *blockcheck(char *name); intblread(int fd, char *buf, ufs2_daddr_t blk, long size); void bufinit(void); void blwrite(int fd, char *buf, ufs2_daddr_t blk, long size); +void blerase(int fd, ufs2_daddr_t blk, long size); void cacheino(union dinode *dp, ino_t inumber); void catch(int); void catchquit(int); Modified: head/sbin/fsck_ffs/fsck_ffs.8 == --- head/sbin/fsck_ffs/fsck_ffs.8 Fri Apr 29 22:40:11 2011 (r221232) +++ head/sbin/fsck_ffs/fsck_ffs.8 Fri Apr 29 23:00:23 2011 (r221233) @@ -29,7 +29,7 @@ .\"@(#)fsck.8 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd January 25, 2009 +.Dd April 27, 2011 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -38,7 +38,7 @@ .Nd file system consistency check and interactive repair .Sh SYNOPSIS .Nm -.Op Fl BFfnpry +.Op Fl BEFfnpry .Op Fl b Ar block .Op Fl c Ar level .Op Fl m Ar mode @@ -149,6 +149,24 @@ If unexpected errors are found, the file system is marked as needing a foreground check and .Nm exits without attempting any further cleaning. +.It Fl E +Clear unallocated blocks, notifying the underlying device that they +are not used and that their contents may be discarded. +This is useful for filesystems which have been mounted on systems +without TRIM support, or with TRIM support disabled, as well as +filesystems which have been copied from one device to another. +.Pp +See the +.Fl E +and +.Fl t +flags of +.Xr newfs 8 , +and +the +.Fl t +flag of +.Xr tunefs 8 . .It Fl F Determine whether the file system needs to be cleaned immediately in foreground, or if its cleaning can be deferred to background. Modified: head/sbin/fsck_ffs/fsutil.c == --- head/sbin/fsck_ffs/fsutil.c Fri Apr 29 22:40:11 2011(r221232) +++ head/sbin/fsck_ffs/fsutil.c Fri Apr 29 23:00:23 2011(r221233) @@ -39,9 +39,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include -#include #include #include @@ -421,6 +422,20 @@ blwrite(int fd, char *buf, ufs2_daddr_t return; } +void +blerase(int fd, ufs2_daddr_t blk, long size) +{ + off_t ioarg[2]; + + if (fd < 0) + return; + ioarg[0] = blk * dev_bsize; + ioarg[1] = size; + ioctl(fd, DIOCGDELETE, ioarg); + /* we don't really care if we succeed or not */ + return; +} + /* * Verify cylinder group's magic number and other parameters. If the * test fails, offer an option to rebuild the whole cylinder group. Modified: head/sbin/fsck_ffs/main.c == --- head/sbin/fsck_ffs/main.c Fri Apr 29 22:40:11 2011(r221232) +++ head/sbin/fsck_ffs/main.c Fri Apr 29 23:00:23 2011(r221233) @@ -82,7 +82,7 @@