Re: question; how to build individual userland programs on NetBSD 7-RC3 ?

2015-09-16 Thread Martin Husemann
On Tue, Sep 15, 2015 at 09:31:29PM -0700, r.liegh wrote:
> Can someone explain to me what the process is to build userland tools
> individually? 

As Manuel pointed out, the easiest way is forced native compilation with
USETOOLS=never.

The officialy sanctioned way is to create tools upfront (e.g. by runing
"build.sh tools" or a variant of that) and use nbmake-$arch from the
$TOOLDIR/bin/ directory created by that step.

Example:

   cd usr.sbin/makefs
   $TOOLDIR/bin/nbmake-amd64 -j 20
   $TOOLDIR/bin/nbmake-amd64 install

This will use the objdir as setup by the initial build.sh step and not clobber
your source tree with .o files (modulo bugs), plus it will also work for
cross compiling.

But if you don't care about the (temporary) source tree pollution
and only want quick native builds, the USETOOLS=never + make version is
easiest.

Martin


Re: question; how to build individual userland programs on NetBSD 7-RC3 ?

2015-09-16 Thread Martin Husemann
On Wed, Sep 16, 2015 at 08:58:22AM +0200, Martin Husemann wrote:
> The officialy sanctioned way is to create tools upfront (e.g. by runing
> "build.sh tools" or a variant of that) and use nbmake-$arch from the
> $TOOLDIR/bin/ directory created by that step.

Actually you will need more - one of the benefits of this version is that
you may build arbitrary source tree versions on arbitrary host versions,
so the header and libs do not need to be the same.

But this means "build.sh tools" is not enough, a full "build.sh build"
is required (which, of course, includes the tool step). Maybe we should
create a "build.sh libs-and-includes" ?

Martin


Re: question; how to build individual userland programs on NetBSD 7-RC3 ?

2015-09-16 Thread Valery Ushakov
Martin Husemann  wrote:

> On Wed, Sep 16, 2015 at 08:58:22AM +0200, Martin Husemann wrote:
>> The officialy sanctioned way is to create tools upfront (e.g. by runing
>> "build.sh tools" or a variant of that) and use nbmake-$arch from the
>> $TOOLDIR/bin/ directory created by that step.
> 
> Actually you will need more - one of the benefits of this version is that
> you may build arbitrary source tree versions on arbitrary host versions,
> so the header and libs do not need to be the same.
> 
> But this means "build.sh tools" is not enough, a full "build.sh build"
> is required (which, of course, includes the tool step). Maybe we should
> create a "build.sh libs-and-includes" ?

Exactly.

http://www.stderr.spb.ru/~uwe/netbsd/cross.html

-uwe



Re: Why doesn't NetBSD recognize my entries in /etc/hosts?

2015-09-16 Thread Johnny Billquist

On 2015-09-16 21:30, Ottavio Caruso wrote:

On 16 September 2015 at 19:06, Johnny Billquist  wrote:

On 2015-09-16 19:09, Ottavio Caruso wrote:


RE: http://mail-index.netbsd.org/netbsd-users/2014/04/27/msg014543.html

I put domains that I want to block in /etc/hosts preceded by 0.0.0.0
but I can still ping them.

I rebooted, but I can still ping them.

Then I have mass-changed all entries from 0.0.0.0 to 127.0.0.1 and I
can still ping them.

Rebooted, same thing.

Why can I do this effortlessly with Windows and Linux but not with NetBSD?



First of all, using /etc/hosts as a way of block domains is extremely
unreliable and not really a meaningful way of actually block anything.


Why? It works on other platforms?


Depends on what you mean by "works". Changing things in /etc/hosts does 
not prevent me from reaching any of those places. It just prevents me 
from using those specific names for reaching them. What are you trying 
to do? Just prevent local users from using the domain names? Because 
that is all you can hope to accomplish. And it also depends on whatever 
application we're talking about also not trying to do DNS lookups on its 
own, totally circumventing any reference to the local /etc/hosts file.



Second, I guess you haven't heard of /etc/nsswitch.conf. It also exists in
Linux. It tells which methods are used, and in which order. It might be that
you have dns before files.


I've checked my nsswitch.conf, it's files before hosts



Changing a destination to 127.0.0.1, and then pinging it, why would you
expect it to not work. 127.0.0.1 will most likely respond to pings.
Pinging 0.0.0.0 will also give some result. Most probably your default
gateway machine.


Yes, I didn't express myself correctly. I meant that I ping the
original host, not 127.0.0.1.

BTW, rebooting TWICE produced the intended result. I wonder why I had
to reboot twice.


That sounds extremely strange.


Maybe you should try and learn about /etc/hosts.deny as well as ipfilters?


But again, why?

If I have a list of 300 domains to block, this would not be practicable.


The question is - what do you actually want to do. And how it entering 
them all in /etc/hosts any more practicable than using /etc/hosts.deny?
But it do achieve different goeals. /etc/hosts.deny will stop any 
connections *from* those places, but will not prevent local users from 
contacting those places.
But, like I said, /etc/hosts do not stop you from accessing anything. 
It, at most, will prevent your usage of certain domain names.


Johnny



Re: Why doesn't NetBSD recognize my entries in /etc/hosts?

2015-09-16 Thread Johnny Billquist

On 2015-09-16 21:56, Ottavio Caruso wrote:

On 16 September 2015 at 19:36, Johnny Billquist  wrote:

Maybe you should try and learn about /etc/hosts.deny as well as
ipfilters?



But again, why?

If I have a list of 300 domains to block, this would not be practicable.



The question is - what do you actually want to do. And how it entering them
all in /etc/hosts any more practicable than using /etc/hosts.deny?


There are third party lists of domains that are either malware or
nasty tracing cookies, this is one of them:
http://winhelp2002.mvps.org/hosts.txt

This is what I want to do. This is my machine and I am happy with
blocking all these domains. It might not be the most elegant thing to
do but it works for me.

Hosts.deny blocks those domains accessing services on my computer but
not my computer accessing their servers.


Right.


Running ipfilter is a bit overkill.


As long as you understand that if they actually use the ip address, 
you're not blocking them. And if they have some other name pointing to 
the same site, you also do not block that one. And so on.


Johnny



Re: Why doesn't NetBSD recognize my entries in /etc/hosts?

2015-09-16 Thread Ottavio Caruso
On 16 September 2015 at 19:36, Johnny Billquist  wrote:
>>> Maybe you should try and learn about /etc/hosts.deny as well as
>>> ipfilters?
>>
>>
>> But again, why?
>>
>> If I have a list of 300 domains to block, this would not be practicable.
>
>
> The question is - what do you actually want to do. And how it entering them
> all in /etc/hosts any more practicable than using /etc/hosts.deny?

There are third party lists of domains that are either malware or
nasty tracing cookies, this is one of them:
http://winhelp2002.mvps.org/hosts.txt

This is what I want to do. This is my machine and I am happy with
blocking all these domains. It might not be the most elegant thing to
do but it works for me.

Hosts.deny blocks those domains accessing services on my computer but
not my computer accessing their servers.

Running ipfilter is a bit overkill.


-- 
Ottavio


re-introducing ARFE; teaching ARFE new tricks

2015-09-16 Thread David Young
ARFE is a new text-processing toolkit that I recently started sharing
with the NetBSD community.  I introduced ARFE on tech-userlevel@ in
August,
.

ARFE is an experiment in making UNIX text-processing more *applicable*
and *accessible*.

applicable: ARFE is designed to process record- and field-oriented
texts as they actually appear in UNIX and on the web: semi-regular,
defect-ridden, and conforming to no written specification.

accessible: ARFE avoids excessive abstraction, tricky notation, and
precarious flexibility to the greatest practical extent.  ARFE
encourages users to be *concrete*.  Typically an ARFE user expresses
the input and output forms they expect by providing an example
instead of a description, and ARFE tolerates some mistakes in the
examples users give.  With ARFE, it isn't necessary to name input
data fields, or to count off input fields from the beginning of a
record.

I'm creating ARFE in the hope that it will invite non-programmers to
attempt text-processing automation, and that programmers will find that
it relieves some text-processing tedium so that they can tackle bigger
problems.

Since I introduced ARFE, I have added new data detectors: ARFE now
detects hexadecimal numbers, IPv4 and MAC addresses.

There is a new program in the ARFE toolsuite called TT for (t)ransform
(t)ext.  TT transforms its input based on a match-/transform-template
pair that exemplify the changes to be made.  The templates show what
a sample input looks like before TT transforms it, and after---you
could call the templates a before/after pair.  I have attached a
match/transform pair that produces a digest of ifconfig(8) output.

ARFE is in the NetBSD CVS repository.  The path to ARFE is
othersrc/external/bsd/arfe/.

Next steps for ARFE include adding more data detectors (floating point
numbers, IPv6 addresses), making ARFE prefer matches that are "compact",
and adding support for multiple records per input.  After ARFE supports
multiple records per input, a couple of really interesting programs
should be possible.  Alas, it may be at least as difficult to program an
algorithm for identifying record boundaries as to program everything in
ARFE that came before!

Dave

-- 
David Young
dyo...@pobox.comUrbana, IL(217) 721-9981
wm0: flags=8843 mtu 1492

capabilities=2bf80

enabled=2bf80
address: aa:ab:ac:ad:ae:af
media: Ethernet autoselect (1000baseT full-duplex)
status: active
input: 745177 packets, 455120099 bytes, 74377 multicasts
output: 540500 packets, 121290742 bytes, 253 multicasts
inet 0.0.0.0 netmask 0x broadcast 255.255.255.255
inet6 fe80::10f:20f:30f1:40f%wm0 prefixlen 79 scopeid 0x7
wm0 mtu 1492
link aa:ab:ac:ad:ae:af
inet 0.0.0.0 netmask 0x broadcast 255.255.255.255
inet6 fe80::10f:20f:30f1:40f%wm0 / 79 scopeid 0x7


Re: Why doesn't NetBSD recognize my entries in /etc/hosts?

2015-09-16 Thread Ottavio Caruso
On 16 September 2015 at 19:06, Johnny Billquist  wrote:
> On 2015-09-16 19:09, Ottavio Caruso wrote:
>>
>> RE: http://mail-index.netbsd.org/netbsd-users/2014/04/27/msg014543.html
>>
>> I put domains that I want to block in /etc/hosts preceded by 0.0.0.0
>> but I can still ping them.
>>
>> I rebooted, but I can still ping them.
>>
>> Then I have mass-changed all entries from 0.0.0.0 to 127.0.0.1 and I
>> can still ping them.
>>
>> Rebooted, same thing.
>>
>> Why can I do this effortlessly with Windows and Linux but not with NetBSD?
>
>
> First of all, using /etc/hosts as a way of block domains is extremely
> unreliable and not really a meaningful way of actually block anything.

Why? It works on other platforms?

>
> Second, I guess you haven't heard of /etc/nsswitch.conf. It also exists in
> Linux. It tells which methods are used, and in which order. It might be that
> you have dns before files.

I've checked my nsswitch.conf, it's files before hosts

>
> Changing a destination to 127.0.0.1, and then pinging it, why would you
> expect it to not work. 127.0.0.1 will most likely respond to pings.
> Pinging 0.0.0.0 will also give some result. Most probably your default
> gateway machine.

Yes, I didn't express myself correctly. I meant that I ping the
original host, not 127.0.0.1.

BTW, rebooting TWICE produced the intended result. I wonder why I had
to reboot twice.

>
> Maybe you should try and learn about /etc/hosts.deny as well as ipfilters?

But again, why?

If I have a list of 300 domains to block, this would not be practicable.




-- 
Ottavio


Re: Why doesn't NetBSD recognize my entries in /etc/hosts?

2015-09-16 Thread Eric Haszlakiewicz
On September 16, 2015 3:30:43 PM EDT, Ottavio Caruso 
 wrote:
>On 16 September 2015 at 19:06, Johnny Billquist 
>wrote:
>> On 2015-09-16 19:09, Ottavio Caruso wrote:
>>>
>>> RE:
>http://mail-index.netbsd.org/netbsd-users/2014/04/27/msg014543.html
>>>
>>> I put domains that I want to block in /etc/hosts preceded by 0.0.0.0
>>> but I can still ping them.
>>>
>>> I rebooted, but I can still ping them.
>>>
>>> Then I have mass-changed all entries from 0.0.0.0 to 127.0.0.1 and I
>>> can still ping them.
>>>
>>> Rebooted, same thing.
>>>
>>> Why can I do this effortlessly with Windows and Linux but not with
>NetBSD?
>>
>>
>> First of all, using /etc/hosts as a way of block domains is extremely
>> unreliable and not really a meaningful way of actually block
>anything.
>
>Why? It works on other platforms?
>
>>
>> Second, I guess you haven't heard of /etc/nsswitch.conf. It also
>exists in
>> Linux. It tells which methods are used, and in which order. It might
>be that
>> you have dns before files.
>
>I've checked my nsswitch.conf, it's files before hosts
>
>>
>> Changing a destination to 127.0.0.1, and then pinging it, why would
>you
>> expect it to not work. 127.0.0.1 will most likely respond to pings.
>> Pinging 0.0.0.0 will also give some result. Most probably your
>default
>> gateway machine.
>
>Yes, I didn't express myself correctly. I meant that I ping the
>original host, not 127.0.0.1.
>
>BTW, rebooting TWICE produced the intended result. I wonder why I had
>to reboot twice.

Fwiw, using /etc/hosts sounds entirely reasonable for what you're trying to do 
(and hosts.deny, though having a similar name, is pointless to look at).

Do additional changes require a reboot?  If so, something is really odd.  
Changes to /etc/hosts should take effect immediately.  Maybe use ktrace/kdump 
to see if it's actually being read?

Eric




Re: Why doesn't NetBSD recognize my entries in /etc/hosts?

2015-09-16 Thread Matt Sporleder




> On Sep 16, 2015, at 3:30 PM, Ottavio Caruso  
> wrote:
> 
>> On 16 September 2015 at 19:06, Johnny Billquist  wrote:
>>> On 2015-09-16 19:09, Ottavio Caruso wrote:
>>> 
>>> RE: http://mail-index.netbsd.org/netbsd-users/2014/04/27/msg014543.html
>>> 
>>> I put domains that I want to block in /etc/hosts preceded by 0.0.0.0
>>> but I can still ping them.
>>> 
>>> I rebooted, but I can still ping them.
>>> 
>>> Then I have mass-changed all entries from 0.0.0.0 to 127.0.0.1 and I
>>> can still ping them.
>>> 
>>> Rebooted, same thing.
>>> 
>>> Why can I do this effortlessly with Windows and Linux but not with NetBSD?
>> 
>> 
>> First of all, using /etc/hosts as a way of block domains is extremely
>> unreliable and not really a meaningful way of actually block anything.
> 
> Why? It works on other platforms?
> 
>> 
>> Second, I guess you haven't heard of /etc/nsswitch.conf. It also exists in
>> Linux. It tells which methods are used, and in which order. It might be that
>> you have dns before files.
> 
> I've checked my nsswitch.conf, it's files before hosts
> 
>> 
>> Changing a destination to 127.0.0.1, and then pinging it, why would you
>> expect it to not work. 127.0.0.1 will most likely respond to pings.
>> Pinging 0.0.0.0 will also give some result. Most probably your default
>> gateway machine.
> 
> Yes, I didn't express myself correctly. I meant that I ping the
> original host, not 127.0.0.1.
> 
> BTW, rebooting TWICE produced the intended result. I wonder why I had
> to reboot twice.
> 
>> 
>> Maybe you should try and learn about /etc/hosts.deny as well as ipfilters?
> 
> But again, why?
> 
> If I have a list of 300 domains to block, this would not be practicable.
> 
> 
> 
> 
> -- 
> Ottavio

Show us a sample hosts entry and the full output of your ping, please. 

Re: Why doesn't NetBSD recognize my entries in /etc/hosts?

2015-09-16 Thread Martin Husemann
On Wed, Sep 16, 2015 at 07:56:56PM +, Ottavio Caruso wrote:
> There are third party lists of domains that are either malware or
> nasty tracing cookies, this is one of them:
> http://winhelp2002.mvps.org/hosts.txt

I tried with one entry from that file and it works fine for me:

> ping mfr.a2dfp.net
PING mfr.a2dfp.net (0.0.0.0): 56 data bytes
64 bytes from 192.168.111.42: icmp_seq=0 ttl=255 time=0.366921 ms
64 bytes from 192.168.111.42: icmp_seq=1 ttl=255 time=0.328004 ms
...

This is my gateway answering (as expected).

I have

lookup file bind

in /etc/resolv.conf and default /etc/nsswitch.conf.

Martin


Re: Why doesn't NetBSD recognize my entries in /etc/hosts?

2015-09-16 Thread Ottavio Caruso
On 17 September 2015 at 06:54, Martin Husemann  wrote:
> On Wed, Sep 16, 2015 at 07:56:56PM +, Ottavio Caruso wrote:
>> There are third party lists of domains that are either malware or
>> nasty tracing cookies, this is one of them:
>> http://winhelp2002.mvps.org/hosts.txt
>
> I tried with one entry from that file and it works fine for me:
>
>> ping mfr.a2dfp.net
> PING mfr.a2dfp.net (0.0.0.0): 56 data bytes
> 64 bytes from 192.168.111.42: icmp_seq=0 ttl=255 time=0.366921 ms
> 64 bytes from 192.168.111.42: icmp_seq=1 ttl=255 time=0.328004 ms
> ...
>
> This is my gateway answering (as expected).
>
> I have
>
> lookup file bind
>
> in /etc/resolv.conf and default /etc/nsswitch.conf.
>
> Martin

Then there might be a problem with my pc. I am not on the machine
right now. I'll "cat" my files later on.

-- 
Ottavio


Re: question; how to build individual userland programs on NetBSD 7-RC3 ?

2015-09-16 Thread r.liegh


On Tue, 9/15/15, Manuel Bouyer  wrote:

 Subject: Re: question; how to build individual userland programs on NetBSD 
7-RC3 ?
 To: "r.liegh" 
 Cc: netbsd-users@NetBSD.org
 Date: Tuesday, September 15, 2015, 9:51 PM
 
 On Tue, Sep 15, 2015 at
 09:31:29PM -0700, r.liegh wrote:
 > Hello
 > 
 > I have been away
 from BSD for a while, I've played around with installing
 different flavors as a guest under KVM. I downloaded both
 the source and binary (amd64) copies of 7.0-RC3 and
 installed it in a virtual machine. 
 > 
 > I tried compiling programs under /usr/src
 (after unpacking the source files, of course) for the sake
 of kicking the tires, but didn't have a lot of luck.
 Trying to compile /usr/src/usr.bin/tr resulted in this: 
 > ===
 > beasty# cd ~
 > beasty# pwd
 > /root
 > beasty# cd /usr/src/usr.bin/tr
 > beasty# make
 >
 #   compile  tr/str.o
 >
 /usr/src/tooldir.NetBSD-7.0_RC3-amd64/bin/x86_64--netbsd-gcc
 -O2    -std=gnu99    -Wall -Wstrict-prototypes
 -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare 
 -Wno-traditional  -Wa,--fatal-warnings -Wreturn-type
 -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra
 -Wno-unused-parameter -Wno-sign-compare
 -Wold-style-definition -Wsign-compare -Wformat=2 
 -Wno-format-zero-length  -Werror    --sysroot=/  -c   
 str.c
 > sh:
 /usr/src/tooldir.NetBSD-7.0_RC3-amd64/bin/x86_64--netbsd-gcc:
 not found
 > *** Error code 127
 
 make USETOOLS=never
 should work
 
 --
 
 Manuel Bouyer 
      NetBSD: 26 ans
 d'experience feront toujours la difference
 --

Works flawlessly -thanks!