Re: Porting some software to OpenBSD

2019-01-05 Thread Andreas Kusalananda Kähäri
On Sun, Jan 06, 2019 at 03:22:50AM +, Adam Steen wrote:
> Hi All
> 
> I have a question about string (printf) formatting.
> 
> I have a variable
> 
> 'uint64_t freq'
> 
> which is printed with
> 
> 'log(DEBUG, "Solo5: clock_init(): freq=%lu\n", freq);'
> 
> but am getting the following error
> 
> '
> error: format specifies type 'unsigned long' but the argument has type 
> 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]
> freq);
> ^~~~
> 1 error generated.
> '
> 
> The easy fix is to change the format to '%llu', but this brakes FreeBSD and 
> Linux. Am i missing something or should i be investigating the log 
> implementation?
> 
> 
> Cheers
> Adam


If you want to print an int type from , use the printf()
format defined for that type in :


uint64_t freq;

/* ... */

printf("freq is %" PRIu64 " Hz\n", freq);


See e.g. https://en.cppreference.com/w/c/types/integer


Cheers,

-- 
Andreas Kusalananda Kähäri,
National Bioinformatics Infrastructure Sweden (NBIS),
Uppsala University, Sweden.



Re: console radeondrm default font change

2019-01-05 Thread lists
Sun, 6 Jan 2019 01:51:21 +0200 Mihai Popescu 
> 
> I am sure there are another beautiful things in OpenBSD, but I am
> affraid I am not so advanced to see and understand them.
> 

https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt



Re: Porting some software to OpenBSD

2019-01-05 Thread Philip Guenther
On Sat, Jan 5, 2019 at 7:25 PM Adam Steen  wrote:

> I have a question about string (printf) formatting.
>
> I have a variable
>
> 'uint64_t freq'
>
> which is printed with
>
> 'log(DEBUG, "Solo5: clock_init(): freq=%lu\n", freq);'
>
> but am getting the following error
>
> '
> error: format specifies type 'unsigned long' but the argument has type
> 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]
> freq);
> ^~~~
> 1 error generated.
> '
>
> The easy fix is to change the format to '%llu', but this brakes FreeBSD
> and Linux. Am i missing something or should i be investigating the log
> implementation?
>

Option 1)
log(DEBUG, "Solo5: clock_init(): freq=%llu\n", (unsigned long
long)freq);

Option 2)
#include 
log(DEBUG, "Solo5: clock_init(): freq=%"PRIu64"\n", freq);

Software native to OpenBSD uses option 1 when necessary.


Philip Guenther


Re: Porting some software to OpenBSD

2019-01-05 Thread Ted Unangst
Adam Steen wrote:
> 'log(DEBUG, "Solo5: clock_init(): freq=%lu\n", freq);'
> 
> but am getting the following error
> 
> '
> error: format specifies type 'unsigned long' but the argument has type 
> 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]
> freq);
> ^~~~
> 1 error generated.
> '
> 
> The easy fix is to change the format to '%llu', but this brakes FreeBSD and 
> Linux. Am i missing something or should i be investigating the log 
> implementation?

The easy fix is log("%llu", (long long)freq) which should work everywhere.



Re: Porting some software to OpenBSD

2019-01-05 Thread Theo de Raadt
Nathan Hartman  wrote:

> On Sat, Jan 5, 2019 at 10:27 PM Adam Steen  wrote:
> 
> > Hi All
> >
> > I have a question about string (printf) formatting.
> >
> > I have a variable
> >
> > 'uint64_t freq'
> >
> > which is printed with
> >
> > 'log(DEBUG, "Solo5: clock_init(): freq=%lu\n", freq);'
> >
> > but am getting the following error
> >
> > '
> > error: format specifies type 'unsigned long' but the argument has type
> > 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]
> > freq);
> > ^~~~
> > 1 error generated.
> > '
> >
> > The easy fix is to change the format to '%llu', but this brakes FreeBSD
> > and Linux. Am i missing something or should i be investigating the log
> > implementation?
> >
> >
> > Cheers
> > Adam
> 
> 
> There are often subtle differences like this between platforms.

You mean errors.

Some of these errors are involved in what makes it so hard for them
to handle 64-bit time_t, and wait until you see the incredible scheme
they have planned for finally making 64-bit off_t the default...



Re: Porting some software to OpenBSD

2019-01-05 Thread Nathan Hartman
On Sat, Jan 5, 2019 at 10:27 PM Adam Steen  wrote:

> Hi All
>
> I have a question about string (printf) formatting.
>
> I have a variable
>
> 'uint64_t freq'
>
> which is printed with
>
> 'log(DEBUG, "Solo5: clock_init(): freq=%lu\n", freq);'
>
> but am getting the following error
>
> '
> error: format specifies type 'unsigned long' but the argument has type
> 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]
> freq);
> ^~~~
> 1 error generated.
> '
>
> The easy fix is to change the format to '%llu', but this brakes FreeBSD
> and Linux. Am i missing something or should i be investigating the log
> implementation?
>
>
> Cheers
> Adam


There are often subtle differences like this between platforms.

One possibility is to define preprocessor macros that expand to the correct
printf format modifier for the platform. I've seen several implementations
over the years. One that comes to mind (only because I saw it recently) is
pstdint.h:

http://www.azillionmonkeys.com/qed/pstdint.h

(I don't know if that works correctly on OpenBSD. Also it defines a bunch
of other things; that may be helpful, or unhelpful!)

A more fully featured library that deals with platform differences is APR,
the Apache Portable Runtime. I think there are also such definitions there.


Porting some software to OpenBSD

2019-01-05 Thread Adam Steen
Hi All

I have a question about string (printf) formatting.

I have a variable

'uint64_t freq'

which is printed with

'log(DEBUG, "Solo5: clock_init(): freq=%lu\n", freq);'

but am getting the following error

'
error: format specifies type 'unsigned long' but the argument has type 
'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]
freq);
^~~~
1 error generated.
'

The easy fix is to change the format to '%llu', but this brakes FreeBSD and 
Linux. Am i missing something or should i be investigating the log 
implementation?


Cheers
Adam



Re: console radeondrm default font change

2019-01-05 Thread Mihai Popescu
On Sun, Jan 6, 2019 at 1:32 AM  wrote:
>
> Fri, 4 Jan 2019 13:01:10 +0200 Mihai Popescu 
> >
> > Is it done from radeon firmware or from a conf file?
> >
>
> Hi Mihai,
>
> https://cvsweb.openbsd.org/src/sys/dev/wsfont/wsfont.c
> $ ls -1 /usr/include/dev/wsfont
> $ wsfontload -l
> https://man.openbsd.org/wsfontload
> https://man.openbsd.org/wsdisplay
>
> Kind regards,
> Anton Lazarov

I had a bad day so I started to prepare an USB disk for OpenBSD
install. I got the wrong one and overwrite some important data.
I went on and installed the OS, then I saw this wonderful scrolling of
Spleen font. It was and it is magical. All my grief went off.
I keep a terminal with this font, running tcpdump in the background,
it is so nice to see it scroll. Many thanks to the font developer and
OpenBSD developers!
I went on and searched about font change in console, found kernel
source and the rest. I search for font creation under OpenBSD, too.
Maybe I will contact him to ask about the tools he used ...
I am sure there are another beautiful things in OpenBSD, but I am
affraid I am not so advanced to see and understand them.



Re: vultr

2019-01-05 Thread edgar
On Sat, Jan 05, 2019 at 02:40:43PM -0800, Misc User wrote:
> On 1/5/2019 2:22 PM, ed...@pettijohn-web.com wrote:
> > I was thinking about spinning up a new instance on vultr to play with.
> > They have an option to install OBSD 6.3/4. Has anyone tried these? I
> > attempted the FBSD one in the past, but the default install was all
> > whacked out and I had to start over with a fresh install.
> > 
> > Thanks,
> > 
> > Edgar
> > 
> The default is alright, but comes with keys and passwords they generated,
> plus they do a single-partition scheme on the smaller disk instances and the
> auto partition on the others.  Good for a general purpose machine, but not
> so great if you have a specific task in mind. They also tend to install all
> the sets.
> 

Sounds like a clean install is the way to go.

> But since they let you upload an ISO and give you full console access, I
> just do a fresh install and customize as much as I want for the system I am
> building.  Usually so I can get a good partitioning scheme set up (256m on
> /, /home, /tmp, /usr/local, /var and swap; with a 1g /usr and swap) so I can
> dedicate 15g (Or more) to a partition for whatever task the machine was
> built for.
> 
> -CA
> 
>

I've been using vultr since around 5.8 or there abouts with no issues. Just 
saw they had an image available and didn't want to waste time with it if it
was going to give me trouble later. Then again a fresh install doesn't take that
long, might test it out anyway.

Thanks for all the replies.

Edgar



Re: No network with latest snap (5jan-19)

2019-01-05 Thread Jonathan Gray
On Sat, Jan 05, 2019 at 03:39:34PM +0100, Christer Solskogen wrote:
> On my APU2 I got no network with the latest snap.
> 
> I get this in the console:
> starting network
> ifconfig: SIOCSETPFSYNC: Invalid argument
> ifconfig: SIOCSVH: Invalid argument
> ifconfig: SIOCSETPFSYNC: Invalid argument
> 
> OpenBSD 6.4-current (GENERIC.MP) #562: Sat Jan  5 04:37:18 MST 2019
> dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP

I made a mistake in an em(4) commit.  Should be fixed in the next snapshot.



Re: console radeondrm default font change

2019-01-05 Thread John

Christian Weisgerber wrote:

On 2019-01-04, Mihai Popescu  wrote:


Can someone tell me a font close to this to use for xterm in X?


ports/fonts/spleen



How could I configure my -current install to use this font in the console?

Best regards,
John



Re: console radeondrm default font change

2019-01-05 Thread lists
Fri, 4 Jan 2019 13:01:10 +0200 Mihai Popescu 
> 
> Is it done from radeon firmware or from a conf file?
> 

Hi Mihai,

https://cvsweb.openbsd.org/src/sys/dev/wsfont/wsfont.c
$ ls -1 /usr/include/dev/wsfont
$ wsfontload -l
https://man.openbsd.org/wsfontload
https://man.openbsd.org/wsdisplay

Kind regards,
Anton Lazarov



Re: vultr

2019-01-05 Thread Antonino Sidoti
Hi,

I have two systems with Vultr (Sydney and Tokyo) and find them to be fine. True 
the default install using the automated Vultr 6.3/6.4 install will create two 
partitions and swap. I have installed one of my OpenBSD system using a custom 
install ISO OpenBSD 6.4 and with that I can do it whatever I like and partition 
the system as I see fit.

> On 6 Jan 2019, at 9:40 am, Misc User  wrote:
> 
> On 1/5/2019 2:22 PM, ed...@pettijohn-web.com wrote:
>> I was thinking about spinning up a new instance on vultr to play with.
>> They have an option to install OBSD 6.3/4. Has anyone tried these? I
>> attempted the FBSD one in the past, but the default install was all
>> whacked out and I had to start over with a fresh install.
>> Thanks,
>> Edgar
> The default is alright, but comes with keys and passwords they generated, 
> plus they do a single-partition scheme on the smaller disk instances and the 
> auto partition on the others.  Good for a general purpose machine, but not so 
> great if you have a specific task in mind. They also tend to install all the 
> sets.
> 
> But since they let you upload an ISO and give you full console access, I just 
> do a fresh install and customize as much as I want for the system I am 
> building.  Usually so I can get a good partitioning scheme set up (256m on /, 
> /home, /tmp, /usr/local, /var and swap; with a 1g /usr and swap) so I can 
> dedicate 15g (Or more) to a partition for whatever task the machine was built 
> for.
> 
> -CA
> 



Re: vultr

2019-01-05 Thread Donald Cooley
On January 5, 2019 4:22:23 PM CST, ed...@pettijohn-web.com wrote:
>I was thinking about spinning up a new instance on vultr to play with.
>They have an option to install OBSD 6.3/4. Has anyone tried these? I 
>attempted the FBSD one in the past, but the default install was all
>whacked out and I had to start over with a fresh install.
>
>Thanks,
>
>Edgar

Normally a lurker here. With that out of the way, I have a 6.3 running.
I can't remember though if I installed it myself or used their default
install. One problem I had was with ntp continually drifting by hours
and days. After searching for a solution for a very long time I reached
out to their support. They made a change and with my permission they
restarted the instance and it has been trouble free for months. It's a
very simple static site made with Hugo at davidscooley.com.



Re: vultr

2019-01-05 Thread Misc User

On 1/5/2019 2:22 PM, ed...@pettijohn-web.com wrote:

I was thinking about spinning up a new instance on vultr to play with.
They have an option to install OBSD 6.3/4. Has anyone tried these? I
attempted the FBSD one in the past, but the default install was all
whacked out and I had to start over with a fresh install.

Thanks,

Edgar

The default is alright, but comes with keys and passwords they 
generated, plus they do a single-partition scheme on the smaller disk 
instances and the auto partition on the others.  Good for a general 
purpose machine, but not so great if you have a specific task in mind. 
They also tend to install all the sets.


But since they let you upload an ISO and give you full console access, I 
just do a fresh install and customize as much as I want for the system I 
am building.  Usually so I can get a good partitioning scheme set up 
(256m on /, /home, /tmp, /usr/local, /var and swap; with a 1g /usr and 
swap) so I can dedicate 15g (Or more) to a partition for whatever task 
the machine was built for.


-CA



vultr

2019-01-05 Thread edgar
I was thinking about spinning up a new instance on vultr to play with.
They have an option to install OBSD 6.3/4. Has anyone tried these? I 
attempted the FBSD one in the past, but the default install was all
whacked out and I had to start over with a fresh install.

Thanks,

Edgar



Re: browser security in OpenBSD

2019-01-05 Thread Chris Bennett
On Sat, Jan 05, 2019 at 03:38:16PM +0200, Mihai Popescu wrote:
> Hello,
> 
> I see there is some work in Chromium to implement secure browsing. I
> was using both Chromium and Firefox over the past years. If I got it
> right, here is a summary of implementations:
> Chromium: W^X, pledge, unveil
> Firefox: W^X
> 

I'm going to throw in the question of how is upstream itself a question
of security.
These are very big moving targets.
Are they proceeding cautiously forward or hell burnt for leather at any
cost?
I guess a good metaphor would be OpenBSD constantly breaking httpd and
pf in order to make them more secure. And releasing broken versions.
Is upstream doing this sort of thing as they develop?

I also agree, no browser war. I have to use both. Each one fails at
something important I do.

Chris Bennett




No network with latest snap (5jan-19)

2019-01-05 Thread Christer Solskogen
On my APU2 I got no network with the latest snap.

I get this in the console:
starting network
ifconfig: SIOCSETPFSYNC: Invalid argument
ifconfig: SIOCSVH: Invalid argument
ifconfig: SIOCSETPFSYNC: Invalid argument

OpenBSD 6.4-current (GENERIC.MP) #562: Sat Jan  5 04:37:18 MST 2019
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP


browser security in OpenBSD

2019-01-05 Thread Mihai Popescu
Hello,

I see there is some work in Chromium to implement secure browsing. I
was using both Chromium and Firefox over the past years. If I got it
right, here is a summary of implementations:
Chromium: W^X, pledge, unveil
Firefox: W^X

I don't want to start a brosers' war, but what is best to run strictly
from security point of view at this time?

Thanks.



Re: Request for testing

2019-01-05 Thread Otto Moerbeek
On Fri, Jan 04, 2019 at 06:42:18PM +0100, Otto Moerbeek wrote:

> On Fri, Jan 04, 2019 at 06:31:50PM +0200, Mihai Popescu wrote:
> 
> > > 2. Apply diff, build and install userland.
> > Is Xenocara/X considered as userland?
> > 
> > > MALLOC_OPTIONS=++ chrome
> > Do one needs to compile chromium port for this?
> > 
> > I can do some testing of application, but I am not sure if I can
> > finish kernel/userland compile actions correctly.
> > 
> 
> ATM you need to build the base system, but no need to build chrome if you
> install it from a snap.
> 
> But this diff will be in snaps soon, so then it amounts to installing
> a snap and making sure yourt packages are up to date (as old packages
> may use an older libc without the diff).
> 
>   -Otto
> 

The diff is in snaps. You can use snaps dated later than now for testing.

-Otto



Re: Advice on Security Cameras

2019-01-05 Thread Paolo Aglialoro
Hi,

zoneminder is, as Stuart said, overcomplicated, plus unmantained and unable
to catch the more modern streams from IP cams.
The best free alternative is SHINOBI https://shinobi.video which is based
on java and ported on linux, mac and wi(n)dows, I do not know it it would
be feasible an OpenBSD port (theorically yes
https://gitlab.com/Shinobi-Systems/Shinobi/tree/master/INSTALL contains the
stuff).

On amd64 platform it works great!
I am soon going to install it on an ODROID-HC1, although I read around that
on arm (unsupported) platform motion detection is crippled.


On Fri, Jan 4, 2019 at 7:07 PM Stuart Henderson  wrote:

> On 2019-01-01, kayasaman  wrote:
> > Hi. For this type of setup Zoneminder is great. I have no experience
> running it on OpenBSD though.
>
> There is an unfinished zoneminder port in openbsd-wip. I must say the
> architecture looked rather overcomplicated to me ..
>
> multimedia/motion is simpler and supports uvideo and some network cameras
> but maybe too simple.
>
> > As for cameras have you looked at HikVision? They are very reasonable
> pricewise when compared with say Axis.
>
> HikVision and Dahua have good reasonably-priced cameras. I don't know
> about other markets but in the UK most of these seem to stop their
> distributors showing prices publically. (There was a point hikvision
> tried to restrict distribution to only "official" installers too, but
> this stupidity seems to have subsided a bit since). Haven't tried them
> via OpenBSD though. (Most of the decent installations I have seen use
> Milestone's software on Windows which they are fairly happy with).
>
> I wouldn't say anything good for security for any of this type of device.
> It is all crap. IMHO put cams on at least a dedicated vlan if not fully
> separate network infrastructure and don't let them have access to or from
> the internet. If you need to connect to them from outside the network,
> bounce your connections off another machine.
>
> Another reply mentioned onvif. This is no magic "it will do useful
> things" bullet and it is pretty bare bones. If you have software in
> mind then look for cameras particularly listed as being supported.
>
>
>