amd and 2GB limit

2021-07-02 Thread Gustavo Rios
Hi folks,

Is there this limit yet in amd ?

Thanks.

-- 
The lion and the tiger may be more powerful, but the wolves do not perform
in the circus


Re: dhcpcd -U6 /var/db/dhcpcd/alc0.lease6 incorrectly returns "dhcpcd is not running"

2021-07-02 Thread Zack Newman



> On Jul 2, 2021, at 2:15 PM, Zack Newman  wrote:
> 
> According to DHCPCD(8):
> 
> -U, --dumplease [interface]
>  Dumps the current lease for the interface to stdout.  If no
>  interface is given then all interfaces are dumped.  Use the -4 or
>  -6 flags to specify an address family.  If a lease is piped in
>  via standard input then that is dumped.  In this case, specifying
>  an address family is mandatory.
> 
> So piping in the actual lease should work. Having said that, dhcpcd -U6 alc0, 
> dhcpcd -U alc0, dhcpcd -U6, and dhcpcd -U all timeout:
> 
> beta# dhcpcd -U6 alc0
> dhcpcd_readdumptimeout
> beta# dhcpcd -U alc0
> dhcpcd_readdumptimeout
> beta# dhcpcd -U6 
> dhcpcd_readdumptimeout
> beta# dhcpcd -U  
> dhcpcd_readdumptimeout
> 
> I understand not backporting it. I will live without being able to dump the 
> lease until then.

Please ignore my last reply^. I am an idiot and tested those commands before 
properly digesting what you said Stuart about passing an invalid interface 
first. I rebooted my computer, and sure enough dhcpcd -U alc0 outputted my 
lease information. Clearly the man page said “piped in” not "pass as an 
argument". Doh!

Sorry for my carelessness and haste, and thanks again for the informative reply 
about Linux vs. OpenBSD vis-à-vis SECCOMP vs. pledge and most importantly the 
easy edit to /etc/rc that allows my “unique” configuration to work.

Thanks,
Zack


Re: dhcpcd -U6 /var/db/dhcpcd/alc0.lease6 incorrectly returns "dhcpcd is not running"

2021-07-02 Thread Zack Newman
According to DHCPCD(8):

-U, --dumplease [interface]
 Dumps the current lease for the interface to stdout.  If no
 interface is given then all interfaces are dumped.  Use the -4 or
 -6 flags to specify an address family.  If a lease is piped in
 via standard input then that is dumped.  In this case, specifying
 an address family is mandatory.

So piping in the actual lease should work. Having said that, dhcpcd -U6 alc0, 
dhcpcd -U alc0, dhcpcd -U6, and dhcpcd -U all timeout:

beta# dhcpcd -U6 alc0
dhcpcd_readdumptimeout
beta# dhcpcd -U alc0
dhcpcd_readdumptimeout
beta# dhcpcd -U6 
dhcpcd_readdumptimeout
beta# dhcpcd -U  
dhcpcd_readdumptimeout

I understand not backporting it. I will live without being able to dump the 
lease until then.


Re: send ctrl-alt-f1 to user app

2021-07-02 Thread Gregory Edigarov



On 7/2/21 5:26 PM, Reuben ua Bríġ wrote:
>> Date: Fri,  2 Jul 2021 13:55:26 +0300
>>
>> xmodmap(1) is really only for a user at an X terminal
>>
yeah, I know my case is rather rare. I have a linux vm, running in
vmware on windows.  I connect via rdesktop from my openbsd to windows,
and then open console on vm.
in linux vm, I need to switch to terminal.

Alt+left arrow made the trick for me, for now.

 I  would rather prefer more straight way to turn CTRL+ALT+Fn to be sent
to terminal.



Re: dhcpcd -U6 /var/db/dhcpcd/alc0.lease6 incorrectly returns "dhcpcd is not running"

2021-07-02 Thread Stuart Henderson
On 2021-07-02, Zack Newman  wrote:
> Excellent reply. Thank you Stuart. Unfortunately, changing "rm -rf -- *” to 
> “rm -rf — !(dhcpcd)” and rebooting now causes the command to timeout:
>
> beta# dhcpcd -U6 /var/db/dhcpcd/alc0.lease6
> dhcpcd_readdumptimeout

I believe that should just be "alc0" not the path. Additionally I did
run into a problem when I was testing that to reply to your previous
mail, if an invalid interface was used with -U, the main dhcpcd process
would stop responding to further control connections (with a log message
in /var/log/daemon, "ps_ctl_dispatch: cannot handle another client").

I was about to report it upstream but had a look at the few post-7.4.0
commits and wondered about one of them; testing with git head it looks
like that did indeed fix it, so I've updated the version in ports to
include that. (I think it's not all that common a case so I'm not
planning on backporting to -stable for that, however it seems that
just avoiding using an invalid interface name avoids that issue
anyway).




Re: dhcpcd -U6 /var/db/dhcpcd/alc0.lease6 incorrectly returns "dhcpcd is not running"

2021-07-02 Thread Zack Newman



> On Jul 2, 2021, at 8:22 AM, jslee  wrote:
> 
> On Fri, 2 Jul 2021, at 10:29, Zack Newman wrote:
>> When I start dhcpcd during booting the “normal” way (i.e., rcctl enable 
>> dhcpcd), I am able to successfully dump the lease information 
>> associated with the alc0 interface (which is connected directly to my 
>> bridge modem); however when I start the command inside of 
>> /etc/hostname.alc0 during booting, I am unable to get lease information 
>> after. When the computer boots up, I successfully acquire a DHCPv6 
>> lease as well as have a /60 routed to me. My IPv6 connectivity runs 
>> just fine too.
> 
> Something that's not entirely clear to me here: why? if you are using
> prefix delegation, dhcpcd is interested in more of your interfaces than
> just your ISP-side... no?
> 
> I also use dhcpcd to handle v6 prefix delegation on my gateway
> and just start it in the normal way, no !foo in /etc/hostname.em0, or
> in fact on any other interfaces. Yet it all works quite reliably every
> boot
> 
> What am I missing here?
> 
> John

Your assumption that “dhcpcd is interested in more of your interfaces than just 
your ISP-side” is incorrect. It is only configured for alc0:

beta# cat /etc/dhcpcd.conf  
  
ipv6only
noipv6rs
nooption domain_name_servers
nooption domain_name
nooption host_name
nooption ntp_servers
nooption time_servers
leasetime -1
duid
persistent
option rapid_commit
require dhcp_server_identifier
slaac private
script ""
denyinterfaces lo0 em0 enc0 vlan0 vlan1 vlan2 vlan3 wg0 pflog0
allowinterfaces alc0
interface alc0
ipv6rs
iaid 0
ia_na 0
ia_pd 0/::/60

Even though my ISP dynamically assigns IPv4 and IPv6 addresses, for the 4+ 
years that I have been a customer it has never changed. If this becomes no 
longer true, then I will adjust my setup accordingly.

By having dhcpcd run via /etc/netstart, it becomes consistent with how dhclient 
works. This is not only an optics thing either. Since /etc/rc loads a temporary 
pf ruleset that allows the necessary DHCP and DHCPv6 traffic, I don’t have to 
add such rules in /etc/pf.conf as my “pass out quick” rule is sufficient for 
DHCP and DHCPv6 renewal (since that is sent unicast to the appropriate DHCP and 
DHCPv6 servers and the statefulness of pf allows the response traffic). By not 
having to have something like “pass in quick on alc0 inet6 proto udp from 
fe80::/10 port 547 to fe80::/10 port 546 no state”, I close a very small hole 
in my firewall allowing a rogue DHCPv6 server attempting to lease my interface 
IPs. After all, I don’t have “pass in quick on alc0 inet proto udp from any 
port 67 to any port 68 no state” just to handle that one-time multicast DHCP 
traffic.

Another benefit of having the appropriate IPv6 addresses assigned earlier is 
for daemons that get started before packaging daemons. For example, 
/var/unbound/etc/unbound.conf has a few options based on IP (e.g., 
outgoing-interface). If dhcpcd gets started “normally”, then alc0 will not have 
a globally-routable IPv6 address assigned to it by the time unbound starts 
leading to an error if you have specified any interface options.


Re: dhcpcd -U6 /var/db/dhcpcd/alc0.lease6 incorrectly returns "dhcpcd is not running"

2021-07-02 Thread Zack Newman
Excellent reply. Thank you Stuart. Unfortunately, changing "rm -rf -- *” to “rm 
-rf — !(dhcpcd)” and rebooting now causes the command to timeout:

beta# dhcpcd -U6 /var/db/dhcpcd/alc0.lease6
dhcpcd_readdumptimeout

Like before, IPv6 seems to be working fine otherwise. Any further insight?


Re: while do done

2021-07-02 Thread Reuben ua Bríġ
> Date: Fri,  2 Jul 2021 11:17:20 -0600
> From: "Todd C. Miller" 

> Actually, the following _can_ be interrupted:
> 
> while :; do done
> 
> while :; do :; done

oops.  its been so long i completely forgot.

> The only problem is:
> 
> while do done
> 
> which may not actually be valid syntax.

src/bin/ksh/NOTES says:

- pdksh accepts empty command lists for while and for statements,
  while at&t ksh (and sh) don't.  Eg., pdksh likes
while false ; do done
  but ksh88 doesn't like it.

if only i had never read that file!  i would have happily stuck to

while :; do

> I think the proper fix here is to reject the empty while in OpenBSD's
> sh/ksh.

maybe not the only way, but it would work and is completely reasonable.



Re: while do done

2021-07-02 Thread Todd C . Miller
On Fri, 02 Jul 2021 14:16:20 +1000, Reuben ua =?UTF-8?Q?Br=C3=AD=C4=A1?= wrote:

> you CAN interrupt
>
>   while do sleep 0; done
>
> there is no need for exit, and it doesnt fix
>
>   while do done
>
> or
>
>   while :; do :; done
>
> if your shell needs something to not do.

Actually, the following _can_ be interrupted:

while :; do done

while :; do :; done

The only problem is:

while do done

which may not actually be valid syntax.

I checked some other bourne/korn-like shells:

dash:
$ while do done
sh: 1: Syntax error: "do" unexpected

AT&T ksh:
$ while do done
ksh: syntax error: `do' unexpected

bash:
bash-5.1$ while do done
bash: syntax error near unexpected token `do'

zsh:
% while do done
[CPU loop like OpenBSD ksh]

I think the proper fix here is to reject the empty while in OpenBSD's
sh/ksh.

 - todd



Re: while do done

2021-07-02 Thread Reuben ua Bríġ
> On Mon, 28 Jun 2021 22:20:15 +1000
> Reuben ua Bríġ  wrote:
> 
> you cant interrupt sh in
> 
>   while do done
> 
> not that it matters.

> Date: Fri,  2 Jul 2021 09:07:41 +1000
> From: Stuart Longland 

> oninterrupt() {
> echo "I was interrupted!"
> exit 0
> }
> 
> trap oninterrupt INT
> while true; do
> # Do something
> sleep 10
> done

you CAN interrupt

while do sleep 0; done

there is no need for exit, and it doesnt fix

while do done

or

while :; do :; done

if your shell needs something to not do.

as an aside, using while do as a simple loop and putting

sometest && break

is a good way to NOT get tests wrong.



Re: send ctrl-alt-f1 to user app

2021-07-02 Thread Reuben ua Bríġ
> Date: Fri,  2 Jul 2021 13:55:26 +0300
> From: Gregory Edigarov   

> in my case it changes to the vterm0,
> but now I my app to react, not change terminal 

> Date: Fri,  2 Jul 2021 22:23:35 +0959
> From: Reuben ua Bríġ 

> you probably want
> 
>   xmodmap(1) - utility for modifying keymaps... in X

... unless you are

(a) using a virtual terminal, in which case you want

wsconsctl keyboard.map

(b) WRITING an X application, in which case you want to consult the
relevant library documentation.

xmodmap(1) is really only for a user at an X terminal



Re: send ctrl-alt-f1 to user app

2021-07-02 Thread Reuben ua Bríġ
> Date: Fri,  2 Jul 2021 22:23:35 +0959
> From: Reuben ua Bríġ 

>   xmodmap -e "F1 = F1 F1"

oops... that should be

xmodmap -e "keysym F1 = F1 F1"



Re: send ctrl-alt-f1 to user app

2021-07-02 Thread Reuben ua Bríġ
> Date: Fri,  2 Jul 2021 13:55:26 +0300
> From: Gregory Edigarov 

> in my case it changes to the vterm0,
> but now I my app to react, not change terminal

you probably want

xmodmap(1) - utility for modifying keymaps... in X

the keysym that is the cause of your problems is

XF86Switch_VT_1

to see for yourself, try

xmodmap -pke | grep Switch_VT

i have never used xmodmap---i use xkbcomp(1)---
and i cant remember much about X keyboards stuff,
so dont just assume what i will say is right, but:
i think the following should fix your problem ???

xmodmap -e "F1 = F1 F1"

if not then good luck trying to understand X key maps.
or maybe this might work ???

xmodmap -pke | sed '/XF86Switch_VT_1/!d;s//F1/' | xmodmap -



Re: send ctrl-alt-f1 to user app

2021-07-02 Thread Alexandre Ratchov
On Fri, Jul 02, 2021 at 01:55:26PM +0300, Gregory Edigarov wrote:
> Hello,
> 
> please remind how to do that?
> 
> in my case it changes to the vterm0, that is ok,  but now I my app to
> react, not change terminal
> thank you.
> 

Never tried it, but this reminded me Xorg(1):

   Ctrl+Alt+F1...F12
   For systems with virtual terminal support, these keystroke
   combinations are used to switch to virtual terminals 1 through
   12, respectively.  This can be disabled with the DontVTSwitch
   xorg.conf(5) file option.

HTH



Re: dhcpcd -U6 /var/db/dhcpcd/alc0.lease6 incorrectly returns "dhcpcd is not running"

2021-07-02 Thread jslee
On Fri, 2 Jul 2021, at 10:29, Zack Newman wrote:
> When I start dhcpcd during booting the “normal” way (i.e., rcctl enable 
> dhcpcd), I am able to successfully dump the lease information 
> associated with the alc0 interface (which is connected directly to my 
> bridge modem); however when I start the command inside of 
> /etc/hostname.alc0 during booting, I am unable to get lease information 
> after. When the computer boots up, I successfully acquire a DHCPv6 
> lease as well as have a /60 routed to me. My IPv6 connectivity runs 
> just fine too.

Something that's not entirely clear to me here: why? if you are using
prefix delegation, dhcpcd is interested in more of your interfaces than
just your ISP-side... no?

I also use dhcpcd to handle v6 prefix delegation on my gateway
and just start it in the normal way, no !foo in /etc/hostname.em0, or
in fact on any other interfaces. Yet it all works quite reliably every
boot

What am I missing here?

John



Re: How to set a HTTP proxy for sysupgrade

2021-07-02 Thread Raimo Niskanen
On Thu, Jul 01, 2021 at 09:34:32AM -0400, trondd wrote:
> On Thu, July 1, 2021 4:25 am, Raimo Niskanen wrote:
> > On Wed, Jun 30, 2021 at 09:23:15PM -0400, trondd wrote:
> >>
> >> I simply echo the export statements of the proxy environment variables
> >> to
> >> /etc/rc.firstime before reboot. The installer will always append to the
> >> file so fw_update will be added after the variables are exported.
> >
> > I will try to remember to do that the next time.
> > Thanks for the hint!
> >
> > Would that be a welcome addition to the installer to do this
> > automatically?
> >
> >
> 
> The installer can't do it.  Sysupgrade pulls the sets down and so the
> automated installation does not use the network.  It won't know if there
> is a proxy configuration to pass to rc.firsttime.
> 
> I suppose sysupgrade can check the environment for the variables and write
> them out to rc.firsttime if they are set.

I will try to explore that possibility next time I upgrade - had the same
idea.  Then send a patch suggestion when the change is tested.


> 
> I just have a wrapper script because I also have internally hosted site
> tarballs that need the proxy disabled to access so it was just easier to
> have my own script to enable and disable the proxy as needed for the steps
> I need to take.  I suppose that's why I never thought to try modifying
> sysupgrade.  In my environment, I would still need the script regardless.
> 
> Tim.

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



Re: C style in OpenBSD

2021-07-02 Thread Stuart Longland
On Fri, 2 Jul 2021 15:09:42 +0959
Reuben ua Bríġ  wrote:

> > Some languages do not have ternaries.  
> 
> in C:
> ternary EXPRESSION:   A ? B : C
> ternary STATEMENT:if (A) B; else C;
> 
> i will define some macros to highlight the similarity:
> 
> […snip…]
> 
>   #define exif(e) e ?
>   #define exel :
> 
>   search.argmode =
>   exif (strcmp(progname, BINM_MAN) == 0)
>   ARG_NAME exel
>   exif (strcmp(progname, BINM_APROPOS) == 0)
>   ARG_EXPR exel
>   exif (strcmp(progname, BINM_WHATIS) == 0)
>   ARG_WORD exel
>   exif (strncmp(progname, "help", 4) == 0)
>   ARG_NAME exel
>   ARG_FILE;

Good grief… a bad coding style gets worse.  Yes, it's our favourite,
the C Pre-processor macro!

> > It actually isn't… you can add braces to the if-else, and put
> > for/while/switch/if statements inside those braces to do more complex
> > logic if the need arises.  Only mathematical expressions can be used
> > in ternaries.  
> 
> because they are EXPRESSIONS, not STATEMENTS.

var = expression; // ← statement

As I said before, if you think it's such a great idea, take a software
patent out on the idea.

In the mean time, you're proposing an idea that:
1. fixes nothing as nothing was broken
2. makes code readability and maintainability worse

The horse is dead… and has been flogged so hard every bone in its limp
body has been turned to powder.  When do you stop?  You trying to make
a horse smoothie one whip crack at a time?
-- 
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
  ...it's backed up on a tape somewhere.



send ctrl-alt-f1 to user app

2021-07-02 Thread Gregory Edigarov
Hello,

please remind how to do that?

in my case it changes to the vterm0, that is ok,  but now I my app to
react, not change terminal
thank you.

--
With best regards,
 Gregory Edigarov



Re: dhcpcd -U6 /var/db/dhcpcd/alc0.lease6 incorrectly returns "dhcpcd is not running"

2021-07-02 Thread Stuart Henderson
On 2021-07-02, Zack Newman  wrote:
> When I start dhcpcd during booting the \xe2\x80\x9cnormal\xe2\x80\x9d
> way (i.e., rcctl enable dhcpcd), I am able to successfully dump the
> lease information associated with the alc0 interface (which is connected
> directly to my bridge modem); however when I start the command inside of
> /etc/hostname.alc0 during booting, I am unable to get lease information
> after. When the computer boots up, I successfully acquire a DHCPv6 lease
> as well as have a /60 routed to me. My IPv6 connectivity runs just fine
> too.

This is not a bug.

/etc/rc clears /var/run after starting the network (it can't do it earlier
because /var may be mounted over NFS). dhcpcd places its control socket
in /var/run/dhcpcd, so it is cleared as part of that.

You might get away with mv'ing the directory out of the way after starting
dhcpcd, and back again e.g. in rc.local, obviously it's a kludge.
Alternatively you'll need to either build your own copy of dhcpcd that
uses a different directory (set --rundir when you run configure), or
modify /etc/rc to skip that directory, e.g. by changing "rm -rf -- *"
to "rm -rf -- !(dhcpcd)". In both cases you will need to deal with
reinstating it after an OS update; if you use a custom dhcpcd then that
will need to be rebuilt from time to time; if you edited /etc/rc then
that will need to be reinstated after every update.

> I found a discussion on the blog
> (https://roy.marples.name/archives/dhcpcd-discuss/0003312.html
> )
> belonging to the creator but now former maintainer, Roy
> Marples, of dhcpcd where a similar issue was had by someone
> running dhcpcd on their ARM32 server running a custom Linux
> 4.9 kernel. After much back-and-forth, it was discovered
> to be an issue with privsep not having the system calls
> fcntl64, fstat64, and TCGETS available. Those calls were added
> (https://github.com/NetworkConfiguration/dhcpcd/blob/master/src/privsep-
> linux.c
>  linux.c>) for Linux, and that fixed the issue. I realize that OpenBSD
> has pledge, so this may not be relevant at all and just a coincidence.

That is unrelated and is because Linux's closest equivalent to pledge
(SECCOMP) is too fine-grained to be usable without major pain in many
cases. So rather than saying "allow system calls that permit write
access to files" you must individually list the calls that currently
or might in the future be used for that - and they can vary depending
on machine architecture, also different libc's may use different calls
for the same basic operation, etc.




Re: while do done

2021-07-02 Thread Stuart Longland
On Fri, 2 Jul 2021 14:16:20 +1000
Reuben ua Bríġ  wrote:

> > while true; do
> > # Do something
> > sleep 10
> > done  
> 
> you CAN interrupt
> 
>   while do sleep 0; done
> 
> there is no need for exit, and it doesnt fix
> 
>   while do done

Your bug report was vague and I wasn't convinced `while do done` was legal 
syntax.

> or
> 
>   while :; do :; done
> 
> if your shell needs something to not do.

If you're silly enough to type that into your console, why must we stop you?

Are you also silly enough to set `/usr/local/bin/bash` as your shell
for `root` and put `:(){ :|:& };:` in your .bashrc?
-- 
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
  ...it's backed up on a tape somewhere.