Re: Git(Hub) and CVS

2018-01-20 Thread Kristaps Dzonsons
> I'm guessing the cvs2git version changed in the upgrade and the new version
> generates different commit hashes from the old one.  You can verify this by
> comparing how a known commit shows up on the GitHub UI vs. a git log of a
> recent cvs2git conversion: if the "commit XXX" strings differ, that's
> our culprit.
> 
> If you don't care about preserving the hashes of the old commits on GitHub,
> then what you probably want is `git push --mirror origin`.  It does exactly
> what it sounds like, mirroring the current state of the entire repo to the
> remote.  (Doing this means that people won't be able to git pull without
> --rebase on checkouts of your repository made prior to the cvs2git upgrade,
> and if there are any antediluvian forks of it on GitHub the UI may get
> confused trying to figure out their relation.)
> 
> If you DO care about preserving the commits with the old hashes on GitHub
> then I don't know how to do better than Anton's suggestion, though I think
> you'll still encounter problems with tags... you'd have to take the --tags
> off your push command and come up with some system for pushing new tags
> individually.

Lari,

Modifying the script with "--mirror" as suggested by you and a private
message fixed this for me.  For completeness:

 cd /a/tmp/path
 cvs2git --blobfile=git-blob.dat \
   --dumpfile=git-dump.dat \
   --username=mymail /path/to/REPO
 mkdir $1.git
 cd $1.git
 git init
 cd .git
 git fast-import --export-marks=../../git-marks.dat < ../../git-blob.dat
 git fast-import --import-marks=../../git-marks.dat < ../../git-dump.dat
 git remote add origin https://github.com/account/REPO.git
 cd ..
 git checkout
 git push origin --mirror # This fixed everything.

This worked beautifully.  Thanks again for the help!

Best,

Kristaps



History documentation

2018-01-20 Thread mazocomp
Hi!
Both obsd-faq.txt and pf-faq.txt in pub/OpenBSD/doc/ are same as
obsd-faq52.txt and pf-faq52.txt in pub/OpenBSD/doc/history/
So I wonder is there a point to keep them out of date?



Re: usewithtor lynx core: pledge "getpw", syscall 33

2018-01-20 Thread Sebastien Marie
On Sat, Jan 20, 2018 at 07:13:54PM +, clematis wrote:
> Hello,
> 'usewithtor' (torsocks) works fine with ftp and ssh but it will core
> with lynx. 
> running: usewithtor lynx
> will start lynx, resolve openbsd.org but core when trying to make the
> http connection.
> In /var/log/messages I get: /bsd: lynx[26197]: pledge "getpw", syscall 33
> 
> And running gdb lynx then core lynx.core: 
> ---
> Reading symbols from /usr/libexec/ld.so...done.   
>   
>
> Loaded symbols for /usr/libexec/ld.so 
>   
>
> #0  access () at -:3  
>   
>
> 3   -: No such file or directory. 
>   
>
> in -  
>   
>
> Current language:  auto; currently asm
> ---
> 
> same result using 'torsocks' directly and not 'usewithtor' or trying
> lynx http://openbsd.org

I will reply mainly on the pledge aspect.

The way torsocks is done is to replace some syscall/libc libary calls by
other ones (by using LD_PRELOAD trick). The replaced functions are
network related (connect(2) for example) in order to catch TCP
connection and replacing it by another one wrapper on SOCKS protocol
(connect to proxy, ask for particular terminaison point, and pass it
to program stuff).

It is some sort of MITM, but at the code program level.

The pledge(2) policy done for lynx assumes a specific behaviour. By
replacing some code by another, torsocks did some additional stuff not
in the initial pledge policy (getting information on users with getpw
family here), and the kernel detects this pledge violation.
 
> Config: OpenBSD current + lynx-2.8.9pl16 + torsocks-1.2p4
> 
> Any idea on how to torify lynx?

the simpler would be to use lynx options to connect to SOCKS proxy. I am
unsure the current code has this possibility. But as it have HTTP proxy
support, a way could be to have an HTTP proxy listener which forward its
traffic to SOCKS upstream server. Polipo is a program of this kind (see
socksParentProxy="localhost:9050" and socksProxyType=socks5 parameters
on polipo config file).

-- 
Sebastien Marie



usewithtor lynx core: pledge "getpw", syscall 33

2018-01-20 Thread clematis
Hello,
'usewithtor' (torsocks) works fine with ftp and ssh but it will core
with lynx. 
running: usewithtor lynx
will start lynx, resolve openbsd.org but core when trying to make the
http connection.
In /var/log/messages I get: /bsd: lynx[26197]: pledge "getpw", syscall 33

And running gdb lynx then core lynx.core: 
---
Reading symbols from /usr/libexec/ld.so...done. 

   
Loaded symbols for /usr/libexec/ld.so   

   
#0  access () at -:3

   
3   -: No such file or directory.   

   
in -

   
Current language:  auto; currently asm
---

same result using 'torsocks' directly and not 'usewithtor' or trying
lynx http://openbsd.org


Config: OpenBSD current + lynx-2.8.9pl16 + torsocks-1.2p4

Any idea on how to torify lynx?

Thanks,
-- 
clematis (0x7e96fd2400fe7b59)



Re: Git(Hub) and CVS

2018-01-20 Thread Kristaps Dzonsons
>> I know many here are using CVS, and many are also using git, so I wonder
>> if anybody can help me.  On BSD.lv, I push my CVS repositories (kcgi,
>> sblg, etc.) to GitHub from time to time using a cvs2git script.  It goes
>> as follows, shortened and pseudonymised:
>>
>>  REPO=$1  # e.g., kcgi
>>  cd /tmp/cvs2git
>>  cvs2git --blobfile=git-blob.dat \
>>--dumpfile=git-dump.dat \
>>--username=kristaps@me \
>>/path/to/cvsroot/$REPO
>>  mkdir $REPO.git
>>  cd $REPO.git
>>  git init
>>  cd .git
>>  git fast-import \
>>--export-marks=../../git-marks.dat < ../../git-blob.dat
>>  git fast-import \
>>--import-marks=../../git-marks.dat < ../../git-dump.dat
>>  git remote add origin https://github.com/account/$REPO.git
>>  cd ..
>>  git checkout
> 
> Prior pushing, have you tried;
> 
>   $ git fetch
>   $ git branch -u origin/master
>   $ git rebase

Anton,

Thanks for taking a look!  Results of running this after the checkout:

 % git fetch


 ...
 From https://github.com/account/REPO
  * [new branch]  master -> origin/master
 % git branch -u origin/master
 Branch master set up to track remote branch master from origin.
 % git rebase
 First, rewinding head to replay your work on top of it...
 Applying:
 Using index info to reconstruct a base tree...
  [...stuff about white-space...]
 warning: 3 lines add whitespace errors.
 Falling back to patching base and 3-way merge...
 Auto-merging source.c
 CONFLICT (add/add): Merge conflict in source.c
  [...a few more messages like that...]
 error: Failed to merge in the changes.
 Patch failed at 0001
 The copy of the patch that failed is found in: .git/rebase-apply/patch

 When you have resolved this problem, run "git rebase --continue".
 If you prefer to skip this patch, run "git rebase --skip" instead.
 To check out the original branch and stop rebasing, run "git rebase
--abort".

Any further ideas?  I wish I could be more helpful, but my git fu is weak.

Best,

Kristaps