Re: SSIZE_MAX

2020-01-15 Thread Theo de Raadt
Raymond, David  wrote:

> The POSIX SSIZE_MAX is something like 2^15 -1.

I doubt that, you better backtrack a couple of steps.



Re: SSIZE_MAX

2020-01-15 Thread Bryan Steele
> I am confused about SSIZE_MAX and read(2)/write(2).  The POSIX
> SSIZE_MAX is something like 2^15 -1.  This seems to be a real
> limitation when writing to a TCP/IP socket, as I learned from
> experience.  However, much larger reads and writes seem to be possible
> to files and UNIX sockets (pipes).  This makes me uneasy, given the
> warning in the man pages for read(2)/write(2).
>
> Any insight on this topic would be appreciated.
>
> -- 
> David J. Raymond
> david.raym...@nmt.edu
> http://physics.nmt.edu/~raymond

Not in any reasonably modern version of POSIX..

https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html

{SSIZE_MAX}
Maximum value for an object of type ssize_t.

$ grep -R "SSIZE_MAX" /usr/include
./amd64/limits.h:#define SSIZE_MAX  LONG_MAX/* max value for
a ssize_t */

/usr/include/sys/limits.h:
#ifdef __LP64__
..
# define LONG_MAX   0x7fffL
...
#else
..
# define LONG_MAX   0x7fffL

-Bryan.



SSIZE_MAX

2020-01-15 Thread Raymond, David
I am confused about SSIZE_MAX and read(2)/write(2).  The POSIX
SSIZE_MAX is something like 2^15 -1.  This seems to be a real
limitation when writing to a TCP/IP socket, as I learned from
experience.  However, much larger reads and writes seem to be possible
to files and UNIX sockets (pipes).  This makes me uneasy, given the
warning in the man pages for read(2)/write(2).

Any insight on this topic would be appreciated.

-- 
David J. Raymond
david.raym...@nmt.edu
http://physics.nmt.edu/~raymond



From nginx to openbsd httpd

2020-01-15 Thread Nuno Teixeira
Hello,

I use poudriere pkg builder on FreeBSD and I use nginx to get poudriere web
status interface.

I'm looking for a less complex httpd server and obhttpd seems to be right
choice. I have installed obhttpd 
port

nginx httpd.conf is:

server {
listen 80 default;
server_name server_domain_or_IP;
root /usr/local/share/poudriere/html;

location /data {
alias /usr/local/poudriere/data/logs/bulk;
autoindex on;
}

location /packages {
root /usr/local/poudriere/data;
autoindex on;
}
}
}

obhttpd uses chroot, so I will have to point it to /usr/local/poudriere.

Any hints on getting this on openbsd httpd conf file?

Thanks,

Nuno


Ipsec with NAT on phase 2

2020-01-15 Thread Dante F . B . Colò

Hello everyone

I maintain some ipsec gateway using isakmpd on OpenBSD no problem at 
all, but i need to setup a new one but now with NAT on phase 2 , is this 
possible with iked or isakmpd ?


Best Regards

Dante



displayport - hdmi audio

2020-01-15 Thread sysmerge
Hello thee, im trying to connect my TV to Thinkpad x220 via displayport - hdmi, 
but sound is only working on notebook not on TV.
I tried some tricks from audio faq from site but no result. Problem is i have  
kinda low knowledge in audio related stuff in OpenBSD, cuz audio just works 
fine from the box on my laptop itself.

# dmesg | grep audio
audio0 at azalia0

#

# audioctl
name=azalia0
mode=
pause=1
active=0
nblks=16
blksz=480
rate=48000
encoding=s16le
play.channels=2
play.bytes=0
play.errors=0
record.channels=2
record.bytes=0
record.errors=0

###
# mixerctl
inputs.dac-2:3_mute=off
inputs.dac-2:3=189,189
inputs.dac-0:1_mute=off
inputs.dac-0:1=189,189
inputs.beep=108
record.adc-2:3_source=mic3
record.adc-2:3_mute=off
record.adc-2:3=126,126
record.adc-0:1_source=sel
record.adc-0:1_mute=off
record.adc-0:1=126,126
record.adc-4:5_source=sel
record.adc-4:5_mute=off
record.adc-4:5=126,126
inputs.sel_source=mic
outputs.sel=126,126
inputs.sel2_source=mic
outputs.sel2=126,126
outputs.hp_source=dac-0:1
outputs.hp_boost=off
outputs.mic_dir=input-vr80
outputs.mic2_source=dac-2:3
outputs.mic2_dir=input-vr80
outputs.mic2_eapd=on
outputs.hp2_source=dac-0:1
outputs.spkr_source=dac-2:3
inputs.mic3=126,126
inputs.mix_source=dac-2:3,dac-0:1
inputs.mix_dac-2:3=126,126
inputs.mix_dac-0:1=126,126
outputs.hp_sense=unplugged
outputs.mic_sense=unplugged
outputs.mic2_sense=unplugged
outputs.hp2_sense=unplugged
outputs.spkr_muters=hp,mic2,hp2
outputs.master=190,190
outputs.master.mute=off
outputs.master.slaves=dac-2:3,dac-0:1
record.volume=126,126
record.volume.mute=off
record.volume.slaves=adc-2:3,adc-0:1,adc-4:5
record.enable=sysctl

Will appreciate any tip
Regards

Sent with [ProtonMail](https://protonmail.com) Secure Email.


Re: automounter (amd) local file system issue

2020-01-15 Thread Strahil Nikolov
On January 13, 2020 5:40:06 AM GMT+02:00, Nick Holland 
 wrote:
>On 2020-01-12 15:39, Antoine Jacoutot wrote:
>> Sounds like something is keeping your fs busy. Could be gio-kqueue,
>do you have glib2 installed?
>
>That would be my first guess, too -- it's not unmounting because it
>shouldn't.  But ... this is a VERY single purpose machine (backups
>via rsync --link-dest), and the only third party package is rsync
>and my scripts to do the backups.  X is installed, but not running.
>
>$ pkg_info
>intel-firmware-20191115p0v0 microcode update binaries for Intel CPUs
>inteldrm-firmware-20181218 firmware binary images for inteldrm(4)
>driver
>quirks-3.216exceptions to pkg_add rules
>rsync-3.1.3 mirroring/synchronization over low bandwidth links
>vmm-firmware-1.11.0p2 firmware binary images for vmm(4) driver
>
>I was careful to access the amd mounts by ls , while
>sitting in my home directory, which is NOT part of the amd, so I
>didn't have a task under a doas or su camped out on the amd vols.
>
>I've tesed a lot of ways, but I just did an upgrade to -current and
>immediately "looked" at the amd mount, so even my backup scripts
>haven't run.
>
>Plus -- as a control, /v/2 has absolutely nothing on it, and it
>behaves the same way.  Not that something couldn't camp out on the
>empty file system, but not much reason for something to do so.
>
>Thanks for looking!
>
>Nick.
>
> 
>> —
>> Antoine
>> 
>>> On 13 Jan 2020, at 06:01, Nick Holland 
>wrote:
>>> 
>>> Hiya.
>>> 
>>> I'd like to use amd(8) to automatically mount and dismount local
>file
>>> systems.  The file systems in question are big, lots of complicated
>>> links, lots of files, and take a while to fsck if the power goes out
>>> unexpectedly, and are used relatively rarely (maybe an hour a day).
>>> Sounds like a perfect job for amd(8)!
>>> 
>>> The file systems in question are mounted to /v/1 and /v/2
>>> 
>>> I've got the following set up:
>>> 
>>>  $ cat /etc/rc.conf.local   
>
>>>  amd_flags=-l syslog -x all -c 10 -w 10
>>>  lockd_flags=
>>>  portmap_flags=
>>> 
>>>  $ cat /etc/amd/master  
>
>>>  /v  amd.v
>>> 
>>>  $ cat /etc/amd/amd.v   
>>>  1   type:=ufs;dev:=/dev/sd2i
>>>  2   type:=ufs;dev:=/dev/sd2j
>>> 
>>> 
>>> ANDit works!
>>> 
>>> start the system up, I get this:
>>> 
>>>  $ df
>>>  Filesystem  512-blocks  Used Avail Capacity  Mounted on
>>>  /dev/sd2a  101167620381275728421%/
>>>  /dev/sd2h 1031983648   9803800 0%/home
>>>  /dev/sd2f  413682820   3929968 0%/tmp
>>>  /dev/sd2d  8264188   2369920   548106030%/usr
>>>  /dev/sd2e  2065116  2104   1959760 0%/usr/local
>>>  /dev/sd2g  4136828 64920   3865068 2%/var
>>>  amd:365830 0 0   100%/v
>>> 
>>>  $ ls /v/1/
>>> [...expected output from files and directories on that file
>system...]
>>> 
>>>  $ df
>>>  Filesystem  1K-blocks  Used Avail Capacity  Mounted on
>>>  /dev/sd2a  505838 8360239694617%/
>>>  /dev/sd2h 515991824   4901900 0%/home
>>>  /dev/sd2f 206841410   1964984 0%/tmp
>>>  /dev/sd2d 4132094   1280264   264522633%/usr
>>>  /dev/sd2e 1032558  1052979880 0%/usr/local
>>>  /dev/sd2g 2068414 32572   1932422 2%/var
>>>  amd:92953   0 0 0   100%/v
>>>  /dev/sd2i   2106117872 298739480 170207250415%   
>/tmp_mnt/dbu/v/1
>>> 
>>> Success!!
>>> well...no.  Seems it never umounts the amd file systems.  And that
>is
>>> basically the point of this exercise -- to increase the odds that a
>FS
>>> isn't mounted when the power goes out.
>>> 
>>> Am I doing something wrong?  Do I have inaccurate expectations of
>>> what amd(8) does with local file systems? 
>>> 
>>> Nick.
>>> 
>>> OpenBSD 6.6-current (GENERIC.MP) #599: Sat Jan 11 18:52:00 MST 2020
>>>   
>dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
>>> real mem = 2038652928 (1944MB)
>>> avail mem = 1964462080 (1873MB)
>>> mpath0 at root
>>> scsibus0 at mpath0: 256 targets
>>> mainbus0 at root
>>> bios0 at mainbus0: SMBIOS rev. 2.8 @ 0xebd30 (52 entries)
>>> bios0: vendor American Megatrends Inc. version "1020" date
>12/15/2014
>>> bios0: PowerSpec V400
>>> acpi0 at bios0: ACPI 5.0
>>> acpi0: sleep states S0 S3 S4 S5
>>> acpi0: tables DSDT FACP APIC FPDT MSDM MCFG LPIT SLIC HPET SSDT SSDT
>SSDT UEFI
>>> acpi0: wakeup devices XHC1(S3) PXSX(S4) PXSX(S4) PXSX(S4) PXSX(S4)
>PWRB(S0)
>>> acpitimer0 at acpi0: 3579545 Hz, 24 bits
>>> acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
>>> cpu0 at mainbus0: apid 0 (boot processor)
>>> cpu0: Intel(R) Pentium(R) CPU J2900 @ 2.41GHz, 2417.12 MHz, 06-37-08
>>> cpu0:
>FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,

Re: [patch,cwm] Warp cursor on window-snap

2020-01-15 Thread Okan Demirmen
On Tue 2020.01.14 at 08:49 +0100, Stefan Hagen wrote:
> Hello,
> 
> when using the window-snap-{up,down,left,right} functions in CWM(1), the 
> window might jump away from the cursor, which makes it loose focus.
> 
> The window move and resize functions are "dragging" the cursor with them 
> along the side of the window.
> 
> The attached simple patch warps the cursor with the window, so it stays
> within it's relative position within the window.

Thanks for the report. I believe using client_ptr_inbound() would be
more appropriate, for client_ptrwarp() will use the last saved pointer
position, which may, or may not, be the expected positon once warp'd.
client_ptr_inbound() will only warp if the pointer is out-of-bounds,
plus it will warp just enough - this is how all the other similar
actions behave as well.

Index: kbfunc.c
===
RCS file: /home/open/cvs/xenocara/app/cwm/kbfunc.c,v
retrieving revision 1.166
diff -u -p -r1.166 kbfunc.c
--- kbfunc.c13 Aug 2019 18:45:38 -  1.166
+++ kbfunc.c15 Jan 2020 15:09:28 -
@@ -322,6 +322,7 @@ kbfunc_client_snap(void *ctx, struct car
}
}
client_move(cc);
+   client_ptr_inbound(cc, 1);
 }
 
 void



Re: When Free Software Foundation will remove the Hyperbola GNU/Linux-libre of the page that lists the GNU/Linux distributions that are entirely free as in freedom?

2020-01-15 Thread Ron Rodriguez
Why don't the Hyperbola team work on porting the HURD kernel instead, if 
they want to stay in GNU Land with the GPL license?


The GUIX team ported HURD, so they should get together with those guys 
and port HURD as the base kernel and then backport all of the 
mitigations from Linux and OpenBSD as they see fit with their own 
implementation and code whenever they have license convulsions. It seems 
like security is their goal, but if they want to stay GPL compliant, 
while moving away from the Linux Kernel, then they should work on 
bringing the HURD to the mainstream, and then a group of kernel security 
gurus can work with their team to fix it up to scratch with 
implementations of the modern mitigations.   I don't know how realistic 
time wise, or man hour intensive that approach would be however.


Ron Rodriguez

Geomatics Engineering Student , University of Calgary

On 1/14/20 8:08 PM, SOUL_OF_ROOT 55 wrote:

Hi Free Software Foundation!

It is written in article "Free GNU/Linux distributions":

"Hyperbola GNU/Linux-libre, a long-term support simplicity-focused
distribution based on Arch GNU/Linux."

Reference: https://www.gnu.org/distros/free-distros.en.html

Free Software Foundation,

Hyperbola GNU/Linux-libre is not free because is changing to BSD.

References:

https://www.hyperbola.info/news/announcing-hyperbolabsd-roadmap/

https://forums.hyperbola.info/viewtopic.php?id=315

Free Software Foundation,

The Hyperbola GNU/Linux-libre is still in list of Free GNU/Linux
distributions.

Will Free Software Foundation remove the Hyperbola GNU/Linux-libre of the page
that lists the GNU/Linux 
distributions
that are entirely free  as in
freedom?

If yes, when Free Software Foundation will remove the Hyperbola GNU/Linux-libre
of the page that lists the GNU/Linux
 distributions that are
entirely free  as in freedom?