Re: svn commit: r301777 - head/lib/libc/stdio

2016-06-10 Thread Andrey Chernov
Please back it out. __sccl() use plain chars, you can't just call wide
chars __wcollate_range_cmp() from it. Never intermix plain chars and
wide chars without conversion. The problem is somewhere else. The code
used for [a-z] ranges in the format. Moreover, even if conversion added
this code can't work with wchars by definition since uses the same loop
as in regcomp()
for (i = 0; i < 256; i ++)

Counting completely broken regcomp, our locale quickly becomes
intermixing junk of chars and wchars without any conversion. Please
anybody stop hacking here, especially blindly adding wchars everywhere
without analyzing rest of code.
If you see 256 or UCHAR_MAX somewhere, this function can't be converted
to wchars.

On 10.06.2016 8:21, Pedro F. Giffuni wrote:
> Author: pfg
> Date: Fri Jun 10 05:21:52 2016
> New Revision: 301777
> URL: https://svnweb.freebsd.org/changeset/base/301777
> 
> Log:
>   Fix regression from r301461.
>   
>   The fix to the __collate_range_cmp() ABI breakage missed some replacements
>   in libc's vfscanf().  Replace them with __wcollate_range_cmp() which
>   does what is expected.
>   
>   This was breaking applications like xterm and pidgin when using wide
>   characters.
>   
>   Reported by:Vitalij Satanivskij
>   Approved by:re
> 
> Modified:
>   head/lib/libc/stdio/vfscanf.c
> 
> Modified: head/lib/libc/stdio/vfscanf.c
> ==
> --- head/lib/libc/stdio/vfscanf.c Fri Jun 10 04:04:55 2016
> (r301776)
> +++ head/lib/libc/stdio/vfscanf.c Fri Jun 10 05:21:52 2016
> (r301777)
> @@ -873,7 +873,7 @@ doswitch:
>   n = *fmt;
>   if (n == ']'
>   || (table->__collate_load_error ? n < c :
> - __collate_range_cmp (table, n, c) < 0
> + __wcollate_range_cmp(table, n, c) < 0
>  )
>  ) {
>   c = '-';
> @@ -887,8 +887,8 @@ doswitch:
>   } while (c < n);
>   } else {
>   for (i = 0; i < 256; i ++)
> - if (   __collate_range_cmp (table, c, 
> i) < 0
> - && __collate_range_cmp (table, i, 
> n) <= 0
> + if (__wcollate_range_cmp(table, c, i) < 
> 0 &&
> + __wcollate_range_cmp(table, i, n) 
> <= 0
>  )
>   tab[i] = v;
>   }
> 

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301779 - head/share/misc

2016-06-10 Thread Torsten Zuehlsdorff
Author: tz (ports committer)
Date: Fri Jun 10 08:33:15 2016
New Revision: 301779
URL: https://svnweb.freebsd.org/changeset/base/301779

Log:
  - Add myself (tz / Torsten Zuehlsdorff) to ports commiters
  - Add mentors junovitch, pi, swills
  
  Approved by:  re (gjb), junovitch (mentor)

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotFri Jun 10 06:04:53 2016
(r301778)
+++ head/share/misc/committers-ports.dotFri Jun 10 08:33:15 2016
(r301779)
@@ -226,6 +226,7 @@ tota [label="TAKATSU Tomonari\ntota@Free
 trasz [label="Edward Tomasz Napierala\ntr...@freebsd.org\n2007/04/12"]
 trhodes [label="Tom Rhodes\ntrho...@freebsd.org\n2004/07/06"]
 trociny [label="Mikolaj Golub\ntroc...@freebsd.org\n2013/10/17"]
+tz [label="Torsten Zuehlsdorff\n...@freebsd.org\n2016/06/04"]
 uqs [label="Ulrich Spoerlein\n...@freebsd.org\n2012/01/19"]
 vd [label="Vasil Dimov\n...@freebsd.org\n2006/01/19"]
 vg [label="Veniamin Gvozdikov\n...@freebsd.org\n2013/06/11"]
@@ -413,6 +414,8 @@ jadawin -> wen
 
 joerg -> netchild
 
+junovitch -> tz
+
 knu -> daichi
 knu -> maho
 knu -> nobutaka
@@ -530,6 +533,8 @@ pgollucci -> swills
 
 philip -> koitsu
 
+pi -> tz
+
 rafan -> chinsan
 
 rakuco -> alonso
@@ -573,6 +578,7 @@ swills -> milki
 swills -> pclin
 swills -> robak
 swills -> rpaulo
+swills -> tz
 swills -> xmj
 
 tabthorpe -> ashish
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301777 - head/lib/libc/stdio

2016-06-10 Thread Pedro Giffuni

(Sorry I have been offline/sleep for a while)

Hello;

I cannot back this out because of this report:

http://docs.freebsd.org/cgi/mid.cgi?20160608132224.GA15454

This change only re-states what has been working before the ABI breakage 
fix in r301461.


The fix to regex is completely independent.

Pedro.

On 06/10/16 03:20, Andrey Chernov wrote:

Please back it out. __sccl() use plain chars, you can't just call wide
chars __wcollate_range_cmp() from it. Never intermix plain chars and
wide chars without conversion. The problem is somewhere else. The code
used for [a-z] ranges in the format. Moreover, even if conversion added
this code can't work with wchars by definition since uses the same loop
as in regcomp()
for (i = 0; i < 256; i ++)

Counting completely broken regcomp, our locale quickly becomes
intermixing junk of chars and wchars without any conversion. Please
anybody stop hacking here, especially blindly adding wchars everywhere
without analyzing rest of code.
If you see 256 or UCHAR_MAX somewhere, this function can't be converted
to wchars.

On 10.06.2016 8:21, Pedro F. Giffuni wrote:

Author: pfg
Date: Fri Jun 10 05:21:52 2016
New Revision: 301777
URL: https://svnweb.freebsd.org/changeset/base/301777

Log:
  Fix regression from r301461.

  The fix to the __collate_range_cmp() ABI breakage missed some replacements
  in libc's vfscanf().  Replace them with __wcollate_range_cmp() which
  does what is expected.

  This was breaking applications like xterm and pidgin when using wide
  characters.

  Reported by:  Vitalij Satanivskij
  Approved by:  re

Modified:
  head/lib/libc/stdio/vfscanf.c

Modified: head/lib/libc/stdio/vfscanf.c
==
--- head/lib/libc/stdio/vfscanf.c   Fri Jun 10 04:04:55 2016
(r301776)
+++ head/lib/libc/stdio/vfscanf.c   Fri Jun 10 05:21:52 2016
(r301777)
@@ -873,7 +873,7 @@ doswitch:
n = *fmt;
if (n == ']'
|| (table->__collate_load_error ? n < c :
-   __collate_range_cmp (table, n, c) < 0
+   __wcollate_range_cmp(table, n, c) < 0
   )
   ) {
c = '-';
@@ -887,8 +887,8 @@ doswitch:
} while (c < n);
} else {
for (i = 0; i < 256; i ++)
-   if (   __collate_range_cmp (table, c, i) 
< 0
-   && __collate_range_cmp (table, i, n) 
<= 0
+   if (__wcollate_range_cmp(table, c, i) < 0 
&&
+   __wcollate_range_cmp(table, i, n) 
<= 0
   )
tab[i] = v;
}




___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301777 - head/lib/libc/stdio

2016-06-10 Thread Andrey Chernov
On 10.06.2016 15:03, Pedro Giffuni wrote:
> (Sorry I have been offline/sleep for a while)
> 
> Hello;
> 
> I cannot back this out because of this report:
> 
> http://docs.freebsd.org/cgi/mid.cgi?20160608132224.GA15454
> 
> This change only re-states what has been working before the ABI breakage
> fix in r301461.

Because now strcoll_l() is used as before and it is broken in wide char
converting process. It is broken for _all_, not just for vfscanf()
ranges. It should never fail with any args.
Real fix should be in strcoll_l().

> The fix to regex is completely independent.

It is dependent. vfscanf() and regcomp() use the same code for range
collation. If we remove range collation from everywhere, we save
vfscanf(), but strcoll_l() remains broken.

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301777 - head/lib/libc/stdio

2016-06-10 Thread Pedro Giffuni



On 06/10/16 07:19, Andrey Chernov wrote:

On 10.06.2016 15:03, Pedro Giffuni wrote:

(Sorry I have been offline/sleep for a while)

Hello;

I cannot back this out because of this report:

http://docs.freebsd.org/cgi/mid.cgi?20160608132224.GA15454

This change only re-states what has been working before the ABI breakage
fix in r301461.


Because now strcoll_l() is used as before and it is broken in wide char
converting process. It is broken for _all_, not just for vfscanf()
ranges. It should never fail with any args.
Real fix should be in strcoll_l().



Yes, it is broken as before however the objective of r301461 was only
to address the ABI breakage. If I revert r301777 then I have to backout
r301461 too, and then we have again the ABI breakage.

I understand you want to fix all but we are under code freeze and
I have to go back to a known working (although still broken) state.


The fix to regex is completely independent.


It is dependent. vfscanf() and regcomp() use the same code for range
collation. If we remove range collation from everywhere, we save
vfscanf(), but strcoll_l() remains broken.




We have had a broken regex for a very long time, and we new that
before collation was introduced. I didn't take that decision but
moving to libtre was a lot more work and we really had to have
collation now.

Pedro.


___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301787 - head/usr.sbin/bsdinstall/scripts

2016-06-10 Thread Allan Jude
Author: allanjude
Date: Fri Jun 10 14:31:59 2016
New Revision: 301787
URL: https://svnweb.freebsd.org/changeset/base/301787

Log:
  Fix bsdinstall for root-on-zfs with MBR partitioning
  
  Fix an error where vfs.root.mountfrom was not always set as required
  when creating a bootpool. After the recent geliboot changes, it was only
  set if the main pool was encrypted.
  
  Also resolve an error where the bootpool was unmounted twice causing
  bsdinstall to stop with an error message about the failed command.
  
  Approved by:  re (gjb)
  Sponsored by: BSDCan Hacker Lounge

Modified:
  head/usr.sbin/bsdinstall/scripts/zfsboot

Modified: head/usr.sbin/bsdinstall/scripts/zfsboot
==
--- head/usr.sbin/bsdinstall/scripts/zfsbootFri Jun 10 14:31:03 2016
(r301786)
+++ head/usr.sbin/bsdinstall/scripts/zfsbootFri Jun 10 14:31:59 2016
(r301787)
@@ -1194,11 +1194,6 @@ zfs_create_boot()
f_eval_catch $funcname chmod "$CHMOD_MODE" \
 go-wrx "$bootpool/$zroot_key" ||
 return $FAILURE
-   else
-   # Clean up
-   f_eval_catch $funcname zfs "$ZFS_UNMOUNT" \
-"$bootpool_name" || return $FAILURE
-   f_eval_catch -d $funcname umount "$UMOUNT" /mnt # tmpfs
fi
 
fi
@@ -1409,6 +1404,11 @@ zfs_create_boot()
 "cachefile=\"$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\"" \
 "$zroot_name" || return $FAILURE
 
+   if [ "$ZFSBOOT_BOOT_POOL" ]; then
+   f_eval_catch $funcname printf "$PRINTF_CONF" \
+   vfs.root.mountfrom "\"zfs:$zroot_name/$zroot_bootfs\"" \
+   $BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE
+   fi
#
# Set canmount=noauto so that the default Boot Environment (BE) does not
# get mounted if a different BE is selected from the beastie menu
@@ -1486,10 +1486,6 @@ zfs_create_boot()
 $BSDINSTALL_TMPBOOT/loader.conf.zfs ||
 return $FAILURE
done
-   f_eval_catch $funcname printf "$PRINTF_CONF" vfs.root.mountfrom \
-   "\"zfs:$zroot_name/$zroot_bootfs\"" \
-   $BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE
-
return $SUCCESS
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301572 - in head/lib/libcasper: libcasper services/cap_dns services/cap_grp services/cap_pwd services/cap_random services/cap_sysctl

2016-06-10 Thread Jilles Tjoelker
On Wed, Jun 08, 2016 at 02:03:53AM +, Mariusz Zaborski wrote:
> Author: oshogbo
> Date: Wed Jun  8 02:03:53 2016
> New Revision: 301572
> URL: https://svnweb.freebsd.org/changeset/base/301572

> Log:
>   Add flags to the Casper services.

>   CASPER_SERVICE_STDIO - Casper will not close the first three descriptors 
> (stdin,
>  stdout and stderr) this can be helpful for debugging.
>   CASPER_SERVICE_FD - Capser will not close all other descriptors, this can
>   be useful for a filesystem service.

This reminds me that there are some common cases where it is wrong to
close descriptors you don't know about. The non-POSIX command
  diff <(cmd1) <(cmd2)
that compares the outputs of the two commands, when executed with bash
that was compiled with the full /dev/fd visible (as in poudriere), will
actually run something like
  diff /dev/fd/63 /dev/fd/62
passing two file descriptors to pipes.

When created by a shell, these pathnames will start with /dev/fd/, but
people could create symlinks to these special files.

> [snip]
> +static void
> +stdnull(void)
> +{
> + int fd;
> +
> + fd = open(_PATH_DEVNULL, O_RDWR);
> + if (fd == -1)
> + errx(1, "Unable to open %s", _PATH_DEVNULL);
> +
> + if (setsid() == -1)
> + errx(1, "Unable to detach from session");

There is an implicit assumption here that stdnull() is only called from
a process that was forked off from here, since setsid() will not and
cannot work when called from a process that is already a session leader.

If the application is running from a shell, this setsid() will exclude
the process from most signals, including terminal ^C/^\/^Z, kill % and
hangups. More generally, this might make it more likely for the process
to hang around indefinitely after the parent is gone.

> +
> + if (dup2(fd, STDIN_FILENO) == -1)
> + errx(1, "Unable to cover stdin");
> + if (dup2(fd, STDOUT_FILENO) == -1)
> + errx(1, "Unable to cover stdout");
> + if (dup2(fd, STDERR_FILENO) == -1)
> + errx(1, "Unable to cover stderr");
> +
> + close(fd);

This was not broken by this commit, but fd should not be closed if it is
equal to STDIN_FILENO, STDOUT_FILENO or STDERR_FILENO.

> [snip]

-- 
Jilles Tjoelker
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301794 - head/usr.sbin/services_mkdb

2016-06-10 Thread Allan Jude
Author: allanjude
Date: Fri Jun 10 14:59:11 2016
New Revision: 301794
URL: https://svnweb.freebsd.org/changeset/base/301794

Log:
  Fix a miss merge in the services_mkdb(8) man page
  
  Restore the cross reference to getservent(3) to the correct line
  
  Approved by:  re (gjb)
  Sponsored by: BSDCan Hacker Lounge

Modified:
  head/usr.sbin/services_mkdb/services_mkdb.8

Modified: head/usr.sbin/services_mkdb/services_mkdb.8
==
--- head/usr.sbin/services_mkdb/services_mkdb.8 Fri Jun 10 14:51:11 2016
(r301793)
+++ head/usr.sbin/services_mkdb/services_mkdb.8 Fri Jun 10 14:59:11 2016
(r301794)
@@ -75,6 +75,7 @@ Print the services file to stdout, omitt
 .El
 .Pp
 The databases are used by the C library services routines (see
+.Xr getservent 3 ) .
 .Pp
 The
 .Fl b
@@ -82,7 +83,6 @@ and
 .Fl l
 flags are mutually exclusive.
 The default byte ordering is the current host order.
-.Xr getservent 3 ) .
 .Sh FILES
 .Bl -tag -width ".Pa /var/db/services.db.tmp" -compact
 .It Pa /var/db/services.db
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301777 - head/lib/libc/stdio

2016-06-10 Thread Andrey Chernov
On 10.06.2016 17:14, Pedro Giffuni wrote:
>> Because now strcoll_l() is used as before and it is broken in wide char
>> converting process. It is broken for _all_, not just for vfscanf()
>> ranges. It should never fail with any args.
>> Real fix should be in strcoll_l().
>>
> 
> Yes, it is broken as before however the objective of r301461 was only
> to address the ABI breakage. If I revert r301777 then I have to backout
> r301461 too, and then we have again the ABI breakage.
> 
> I understand you want to fix all but we are under code freeze and
> I have to go back to a known working (although still broken) state.

I can't make strcoll or vfscanf to drop core in my simple tests.
Too little info in the bug report.
In any case here is vfscanf.c fix attached (by removing collation range).

>> It is dependent. vfscanf() and regcomp() use the same code for range
>> collation. If we remove range collation from everywhere, we save
>> vfscanf(), but strcoll_l() remains broken.
>>
>>
> 
> We have had a broken regex for a very long time, and we new that
> before collation was introduced. I didn't take that decision but
> moving to libtre was a lot more work and we really had to have
> collation now.

No, we have perfectly working single byte regex with collation ranges
for many years until those wchars was invaded the code very recently.

Index: vfscanf.c
===
--- vfscanf.c   (revision 301779)
+++ vfscanf.c   (working copy)
@@ -816,9 +816,7 @@
 static const u_char *
 __sccl(char *tab, const u_char *fmt)
 {
-   int c, n, v, i;
-   struct xlocale_collate *table =
-   (struct 
xlocale_collate*)__get_locale()->components[XLC_COLLATE];
+   int c, n, v;
 
/* first `clear' the whole table */
c = *fmt++; /* first char hat => negated scanset */
@@ -871,29 +869,15 @@
 * we just stored in the table (c).
 */
n = *fmt;
-   if (n == ']'
-   || (table->__collate_load_error ? n < c :
-   __wcollate_range_cmp(table, n, c) < 0
-  )
-  ) {
+   if (n == ']' || n < c) {
c = '-';
break;  /* resume the for(;;) */
}
fmt++;
-   /* fill in the range */
-   if (table->__collate_load_error) {
-   do {
-   tab[++c] = v;
-   } while (c < n);
-   } else {
-   for (i = 0; i < 256; i ++)
-   if (__wcollate_range_cmp(table, c, i) < 
0 &&
-   __wcollate_range_cmp(table, i, n) 
<= 0
-  )
-   tab[i] = v;
-   }
+   do {/* fill in the range */
+   tab[++c] = v;
+   } while (c < n);
 #if 1  /* XXX another disgusting compatibility hack */
-   c = n;
/*
 * Alas, the V7 Unix scanf also treats formats
 * such as [a-c-e] as `the letters a through e'.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

svn commit: r301797 - head/release/doc/en_US.ISO8859-1/relnotes

2016-06-10 Thread Kurt Lidl
Author: lidl
Date: Fri Jun 10 15:05:35 2016
New Revision: 301797
URL: https://svnweb.freebsd.org/changeset/base/301797

Log:
  Relnotes entries for blacklist project
  
  Approved by:  re (gjb)
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Fri Jun 10 
15:03:45 2016(r301796)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml   Fri Jun 10 
15:05:35 2016(r301797)
@@ -608,6 +608,29 @@
   OpenBSM has been
updated to version 1.2 alpha 4.
 
+  The NetBSD
+   Project's &man.libblacklist.3; library and applications
+   have been ported and integrated into the system.  Packet
+   filtering support for the &man.pf.4; packet filtering systems
+   has been implemented.  The blacklist
+   system provides the blacklistd
+   daemon, the helper script
+   blacklistd-helper to make changes
+   to the running packet filter system and the
+   blacklistctl control program.
+   A selection of system daemons, including:
+   fingerd,
+   ftpd,
+   rlogind,
+   rshd, and
+   sshd have been modified to support
+   sending notifications to the blacklistd
+   daemon.
+
+  Support for
+   the &man.ipfw.4; packet filter has been added to the
+   blacklistd-helper script.
+
 
 
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301800 - head/sys/rpc

2016-06-10 Thread Garrett Cooper
Author: ngie
Date: Fri Jun 10 17:53:28 2016
New Revision: 301800
URL: https://svnweb.freebsd.org/changeset/base/301800

Log:
  Deobfuscate cleanup path in clnt_bck_create(..)
  
  Similar to r300836, cl and ct will always be non-NULL as they're allocated
  using the mem_alloc routines, which always use `malloc(..., M_WAITOK)`.
  
  Deobfuscating the cleanup path fixes a leak where if cl was NULL and
  ct was not, ct would not be free'd, and also removes a duplicate test for
  cl not being NULL.
  
  Approved by: re (gjb)
  Differential Revision: https://reviews.freebsd.org/D6801
  MFC after: 1 week
  Reported by: Coverity
  CID: 122
  Reviewed by: cem
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/rpc/clnt_bck.c

Modified: head/sys/rpc/clnt_bck.c
==
--- head/sys/rpc/clnt_bck.c Fri Jun 10 15:47:20 2016(r301799)
+++ head/sys/rpc/clnt_bck.c Fri Jun 10 17:53:28 2016(r301800)
@@ -175,14 +175,9 @@ clnt_bck_create(
return (cl);
 
 err:
-   if (cl) {
-   if (ct) {
-   mtx_destroy(&ct->ct_lock);
-   mem_free(ct, sizeof (struct ct_data));
-   }
-   if (cl)
-   mem_free(cl, sizeof (CLIENT));
-   }
+   mtx_destroy(&ct->ct_lock);
+   mem_free(ct, sizeof (struct ct_data));
+   mem_free(cl, sizeof (CLIENT));
return (NULL);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301814 - in head/sys: conf modules

2016-06-10 Thread Jonathan T. Looney
Author: jtl
Date: Fri Jun 10 19:06:11 2016
New Revision: 301814
URL: https://svnweb.freebsd.org/changeset/base/301814

Log:
  Change the default build behavior so we don't compile extra TCP modules by
  default. At least initially, the feature to support multiple TCP stacks is
  aimed at supporting advanced use cases and TCP development, but it is not
  necessarily aimed at a wide audience. Therefore, there is no need to build
  and install the extra TCP stacks by default. Instead, the people who are
  using or developing this functionality can add the extra option to build/
  install the extra TCP stacks.
  
  However, we do want to build the extra TCP stacks as part of test builds
  (e.g. LINT or tinderbox) to ensure that developers who are testing their
  changes will know that their changes do not break the additional TCP
  stack modules.
  
  After this change, a user will need to add WITH_EXTRA_TCP_STACKS=1 to
  make.conf or the kernel config in order to build the extra TCP modules.
  
  Differential Revision:https://reviews.freebsd.org/D6795
  Reviewed by:  sjg
  Approved by:  re (kib)

Modified:
  head/sys/conf/kern.opts.mk
  head/sys/conf/kern.post.mk
  head/sys/modules/Makefile

Modified: head/sys/conf/kern.opts.mk
==
--- head/sys/conf/kern.opts.mk  Fri Jun 10 18:47:11 2016(r301813)
+++ head/sys/conf/kern.opts.mk  Fri Jun 10 19:06:11 2016(r301814)
@@ -45,6 +45,7 @@ __DEFAULT_YES_OPTIONS = \
 
 __DEFAULT_NO_OPTIONS = \
 EISA \
+EXTRA_TCP_STACKS \
 NAND \
 OFED
 

Modified: head/sys/conf/kern.post.mk
==
--- head/sys/conf/kern.post.mk  Fri Jun 10 18:47:11 2016(r301813)
+++ head/sys/conf/kern.post.mk  Fri Jun 10 19:06:11 2016(r301814)
@@ -23,6 +23,10 @@ MKMODULESENV+=   CONF_CFLAGS="${CONF_CFLAG
 MKMODULESENV+= WITH_CTF="${WITH_CTF}"
 .endif
 
+.if defined(WITH_EXTRA_TCP_STACKS)
+MKMODULESENV+= WITH_EXTRA_TCP_STACKS="${WITH_EXTRA_TCP_STACKS}"
+.endif
+
 # Allow overriding the kernel debug directory, so kernel and user debug may be
 # installed in different directories. Setting it to "" restores the historical
 # behavior of installing debug files in the kernel directory.

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Fri Jun 10 18:47:11 2016(r301813)
+++ head/sys/modules/Makefile   Fri Jun 10 19:06:11 2016(r301814)
@@ -353,7 +353,7 @@ SUBDIR= \
${_syscons} \
sysvipc \
${_ti} \
-   tcp/fastpath \
+   ${_tcp_fastpath} \
tests/framework \
tests/callout_test \
tl \
@@ -436,6 +436,10 @@ _random_other= random_other
 SUBDIR+=   cuse
 .endif
 
+.if ${MK_EXTRA_TCP_STACKS} != "no" || defined(ALL_MODULES)
+_tcp_fastpath= tcp/fastpath
+.endif
+
 .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
defined(ALL_MODULES)
 _carp= carp
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301572 - in head/lib/libcasper: libcasper services/cap_dns services/cap_grp services/cap_pwd services/cap_random services/cap_sysctl

2016-06-10 Thread Mariusz Zaborski
On Fri, Jun 10, 2016 at 04:47:28PM +0200, Jilles Tjoelker wrote:
> On Wed, Jun 08, 2016 at 02:03:53AM +, Mariusz Zaborski wrote:
> > Author: oshogbo
> > Date: Wed Jun  8 02:03:53 2016
> > New Revision: 301572
> > URL: https://svnweb.freebsd.org/changeset/base/301572
> 
> > Log:
> >   Add flags to the Casper services.
> 
> >   CASPER_SERVICE_STDIO - Casper will not close the first three descriptors 
> > (stdin,
> >stdout and stderr) this can be helpful for debugging.
> >   CASPER_SERVICE_FD - Capser will not close all other descriptors, this can
> > be useful for a filesystem service.
> 
> This reminds me that there are some common cases where it is wrong to
> close descriptors you don't know about. The non-POSIX command
>   diff <(cmd1) <(cmd2)
> that compares the outputs of the two commands, when executed with bash
> that was compiled with the full /dev/fd visible (as in poudriere), will
> actually run something like
>   diff /dev/fd/63 /dev/fd/62
> passing two file descriptors to pipes.
> 
> When created by a shell, these pathnames will start with /dev/fd/, but
> people could create symlinks to these special files.
This is why the CASPER_SERVICE_FD was added. :)

> > [snip]
> > +static void
> > +stdnull(void)
> > +{
> > +   int fd;
> > +
> > +   fd = open(_PATH_DEVNULL, O_RDWR);
> > +   if (fd == -1)
> > +   errx(1, "Unable to open %s", _PATH_DEVNULL);
> > +
> > +   if (setsid() == -1)
> > +   errx(1, "Unable to detach from session");
> 
> There is an implicit assumption here that stdnull() is only called from
> a process that was forked off from here, since setsid() will not and
> cannot work when called from a process that is already a session leader.
> 
> If the application is running from a shell, this setsid() will exclude
> the process from most signals, including terminal ^C/^\/^Z, kill % and
> hangups. More generally, this might make it more likely for the process
> to hang around indefinitely after the parent is gone.
I'm not sure but if the process descriptor not solve that?
If we close all process descriptor to the process it should die then, so you
need to kill just the process which is using service.

> > +
> > +   if (dup2(fd, STDIN_FILENO) == -1)
> > +   errx(1, "Unable to cover stdin");
> > +   if (dup2(fd, STDOUT_FILENO) == -1)
> > +   errx(1, "Unable to cover stdout");
> > +   if (dup2(fd, STDERR_FILENO) == -1)
> > +   errx(1, "Unable to cover stderr");
> > +
> > +   close(fd);
> 
> This was not broken by this commit, but fd should not be closed if it is
> equal to STDIN_FILENO, STDOUT_FILENO or STDERR_FILENO.
Yes you are in 100% right. Thanks, I will fix that.

Thanks,
-- 
Mariusz Zaborski
oshogbo//vx | http://oshogbo.vexillium.org
FreeBSD commiter| https://freebsd.org
Software developer  | http://wheelsystems.com
If it's not broken, let's fix it till it is!!1


signature.asc
Description: PGP signature


svn commit: r301815 - head/sys/conf

2016-06-10 Thread Glen Barber
Author: gjb
Date: Fri Jun 10 19:29:55 2016
New Revision: 301815
URL: https://svnweb.freebsd.org/changeset/base/301815

Log:
  Update 11.0 to ALPHA3 in preparation for new snapshot builds.
  
  Approved by:  re (implicit)
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/conf/newvers.sh

Modified: head/sys/conf/newvers.sh
==
--- head/sys/conf/newvers.shFri Jun 10 19:06:11 2016(r301814)
+++ head/sys/conf/newvers.shFri Jun 10 19:29:55 2016(r301815)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="11.0"
-BRANCH="ALPHA2"
+BRANCH="ALPHA3"
 if [ -n "${BRANCH_OVERRIDE}" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301572 - in head/lib/libcasper: libcasper services/cap_dns services/cap_grp services/cap_pwd services/cap_random services/cap_sysctl

2016-06-10 Thread Jilles Tjoelker
On Fri, Jun 10, 2016 at 09:17:45PM +0200, Mariusz Zaborski wrote:
> On Fri, Jun 10, 2016 at 04:47:28PM +0200, Jilles Tjoelker wrote:
> > On Wed, Jun 08, 2016 at 02:03:53AM +, Mariusz Zaborski wrote:
> > > + if (setsid() == -1)
> > > + errx(1, "Unable to detach from session");

> > There is an implicit assumption here that stdnull() is only called from
> > a process that was forked off from here, since setsid() will not and
> > cannot work when called from a process that is already a session leader.

> > If the application is running from a shell, this setsid() will exclude
> > the process from most signals, including terminal ^C/^\/^Z, kill % and
> > hangups. More generally, this might make it more likely for the process
> > to hang around indefinitely after the parent is gone.

> I'm not sure but if the process descriptor not solve that?
> If we close all process descriptor to the process it should die then, so you
> need to kill just the process which is using service.

Oh, right. For termination this is probably even better since
terminating properly may require casper daemons, and for stopping it
probably doesn't matter much.

For opening files in utilities called from an interactive shell it is
probably still bad since it breaks /dev/tty and obscures blocking opens
such as fifos.

-- 
Jilles Tjoelker
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"