Re: Unpriviliged wkhtmltopdf binary invocation fails with core dump

2018-04-23 Thread Bogdan Kulbida
Andrew,

The ‘-n’ flag did help and resolved an issue.
You have no idea how much I appreciate your help!

I’m interested to know why it failed w/ js enabled. Would you mind to share
that, or point me into the direction where to find the answer?

Best,
Bogdan

On Mon, Apr 23, 2018 at 14:53 Andrew  wrote:

> On 04/23/18 15:50, Bogdan Kulbida wrote:
> >Hi Everyone,
> >
> >I'm trying to use wkhtmltopdf to generate PDF from my HTML files. I
> >was googling like crazy but did no find any valuable information so
> >far.
> >When I run (as root)
> >
> ># /usr/local/bin/wkhtmltopdf http://google.com /tmp/out.pdf
> >
> >It does generate pdf just fine. But when I run the same command as
> >unprivileged user I got
> >Trace/BPT trap (core dumped) ] 10%
>
> Bogdan,
>
> See if this helps. As an unprivileged user, try the -n switch to disable
> javascript -- e.g. wkhtmltopdf -n [args].
>
> -A
>
> PS: A related package is htmldoc -- but I haven't tried it out yet.
>
> --

---
Best regards,
Bogdan Kulbida
CEO/CTO, Konstankino LLC 
+1.802.793.8295


Re: cloning to smaller hard disk

2018-04-23 Thread Nick Holland
On 04/22/18 14:46, Tuyosi T wrote:
> hi all .
> i manage to clone bigger HDD(sd1) to smaller HDD(sd0)
> 
> this is dangerous , so please test .
> and there may be some errors , then please point them out .

Ok, how do I put this nicely...

PLEASE DON'T DO THIS KIND OF "documentation".  Ok, you accomplished your
task.  Congrats, I'm proud of you.  But your initial config was bad,
your final config was bad, and your process was trivial and very
specific to your config.  Your "documentation" doesn't explain the WHY
of what you do, or the VERY special (and wrong) case of your config that
allowed this to work.  It's not a teaching document.

While I'm a big defender of free speech, this is not helpful in the way
you probably intended.  If your goal is training people to think before
they follow stuff they find on the 'net, great, ok, I guess -- nothing
teaches like a bullet in the foot.  But I don't think that was your goal.

Your initial system and final system were One Big Partition layouts --
Bad idea.  And you copied over just the 'a' partition.  Useless for the
recommended OpenBSD config.  And tar has trouble with really long paths.

And really, your task is simple --
* Boot the system with the new disk attached.
* Stop all processes you can that are changing important data on the
disk.  Can also be done by booting from bsd.rd.
* If you booted from bsd.rd, you will probably need to /dev/MAKEDEV
[sw]d1, as bsd.rd has only one sd and wd device.
* fdisk (if needed) and disklabel your new disk.  For simplicity, I'll
assume same disklabel setup on the new disk and old.
* newfs all the new partitions
* for each FS,
   * Mount the new one somewhere
   * dump | restore each existing partition to the new partition.
   * umount the new partition.
* Set up the boot code on the new disk.

Interestingly, that's basically the process for any Unix-Like OS (ULOS).
 The last step (set up the boot code) will vary tremendously from ULOS
to ULOS, and SELinux will require some voodoo that few understand to
make things work after moving them in the name of security.

Nick.



Re: 6.3/amd64 Thinkpad T530 touchpad problem (was ok in 6.2/amd64)

2018-04-23 Thread Ulf Brosziewski
Hi Jonathan,

would you mind to make further tests in order to help us to
identify the cause of that phenomenon?

First, could you deactivate synaptics again, start X and
capture the output of
# wsconsctl | grep mouse
when the touchpad has started to produce nonsense? (You must run
that command as root or configure doas(1) for it). And btw, does
the trackpoint work normally when this happens?


On 04/23/2018 10:14 PM, Jonathan Thornburg wrote:
> On Sun, Apr 22, 2018 at 12:48:11AM +0300, IL Ka wrote:
>> +1 for trying synaptics(4).
> [[...]]
> 
> Success!  With synaptics(4) enabled via the xorg.conf you suggested
> in , the
> touchpad works perfectly.  (I haven't experimented with multitouch
> gestures yet.)
> 
> Thanks to both of you (IL and Ulf) for pointing me to the solution!
> 
> ciao,
> 



Re: Unpriviliged wkhtmltopdf binary invocation fails with core dump

2018-04-23 Thread Andrew

On 04/23/18 15:50, Bogdan Kulbida wrote:

Hi Everyone,

I'm trying to use wkhtmltopdf to generate PDF from my HTML files. I
was googling like crazy but did no find any valuable information so
far.
When I run (as root)

# /usr/local/bin/wkhtmltopdf http://google.com /tmp/out.pdf

It does generate pdf just fine. But when I run the same command as
unprivileged user I got
Trace/BPT trap (core dumped) ] 10%


Bogdan, 


See if this helps. As an unprivileged user, try the -n switch to disable
javascript -- e.g. wkhtmltopdf -n [args]. 


-A

PS: A related package is htmldoc -- but I haven't tried it out yet.



Re: 6.3/amd64 Thinkpad T530 touchpad problem (was ok in 6.2/amd64)

2018-04-23 Thread Jonathan Thornburg
On Sun, Apr 22, 2018 at 12:48:11AM +0300, IL Ka wrote:
> +1 for trying synaptics(4).
[[...]]

Success!  With synaptics(4) enabled via the xorg.conf you suggested
in , the
touchpad works perfectly.  (I haven't experimented with multitouch
gestures yet.)

Thanks to both of you (IL and Ulf) for pointing me to the solution!

ciao,
-- 
-- "Jonathan Thornburg [remove -animal to reply]" 

   Dept of Astronomy & IUCSS, Indiana University, Bloomington, Indiana, USA
   currently visiting Max-Plack-Institute fuer Gravitationsphysik
  (Albert-Einstein-Institut), Potsdam-Golm, Germany
   "There was of course no way of knowing whether you were being watched
at any given moment.  How often, or on what system, the Thought Police
plugged in on any individual wire was guesswork.  It was even conceivable
that they watched everybody all the time."  -- George Orwell, "1984"



Unpriviliged wkhtmltopdf binary invocation fails with core dump

2018-04-23 Thread Bogdan Kulbida
Hi Everyone,

I'm trying to use wkhtmltopdf to generate PDF from my HTML files. I
was googling like crazy but did no find any valuable information so
far.
When I run (as root)

# /usr/local/bin/wkhtmltopdf http://google.com /tmp/out.pdf

It does generate pdf just fine. But when I run the same command as
unprivileged user I got
Trace/BPT trap (core dumped) ] 10%

This is how `ldd` output looks like:

web$ ldd /usr/local/bin/wkhtmltopdf
/usr/local/bin/wkhtmltopdf:
StartEnd  Type  Open Ref GrpRef Name
0ab734d0 0ab737ef7000 exe   20   0
/usr/local/bin/wkhtmltopdf
0ab99bee9000 0ab99c15e000 rlib  01   0
/usr/local/lib/libjpeg.so.68.1
0ab97f467000 0ab97f6a1000 rlib  01   0
/usr/local/lib/libpng.so.17.5
0ab966451000 0ab96665b000 rlib  01   0
/usr/X11R6/lib/libXrender.so.6.0
0ab9c1255000 0ab9c149d000 rlib  01   0
/usr/X11R6/lib/libfontconfig.so.11.0
0ab9db822000 0ab9dbae5000 rlib  02   0
/usr/X11R6/lib/libfreetype.so.28.2
0ab9db221000 0ab9db433000 rlib  01   0
/usr/X11R6/lib/libXext.so.13.0
0ab99d159000 0ab99d49c000 rlib  03   0
/usr/X11R6/lib/libX11.so.16.1
0aba030a5000 0aba032bc000 rlib  03   0
/usr/lib/libz.so.5.0
0aba0643c000 0aba06664000 rlib  02   0
/usr/lib/libm.so.10.1
0ab9b1757000 0ab9b1a54000 rlib  01   0
/usr/local/lib/libiconv.so.6.0
0ab9a240e000 0ab9a26ce000 rlib  01   0
/usr/lib/libc++.so.1.0
0ab94b1bb000 0ab94b41b000 rlib  01   0
/usr/lib/libc++abi.so.0.0
0aba1dffc000 0aba1e205000 rlib  01   0
/usr/lib/libpthread.so.25.1
0ab9bf67a000 0ab9bf95a000 rlib  01   0
/usr/lib/libc.so.92.3
0ab9a2bce000 0ab9a2df9000 rlib  03   0
/usr/X11R6/lib/libxcb.so.4.0
0ab9af568000 0ab9af793000 rlib  01   0
/usr/lib/libexpat.so.12.0
0ab9b26d 0ab9b28d4000 rlib  01   0
/usr/X11R6/lib/libXau.so.10.0
0ab9d8f45000 0ab9d914b000 rlib  01   0
/usr/X11R6/lib/libXdmcp.so.11.0
0ab997e0 0ab997e0 ld.so 01   0
/usr/libexec/ld.so

The file dump is ~10Mb I did not want to include it unless you ask for it...

Please help. Thank you.

---
Best,
Bogdan



Re: sshfuse: fusefs: libfuse vnode reclaim failed

2018-04-23 Thread Rudolf Sykora
Well it happened again along the same lines..., showing
'libfuse vnode reclaim failed'
And again uninterruptable, unkillable, unrebootable system, only
power button helped.

So isn't there really any way to kill such a beast?

(
I use 6.3. The line I use to start sshfs is basically just
doas sshfs $MACHINE $MOUNTPOINT -o uid=1000 -o gid=1000
)


On 20 April 2018 at 02:34, IL Ka  wrote:
> First, make sure your SSH connection is stable.

I believe I can say it is stable.
(From the other-systems experience.)

But anyway, even if it were unstable, I thought the system
should never enter a state where it has to be unplugged...


> If it works, then we can try
> to investigate it:
>
>
>> libfuse vnode reclaim failed
>
> This message is from following code:
> if (fb_queue(fmp->dev, fbuf))
> printf("fusefs: libfuse vnode reclaim failed\n");
>
> "fuse_lookup.c"
>
> As we can see, "fb_queue" retruns error, but we do not know
> which error.
>
> I think we need to know this error to understand what happened.
>
> In "fb_queue" source (fusebuf.c) we can see that error is
> return code from "tsleep" or "fbuf->fb_err".
>
>
> This code is part of this commit:
> https://github.com/openbsd/src/commit/5e69e0b69176a7f878c899ef5828a6273ab7f0bb
> Written by https://github.com/natano , while file originally written by
> Sylvestre Gallon 
>
> So, you have 2 options here:
>
> Debug it yourself by kernel debugging (gdb)
> or patch kernel and print this error value to kernel log
> (printf(9)) (could be good contribution to kernel btw)
>
> Or you can write to tech@ or bugs@
> about this problem and wait for developer's attention.

So I should probably write to bugs@...

Thanks
Ruda



Re: doas id -ru returns 0 ?

2018-04-23 Thread Rudolf Sykora
On 23 April 2018 at 17:19, Philip Guenther  wrote:
> On Mon, Apr 23, 2018 at 4:53 PM, Rudolf Sykora 
> wrote:
>>
>> I expected that
>>
>> doas id -ru
>>
>> would return my uid.
>>
>> But it returns 0 (ie root)
>>
>> Can anybody comment on it?
>
>
> Hmm, what led you to expect it to return your UID?
>
> doas, like su, sets both the effective and real UID to the target user's;
> running something with doas is not the same as making it setuid and running
> it.  Running with effective!=real can trip up programs that didn't expect
> it, so it not a safe choice for something like doas.

Aha. Thanks for the explanation!
I thought it's more like setuid...
Sorry.

Ruda



Re: doas id -ru returns 0 ?

2018-04-23 Thread Philip Guenther
On Mon, Apr 23, 2018 at 4:53 PM, Rudolf Sykora 
wrote:

> I expected that
>
> doas id -ru
>
> would return my uid.
>
> But it returns 0 (ie root)
>
> Can anybody comment on it?
>

Hmm, what led you to expect it to return your UID?

doas, like su, sets both the effective and real UID to the target user's;
running something with doas is not the same as making it setuid and running
it.  Running with effective!=real can trip up programs that didn't expect
it, so it not a safe choice for something like doas.


Philip Guenther


doas id -ru returns 0 ?

2018-04-23 Thread Rudolf Sykora
Hello,

I expected that

doas id -ru

would return my uid.

But it returns 0 (ie root)

Can anybody comment on it?

Thanks
Ruda



poster for 6.3

2018-04-23 Thread Clemens Gößnitzer
Will there be a poster for OpenBSD 6.3? Or is it possible to get the 
high-resolution image of https://www.openbsd.org/images/Harry.gif? And 
maybe even for 6.1? I still have some doors left for great OpenBSD 
posters :)


Thanks again for a great new version! Donation will be on its way :)
Clemens



Re: kernel relink segfaults on ALIX

2018-04-23 Thread Jan Stary
On Apr 19 08:52:38, h...@stare.cz wrote:
> This is a fresh upgrade of current/i386 on an ALIX 2D3.
> Upon start, kernel relinking fails, with relink.log saying:
> 
> (SHA256) /bsd: OK
> LD="ld" LDFLAGS="-g" sh makegap.sh 0x
> ld -T ld.script -X --warn-common -nopie -o newbsd ${SYSTEM_HEAD} vers.o 
> ${OBJS}
> Segmentation fault (core dumped) 
> *** Error 139 in /usr/share/relink/kernel/GENERIC (Makefile:1045 'newbsd': 
> @echo ld -T ld.script -X --warn-common -nopie -o newbsd '${SYSTEM...)
> 
> /usr/share/relink is empty, with
> /dev/wd0d 1001M801M150M84%/usr

On Apr 19 17:16:45, dtuc...@dtucker.net wrote:
> Do you have any swap configured?  Relinking takes a reasonable amount
> of ram and the ALIX doesn't have a lot.

That was it, thank you. With some swap added
it relinks the kernel fine. Right after boot, it's

$ swapctl -s
total: 4192960 512-blocks allocated, 127768 used, 4065192 available

Jan