security/password-store to 1.7.4 (maintainer update)

2021-07-22 Thread David Dahlberg
Hi *,

heres an update of pass(1) from 1.7.3 to 1.7.4.

While at it, also fix a POSIX basic RE for sed(1), which prevented
an optimization when re-encrypting to same key set. Now "make test" is
happy, too.

Should my mail program destroy the patch, here's a downloadable copy:
https://cloud.dahlberg.cologne/index.php/s/SS5BRNLRJyRDrSy

[repost due to missing recipient]
Index: Makefile
===
RCS file: /cvs/ports/security/password-store/Makefile,v
retrieving revision 1.8
diff -u -p -u -r1.8 Makefile
--- Makefile	5 Oct 2020 19:46:18 -	1.8
+++ Makefile	22 Jul 2021 11:09:33 -
@@ -2,8 +2,7 @@
 
 COMMENT =	simple password store
 
-DISTNAME =	password-store-1.7.3
-REVISION =	0
+DISTNAME =	password-store-1.7.4
 
 CATEGORIES =	security
 
Index: distinfo
===
RCS file: /cvs/ports/security/password-store/distinfo,v
retrieving revision 1.4
diff -u -p -u -r1.4 distinfo
--- distinfo	23 Aug 2018 08:19:02 -	1.4
+++ distinfo	22 Jul 2021 11:09:33 -
@@ -1,2 +1,2 @@
-SHA256 (password-store-1.7.3.tar.xz) = K2xlhG66zpoVoRhQPc0xtkQJSaMNO1KR37WxYVuZo/Q=
-SIZE (password-store-1.7.3.tar.xz) = 63416
+SHA256 (password-store-1.7.4.tar.xz) = z6n69lny7Ws456fD+0Phd9AO26zGJl5uMiFf9A43k8A=
+SIZE (password-store-1.7.4.tar.xz) = 65272
Index: patches/patch-src_password-store_sh
===
RCS file: /cvs/ports/security/password-store/patches/patch-src_password-store_sh,v
retrieving revision 1.5
diff -u -p -u -r1.5 patch-src_password-store_sh
--- patches/patch-src_password-store_sh	5 Oct 2020 19:46:18 -	1.5
+++ patches/patch-src_password-store_sh	22 Jul 2021 11:09:33 -
@@ -2,7 +2,16 @@ $OpenBSD: patch-src_password-store_sh,v 
 Index: src/password-store.sh
 --- src/password-store.sh.orig
 +++ src/password-store.sh
-@@ -324,7 +324,7 @@ cmd_init() {
+@@ -129,7 +129,7 @@ reencrypt_path() {
+ 			done
+ 			gpg_keys="$($GPG $PASSWORD_STORE_GPG_OPTS --list-keys --with-colons "${GPG_RECIPIENTS[@]}" | sed -n 's/^sub:[^idr:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[a-zA-Z]*e[a-zA-Z]*:.*/\1/p' | LC_ALL=C sort -u)"
+ 		fi
+-		current_keys="$(LC_ALL=C $GPG $PASSWORD_STORE_GPG_OPTS -v --no-secmem-warning --no-permission-warning --decrypt --list-only --keyid-format long "$passfile" 2>&1 | sed -n 's/^gpg: public key is \([A-F0-9]\+\)$/\1/p' | LC_ALL=C sort -u)"
++		current_keys="$(LC_ALL=C $GPG $PASSWORD_STORE_GPG_OPTS -v --no-secmem-warning --no-permission-warning --decrypt --list-only --keyid-format long "$passfile" 2>&1 | sed -n 's/^gpg: public key is \([A-F0-9]\{1,\}\)$/\1/p' | LC_ALL=C sort -u)"
+ 
+ 		if [[ $gpg_keys != "$current_keys" ]]; then
+ 			echo "$passfile_display: reencrypting to ${gpg_keys//$'\n'/ }"
+@@ -344,7 +344,7 @@ cmd_init() {
  		fi
  		rmdir -p "${gpg_id%/*}" 2>/dev/null
  	else
@@ -11,24 +20,24 @@ Index: src/password-store.sh
  		printf "%s\n" "$@" > "$gpg_id"
  		local id_print="$(printf "%s, " "$@")"
  		echo "Password store initialized for ${id_print%, }${id_path:+ ($id_path)}"
-@@ -382,7 +382,10 @@ cmd_show() {
+@@ -402,7 +402,10 @@ cmd_show() {
  		else
  			echo "${path%\/}"
  		fi
--		tree -C -l --noreport "$PREFIX/$path" | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' # remove .gpg at end of line, but keep colors
+-		tree -N -C -l --noreport "$PREFIX/$path" | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' # remove .gpg at end of line, but keep colors
 +		# remove .gpg at end of line, but keep colors
-+		colortree -C -l --noreport "$PREFIX/$path" \
++		colortree -N -C -l --noreport "$PREFIX/$path" \
 +			| tail -n +2 \
 +			| sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g'
  	elif [[ -z $path ]]; then
  		die "Error: password store is empty. Try \"pass init\"."
  	else
-@@ -394,14 +397,16 @@ cmd_find() {
+@@ -414,14 +417,16 @@ cmd_find() {
  	[[ $# -eq 0 ]] && die "Usage: $PROGRAM $COMMAND pass-names..."
  	IFS="," eval 'echo "Search Terms: $*"'
  	local terms="*$(printf '%s*|*' "$@")"
--	tree -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g'
-+	colortree -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" \
+-	tree -N -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g'
++	colortree -N -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" \
 +		| tail -n +2 \
 +		| sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g'
  }
@@ -42,7 +51,7 @@ Index: src/password-store.sh
  		[[ $? -ne 0 ]] && continue
  		passfile="${passfile%.gpg}"
  		passfile="${passfile#$PREFIX/}"
-@@ -433,7 +438,7 @@ cmd_insert() {
+@@ -453,7 +458,7 @@ cmd_insert() {
  
  	[[ $force -eq 0 && -e $passfile ]] && yesno "An entry already exists for $path. Overwrite it?"
  
@@ -51,7 +60,7 @@ Index: 

Re: sysutils/hw-probe: only add the dmidecode dependency for i386 and amd64

2020-11-20 Thread David Dahlberg
On Fri, 2020-11-20 at 13:29 +0800, Kevin Lo wrote:

> hw-probe could run on non-x86 architectures.
> Tested on arm64 [1] and octeon [2].
[..]
> +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
> +RUN_DEPENDS += sysutils/dmidecode
> +.endif

Hmm, although dmidecode does only package for i386 and amd64 on OpenBSD,
dmidecode is also available for ia64 and arm64 in principle.

OTOH, dmidecode requires kern.allowkmem=1 in securelevel=0, which at
least I do not usually do. So I thought shortly about completely
removing the dependency and adding a pkg-readme.

But finally, hw-probe 'as-is' tests for the availability of dmidecode
exactly on i386 and amd64 BSDs, which is reflected in your patch.

So for me it's OK, I'd say.



Re: New: hw-probe-1.6

2020-08-11 Thread David Dahlberg
On Mon, 2020-08-10 at 13:21 +0100, Stuart Henderson wrote:
> - the PKGNAME hw-probe-1.6-beta is invalid, -beta is using the part of
> the name that is reserved for a flavour. Should set e.g. PKGNAME=hw-
> probe-1.6beta

Thank you Stuart. I finally found packages-specs(7) which expains the
full matching.

> - looks like the default if you just run "hw-probe" is to upload data
> to an internet server. there should be a warning about this somewhere,
> at least in pkg/DESCR.

Updated DESCR to reflect that.
Additionally fixed some whitespace errors.



hw-probe.tgz
Description: application/compressed-tar


New: hw-probe-1.6

2020-08-10 Thread David Dahlberg
Hi ports@

Find attached a port of hw-probe, which is the system configuration
upload tool of linux-hardware.org/bsd-hardware.org.

A few questions/remarks though: The tool is dual-licenced BSD-4/LGPL-
2.1+. Do I have to pick the licence files and install them somewhere?

Second, the tool would like do obtain kmem for dmidecode(8). I
personally would not add any MESSAGE or README mentioning the right
sysctl(2), because (a) the tool works well enough without and I would
not generally recommend setting it (needs securelevel=0) and (b) the
tool yells the appropriate command at you anyways.

Tested package and tool on several amd64 machines. On the one old i386
that I still have in use, the package builds and installs fine, but the
tool throws me into ddb - OTOH, a lot of things do that on that machine.


hw-probe.tgz
Description: application/compressed-tar


[UPDATE] sysutils/colortree

2018-12-26 Thread David Dahlberg
Hi ports@

maintainer update from colortree-1.7.0 to -1.8.0.

Changelog of colortree is here:
http://mama.indstate.edu/users/ice/tree/changes.html

On ports side it's nothing very interesting, mainly an increment in the
version number and a plist update. I also changed two occurences of
"system(tree)" to "system(colortree)" to unbreak the -HP flag combo.

Diff is attached, so that evolution will not destroy those very long
lines.

David

Index: Makefile
===
RCS file: /cvs/ports/sysutils/colortree/Makefile,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 Makefile
--- Makefile	23 Apr 2016 14:08:41 -	1.3
+++ Makefile	26 Dec 2018 13:29:55 -
@@ -2,11 +2,10 @@
 
 COMMENT =	print a tree of the directory structure
 
-V =		1.7.0
+V =		1.8.0
 DISTNAME =	tree-$V
 PKGNAME=	colortree-$V
 CATEGORIES =	sysutils
-REVISION =	1
 
 HOMEPAGE =	http://mama.indstate.edu/users/ice/tree/
 
Index: distinfo
===
RCS file: /cvs/ports/sysutils/colortree/distinfo,v
retrieving revision 1.1.1.1
diff -u -p -u -p -r1.1.1.1 distinfo
--- distinfo	17 Aug 2015 09:07:22 -	1.1.1.1
+++ distinfo	26 Dec 2018 13:29:55 -
@@ -1,2 +1,2 @@
-SHA256 (tree-1.7.0.tgz) = aVfCDoJWGsQjFjiZbnT0z6Tm+qvFovUR8LTjlA6PexI=
-SIZE (tree-1.7.0.tgz) = 47082
+SHA256 (tree-1.8.0.tgz) = cV1dS0NDIc50cG0N0GdQW7YMXqg7Xws2VdrkCqb5t8I=
+SIZE (tree-1.8.0.tgz) = 50286
Index: patches/patch-doc_tree_1
===
RCS file: /cvs/ports/sysutils/colortree/patches/patch-doc_tree_1,v
retrieving revision 1.1.1.1
diff -u -p -u -p -r1.1.1.1 patch-doc_tree_1
--- patches/patch-doc_tree_1	17 Aug 2015 09:07:22 -	1.1.1.1
+++ patches/patch-doc_tree_1	26 Dec 2018 13:29:55 -
@@ -1,18 +1,19 @@
 $OpenBSD: patch-doc_tree_1,v 1.1.1.1 2015/08/17 09:07:22 bentley Exp $
 doc/tree.1.orig	Wed Apr 23 21:39:12 2014
-+++ doc/tree.1	Sun Jul 19 19:41:39 2015
+Index: doc/tree.1
+--- doc/tree.1.orig
 doc/tree.1
 @@ -17,22 +17,22 @@
  .\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  .\"
  ...
--.TH TREE 1 "" "Tree 1.7.0"
-+.TH COLORTREE 1 "" "Colortree 1.7.0"
+-.TH TREE 1 "" "Tree 1.8.0"
++.TH COLORTREE 1 "" "Colortree 1.8.0"
  .SH NAME
 -tree \- list contents of directories in a tree-like format.
 +colortree \- list contents of directories in a tree-like format.
  .SH SYNOPSIS
--\fBtree\fP [\fB-acdfghilnpqrstuvxACDFQNSUX\fP] [\fB-L\fP \fIlevel\fP [\fB-R\fP]] [\fB-H\fP \fIbaseHREF\fP] [\fB-T\fP \fItitle\fP] [\fB-o\fP \fIfilename\fP] [\fB--nolinks\fP] [\fB-P\fP \fIpattern\fP] [\fB-I\fP \fIpattern\fP] [\fB--inodes\fP] [\fB--device\fP] [\fB--noreport\fP] [\fB--dirsfirst\fP] [\fB--version\fP] [\fB--help\fP] [\fB--filelimit\fP \fI#\fP] [\fB--si\fP] [\fB--prune\fP] [\fB--du\fP] [\fB--timefmt\fP \fIformat\fP] [\fB--matchdirs\fP] [\fB--\fP] [\fIdirectory\fP ...]
-+\fBcolortree\fP [\fB-acdfghilnpqrstuvxACDFQNSUX\fP] [\fB-L\fP \fIlevel\fP [\fB-R\fP]] [\fB-H\fP \fIbaseHREF\fP] [\fB-T\fP \fItitle\fP] [\fB-o\fP \fIfilename\fP] [\fB--nolinks\fP] [\fB-P\fP \fIpattern\fP] [\fB-I\fP \fIpattern\fP] [\fB--inodes\fP] [\fB--device\fP] [\fB--noreport\fP] [\fB--dirsfirst\fP] [\fB--version\fP] [\fB--help\fP] [\fB--filelimit\fP \fI#\fP] [\fB--si\fP] [\fB--prune\fP] [\fB--du\fP] [\fB--timefmt\fP \fIformat\fP] [\fB--matchdirs\fP] [\fB--\fP] [\fIdirectory\fP ...]
+-\fBtree\fP [\fB-acdfghilnpqrstuvxACDFQNSUX\fP] [\fB-L\fP \fIlevel\fP [\fB-R\fP]] [\fB-H\fP \fIbaseHREF\fP] [\fB-T\fP \fItitle\fP] [\fB-o\fP \fIfilename\fP] [\fB--nolinks\fP] [\fB-P\fP \fIpattern\fP] [\fB-I\fP \fIpattern\fP] [\fB--inodes\fP] [\fB--device\fP] [\fB--noreport\fP] [\fB--dirsfirst\fP] [\fB--version\fP] [\fB--help\fP] [\fB--filelimit\fP \fI#\fP] [\fB--si\fP] [\fB--prune\fP] [\fB--du\fP] [\fB--timefmt\fP \fIformat\fP] [\fB--matchdirs\fP] [\fB--fromfile\fP] [\fB--\fP] [\fIdirectory\fP ...]
++\fBcolortree\fP [\fB-acdfghilnpqrstuvxACDFQNSUX\fP] [\fB-L\fP \fIlevel\fP [\fB-R\fP]] [\fB-H\fP \fIbaseHREF\fP] [\fB-T\fP \fItitle\fP] [\fB-o\fP \fIfilename\fP] [\fB--nolinks\fP] [\fB-P\fP \fIpattern\fP] [\fB-I\fP \fIpattern\fP] [\fB--inodes\fP] [\fB--device\fP] [\fB--noreport\fP] [\fB--dirsfirst\fP] [\fB--version\fP] [\fB--help\fP] [\fB--filelimit\fP \fI#\fP] [\fB--si\fP] [\fB--prune\fP] [\fB--du\fP] [\fB--timefmt\fP \fIformat\fP] [\fB--matchdirs\fP] [\fB--fromfile\fP] [\fB--\fP] [\fIdirectory\fP ...]
  
  .br
  .SH DESCRIPTION
@@ -28,8 +29,8 @@ $OpenBSD: patch-doc_tree_1,v 1.1.1.1 201
 +arguments, \fIcolortree\fP lists the files in the current directory.  When
 +directory arguments are given, \fIcolortree\fP lists all the files and/or
 +directories found in the given directories each in turn.  Upon completion of
-+listing all files/directories found, \fIcolortree\fP returns the total number of
-+files and/or directories listed.
++listing all files/directories found, \fIcolortree\fP returns the total number
++of files and/or directories 

Re: UPDATE: security/password-store

2018-08-22 Thread David Dahlberg
Am Wednesday, den 22.08.2018, 12:08 +0200 schrieb David Dahlberg:

> >Here's a trivial update to password-store-1.7.3. [..]
> > ok?

Yes, looks good to me.

> I have a slightly bigger patch, [..]
> Will try to merge it with yours.

Sorry, it seems you did commit my patch already. Did not notice it at
first because of mail problems at that time and openports.se did not
trigger either.

Cheers
David



Re: UPDATE: security/password-store

2018-08-22 Thread David Dahlberg
Am Tuesday, den 21.08.2018, 22:57 -0600 schrieb Anthony J. Bentley:
> Here's a trivial update to password-store-1.7.3. Been using it about
> a week.
> 
> ok?

I have a slightly bigger patch, which reverts some changes that are no
longer required (mv -v etc.). Will try to merge it with yours.

Cheers,
David



Re: [ports [new] security/pass-otp

2018-03-08 Thread David Dahlberg
Am Thursday, den 08.03.2018, 08:31 + schrieb David Dahlberg:
> Am Mittwoch, den 07.03.2018, 07:25 -0700 schrieb Aaron Bieber:
> 
> > Here is a port of pass-otp an extension for security/password-store
> > that
> > lets you manage OTP entries.
> 
> I will test it, when back home this evening (CET).

The following tests failed:
append.t: Reads terminal input in noecho mode
append.t: Reads terminal input in echo mode
append.t: Prompts before overwriting key URI
insert.t: Reads terminal input in noecho mode
insert.t: Reads terminal input in echo mode
insert.t: Prompts when inserting default pass-name from terminal

-> Adding lang/expect to TEST_DEPENDS fixes this.

Otherwise the port looks good to me.

I have made only casual functional checking though, by using the
examples from https://github.com/tadfisher/pass-otp

Cheers,
David



Re: security/password-store GnuPG dependency

2017-08-20 Thread David Dahlberg


> Am 19.08.2017 um 12:16 schrieb Antoine Jacoutot :
> 
> Since the README explicitely states gnupg2, I think we should go for this, 
> even
> if gnupg1 is compatible, to prevent surprises in the future.
> OK?

Sure.
Gpg1 has somewhat lesser dependencies, but lacks default support for the 
gpg-agent, which significantly increases the usability of pass. Also 
considering recent periods of subtle incompatibilities between both versions, 
maybe it is about time to phase out gpg1 anyways.


Re: Gnome 3 (gnome-shell) crash on initialization on an x61s with Intel 965 x3100 display

2016-07-29 Thread David Dahlberg
Am Freitag, den 29.07.2016, 00:26 -0500 schrieb Justin Haynes:

> The problem is that when i attempt ot start Gnome using gdm, I get
> nothing
> but X Windows with a black background and the X mouse cursor.

Had a similar problem lately.

Please check fstab(5), whether you have nosuid configured to /usr/local.
Seems something changed recently, such that slock, gnome-settings-daemon 
and (gnome|gdm)-session-something need suid.

Re: pledge() sysutils/colortree

2016-04-27 Thread David Dahlberg
Am Mittwoch, den 27.04.2016, 00:01 -0700 schrieb steve latif:
> Updated diff:
> Added proc to the pledge list to deal with the system()  in html.c
> I missed system() as its not mentioned in the man page for pledge(2)
> Including a second diff to add system() to the man page.

As I said, I am not really fluent in analysing the used system calls, so
you should probably get additional feedback from somebody else.

Having said this, there are still things, that I did find anyway:

style in colortree.diff:
- line 16: indented by 4 spaces instead of one tab.
- line 18: two trailing spaces

pledge() in colortree.dif:
- If you follow Sebastien's remarks, pledge() should be moved at 
  past the last call of setlocale().
- If you pledge after the opening of the output file (i.e. line 454, 
  after the command-line parsing block), IMHO you can remove the 
  cpath and wpath promises, or did you find them being used 
  anywhere else after initialization?
- How confident are you, that colortree will not break those promises?



Re: pledge() sysutils/colortree

2016-04-23 Thread David Dahlberg
Am Saturday, den 23.04.2016, 16:21 +0200 schrieb Sebastien Marie:
> On Sat, Apr 23, 2016 at 03:29:33PM +0200, David Dahlberg wrote:

> > BTW, how do I cvs diff over new files?
> 1. cp file{,.orig}
> 2. edit file, and save
> 3. cd /usr/ports/.../ && make update-patches

Yes, that's documented in the Porter's Handbook. I was more looking for
Stuart's hint: "cvs add", probably was too straigt forward for me ;-)

> So I think the pledge promises are incomplete and/or the pledge call
> is
> misplaced.
[..]
> I will try to (re?)present differents ways to efficiently adds pledge
> a
> program:
[..]

Thanks a lot for your comprehensive instructions. I leaned a lot and
will have to continue to do so (esp.the mapping symbols to pledge(2)
promises part).

With what you described as the "dynamic approach", I found at least the
missing "getpw", though I seem to have skipped the "-o" argument for
some reason.

Attached is a patch that has a first pledge after setlocale, and a
second call the command line parsing, which removes write access.

I bid somebody with better C skills in using debuggers and reading
symbols than me to check, whether this should be sufficient. Steve,
didn't you volunteer? ;-) 

Cheers,
David

Index: Makefile
===
RCS file: /cvs/ports/sysutils/colortree/Makefile,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 Makefile
--- Makefile23 Apr 2016 14:08:41 -  1.3
+++ Makefile23 Apr 2016 18:32:23 -
@@ -6,7 +6,7 @@ V = 1.7.0
 DISTNAME = tree-$V
 PKGNAME=   colortree-$V
 CATEGORIES =   sysutils
-REVISION = 1
+REVISION = 2
 
 HOMEPAGE =     http://mama.indstate.edu/users/ice/tree/
 
@@ -15,6 +15,7 @@ MAINTAINER =  David Dahlberg <david+bsd@d
 # GPLv2+
 PERMIT_PACKAGE_CDROM = Yes
 
+# uses pledge()
 WANTLIB =  c
 
 MASTER_SITES = http://mama.indstate.edu/users/ice/tree/src/
Index: patches/patch-tree_c
===
RCS file: patches/patch-tree_c
diff -N patches/patch-tree_c
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-tree_c23 Apr 2016 18:32:23 -
@@ -0,0 +1,27 @@
+$OpenBSD$
+--- tree.c.origWed Apr 23 23:38:24 2014
 tree.c Sat Apr 23 19:53:42 2016
+@@ -106,6 +106,11 @@ int main(int argc, char **argv)
+   setlocale(LC_CTYPE, "");
+   setlocale(LC_COLLATE, "");
+ 
++  if (pledge("stdio rpath wpath cpath getpw", NULL) == -1){
++fprintf(stderr, "%s: pledge\n", argv[0]);
++exit(1);
++  }
++
+   charset = getcharset();
+   if (charset == NULL && strcmp(nl_langinfo(CODESET), "UTF-8") == 0)
{
+ charset = "UTF-8";
+@@ -450,6 +455,11 @@ int main(int argc, char **argv)
+   fprintf(stderr,"tree: invalid filename '%s'\n",outfilename);
+   exit(1);
+ }
++  }
++
++  if (pledge("stdio rpath getpw", NULL) == -1){
++fprintf(stderr, "%s: pledge\n", argv[0]);
++exit(1);
+   }
+ 
+   parse_dir_colors();



Re: pledge() sysutils/colortree

2016-04-23 Thread David Dahlberg
Am Friday, den 22.04.2016, 11:07 +0200 schrieb David Dahlberg:
> Am Freitag, den 22.04.2016, 09:52 +0100 schrieb Stuart Henderson:
> > >  MAINTAINER =   David Dahlberg <david+bsd@dahlberg.cologne>
> > And please CC maintainer for ports diffs, thank you :)
> I have seen it. Will have a deeper look at it over the week-end.

Did some style changes and added "getpw" to pledge for getgrgid(3) etc.
BTW, how do I cvs diff over new files?

Anybody wanting to OK/commit?

Cheers,

David

? patches/patch-tree_c
Index: Makefile
===
RCS file: /cvs/ports/sysutils/colortree/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- Makefile17 Aug 2015 09:07:22 -  1.1.1.1
+++ Makefile23 Apr 2016 12:52:09 -
@@ -6,6 +6,7 @@ V = 1.7.0
 DISTNAME = tree-$V
 PKGNAME=   colortree-$V
 CATEGORIES =   sysutils
+REVISION = 0
 
 HOMEPAGE = http://mama.indstate.edu/users/ice/tree/
 $OpenBSD$
--- tree.c.orig Sat Apr 23 14:04:39 2016
+++ tree.c  Sat Apr 23 14:05:33 2016
@@ -103,6 +103,11 @@ int main(int argc, char **argv)
   dirs[0] = 0;
   Level = -1;
 
+  if (pledge("stdio rpath getpw", NULL) == -1){
+fprintf(stderr, "%s: pledge\n", argv[0]);
+exit(1);
+  }
+
   setlocale(LC_CTYPE, "");
   setlocale(LC_COLLATE, "");
 


Re: pledge() sysutils/colortree

2016-04-22 Thread David Dahlberg
Am Freitag, den 22.04.2016, 09:52 +0100 schrieb Stuart Henderson:
> > 
> > 
> >  MAINTAINER =   David Dahlberg <david+bsd@dahlberg.cologne>
> And please CC maintainer for ports diffs, thank you :)

I have seen it. Will have a deeper look at it over the week-end.

Cheers

David



Re: [NEW] books/rfc

2015-10-30 Thread David Dahlberg
Am Freitag, den 30.10.2015, 12:35 +0100 schrieb Peter Hessler:
> I've wanted a local cache of the RFCs for a long time, so I quickly
> wrote up a simple port to keep them local, and a trivial pager helper
> script.

There seems to be a RFCs1001-1500.tar.gz missing. Also missing is
RFCs7001-7500.tar.gz, or is this set not completed yet?

Small final remark: If GNU can add 20 pages of licence around a one-
liner script, we might at least add a few lines of mandoc(7). Here you
are.
.Dd $Mdocdate: October 30 2015 $
.Dt RFC 1
.Os
.Sh NAME
.Nm rfc
.Nd shows text from local collection of RFCs
.Sh SYNOPSIS
.Nm 
.Ar number
.Sh DESCRIPTION
.Nm
will show the RFC referenced by
.Ar number
in a
.Ev PAGER .
.Sh ENVIRONMENT
.Bl -tag -width Ds
.It Ev PAGER
The
.Ev PAGER
to be used. Default: less.
.El
.Sh FILES
.Bl -tag -width Ds
.It Pa /usr/local/share/doc/rfc/rfc-index.txt
Index of locally available RFCs.
.El
.Sh EXIT STATUS
.Ex -std
.Sh EXAMPLES
$ rfc 2549
.Sh SEE ALSO
.Xr less 1
.Sh HISTORY
The
.Nm
command was first released on 30 Oct 2015.
.Sh AUTHORS
.An Peter Hessler Aq Mt phess...@openbsd.org


Re: New: colortree

2015-07-20 Thread David Dahlberg
Am Sunday, den 19.07.2015, 22:01 +0300 schrieb Vadim Zhukov:
 Yes. But, please, remove CFLAGS line entirely then, too
[..]
 Yes. The last small nit: the manual page isn't built but comes
 directly from source directory, so the ${INSTALL_MAN} line should use
 ${WRKSRC} instead of ${WRKBUILD} there. You can feel the difference 
 if
 you'll add SEPARATE_BUILD=Yes to the port Makefile (you can do this 
 to
 fill the vacuum after CFLAGS line removal :) ).

Yes, now I see separate directories.
Here is the new tarball ...


colortree.tgz
Description: application/compressed-tar


Re: New: colortree

2015-07-20 Thread David Dahlberg
Am Monday, den 20.07.2015, 18:03 +0100 schrieb Stuart Henderson:
 WANTLIB is missing.

Added it.

But what I still noticed is that the compiler warns about
strcpy/sprintf. Even though there are only two invocations of strcpy(3)
which do look good to me, there is actually far to many sprintf(3) with
lengthy strlen(3) calculations to take care of them all in a port. 

Should I do something about that (except nagging at upstream)?

colortree.tgz
Description: application/compressed-tar


Re: Please import: password-store

2015-07-19 Thread David Dahlberg
Am Sunday, den 05.07.2015, 15:33 +0200 schrieb David Dahlberg:
 Here's the next try to get Jason Donenfeld's password store
 (passwordstore.org) imported into ports.

Ping?



Re: New: colortree

2015-07-19 Thread David Dahlberg
Am Sunday, den 19.07.2015, 19:43 +0300 schrieb Vadim Zhukov:
 2015-07-19 18:09 GMT+03:00 David Dahlberg david+bsd@dahlberg.cologne
 :
  A port for Steve Baker's tree program.
  
 1. Don't hardcode -O2, let the CFLAGS/COPTS/DEBUG coming from outside
 port do their job instead... I propose getting out of GMake 
 dependency
 and just build the port yourself:

After that change the dist Makefile is not used any more for the
ALL_TARGET, so patch-Makefile becomes unnecessary.

 2. After modifying the manual pages, some lines started to exceed 80
 chars there.
 
 3. The tree command for linux in COMMENT doesn't say anything 
 useful.

Better this way?

colortree.tgz
Description: application/compressed-tar


New: colortree

2015-07-19 Thread David Dahlberg
A port for Steve Baker's tree program.

As we have already a simpler, BSD-licenced alternative in ports, I used
the gnugetopt/coreutils/colorls approach and renamed to colortree,
which is the author's preference.

Cheers,
David

colortree.tgz
Description: application/compressed-tar


Please import: password-store

2015-07-05 Thread David Dahlberg
Here's the next try to get Jason Donenfeld's password store
(passwordstore.org) imported into ports. Last one was a couple of
months ago.

Changes since then:
 * based on new upstream release
 * suppress (.gpg) prefixes in pass ls
   (found by Derek Sivers)

Cheers,
David

password-store.tgz
Description: application/compressed-tar


Re: First attempt at ports: password-store

2015-01-09 Thread David Dahlberg
Am Donnerstag, den 08.01.2015, 16:33 + schrieb Mikolaj Kucharski:

 As tree(1) is already run depends, I would stay below with it. Any
 reason you are changing it to find(1)?

Yes. The tree in OpenBSD ports is http://spootnik.org/tree/tree-0.61.tgz
by Pierre-Ives Ritschard, the password-store developers depend according
to their documentation on tree = 1.7.0 from Steve Baker
http://mama.indstate.edu/users/ice/tree, whose feature set it much
bigger than the one of the ports version.

The ports version is good enough for the base functionality (display a
fancy directory tree in ascii-art), but it cannot do stuff like pattern
matching. This is the reason, why I did say, that that particular line
needs some consideration whether there might be a more satisfying
solution. Be it in the upstream or the port.

The reason for me to use find(1) is that it is the straight-forward way
to display the expected (good enough) result for pass find foo.
Drawbacks: The format is different: 

| Password Store
| | bar/foo
| | baz/foo

instead of the original

| Password Store
| |-- bar
| |   `-- foo
| `-- baz
| `-- foo

And because of that of course it breaks the regression test 
test/t0400-grep.sh. Although, the output format could graphics 
could be magicked to to resemble the original, I do not think 
consider it to be worthwhile.

 What do you think about below change? Be aware, didn't tested it with
 pass(1)
 
 --- files/openbsd.sh  Thu Jan  8 12:33:37 2015
 +++ files/openbsd.sh  Thu Jan  8 16:24:39 2015
 @@ -6,7 +6,7 @@
  local warn=1
  [[ $1 == nowarn ]]  warn=0
   local template=$PROGRAM.X
 - if sysctl kern.usermount | grep -q =1$; then
 + if [ `sysctl -n kern.usermount` == 1 ]; then
  SECURE_TMPDIR=$(mktemp -d ${TMPDIR:-/tmp}/$template)
  mount -t tmpfs -o -s16M tmpfs $SECURE_TMPDIR || die 
 Error: could not create tmpfs.
  unmount_tmpdir() {

Surely. And still works of course.

 As a side note, in OpenBSD
 ports, examples are usually placed under:
   ${PREFIX}/share/examples/${PKGNAME}

Yes. I noticed (and changed) that aready locally. Also that one can
install multiple files/dirs with {foo,bar,baz}.

Scanning other ports, some place more or less the same kinds of files 
to doc/$PACKAGE/examples, some place them to examples/$PACKAGE. As 
the documentation lists examples/$PACKAGE, I consider this to be the 
right place though.


-- 
David Dahlberg 

Fraunhofer FKIE, Dept. Communication Systems (KOM) | Tel: +49-228-9435-845
Fraunhoferstr. 20, 53343 Wachtberg, Germany| Fax: +49-228-856277



Re: First attempt at ports: password-store

2015-01-08 Thread David Dahlberg
Am Donnerstag, den 08.01.2015, 13:17 +0100 schrieb Stefan Sperling:

 [some remarks]

[x] changed it.

 Have you tried talking to upstream about using more portable command
 line flags in their Makefile so you can drop the -v flag patches in a
 future update?

Yes, I am in conversation with him. Yet I keep on finding new things 
in the code paths that are seldom used by me ;-)

 Perhaps they could at least put in some abstraction to
 disable these flags (e.g. with 'make QUIET=yes' or 'make V=0' don't
 use -v options at all).

It is not only the Makefile, you'll find this in the base shell script
as well. For some command there already anchors for platform specific
substitutions (i.e. getopt and shred).

Actually, the verbose and colour switches do not give me much
headaches. There are multiple possibilities to address this. Worse is
the usage tree. For now, I had to substitute it somehow with find |
grep which of course is not as fancy and breaks the unit-test. 

 -dd

-- 
David Dahlberg 

Fraunhofer FKIE, Dept. Communication Systems (KOM) | Tel: +49-228-9435-845
Fraunhoferstr. 20, 53343 Wachtberg, Germany| Fax: +49-228-856277



Re: First attempt at ports: password-store

2015-01-08 Thread David Dahlberg
Am Donnerstag, den 08.01.2015, 12:38 + schrieb Mikolaj Kucharski:

 Looking at README file in password-store's git repo, it looks like
 content for pkg/DESCR and you have already good description for it, so I
 don't think there is a need for post-install part at all, as I wouldn't
 include license file too.

IMHO the point is: Is it required to ship the licence file with the
package? What would the bare-footed guy say? 

If documenting the licence is not required, the whole directory is
unnecessary, agreed.

 In post-extract I would use ${INSTALL_SCRIPT} or ${INSTALL_DATA} instead
 of cp(1), depending should openbsd.sh have executable bit set or not.
 Please, use ${FILESDIR}/openbsd.sh instead of files/openbsd.sh to copy
 the file to target location.

Indeed. Thanks for pointing me at it.

-- 
David Dahlberg 

Fraunhofer FKIE, Dept. Communication Systems (KOM) | Tel: +49-228-9435-845
Fraunhoferstr. 20, 53343 Wachtberg, Germany| Fax: +49-228-856277



First attempt at ports: password-store

2015-01-08 Thread David Dahlberg
Hi *,

this is my first attempt at porting an application (password-store)
to OpenBSD. Would you please comment on whether it is usable and/or
where and how to improve it?

Cheers
David

-- 
David Dahlberg 

Fraunhofer FKIE, Dept. Communication Systems (KOM) | Tel: +49-228-9435-845
Fraunhoferstr. 20, 53343 Wachtberg, Germany| Fax: +49-228-856277


pass.tar.gz
Description: pass.tar.gz


Re: First attempt at ports: password-store

2015-01-08 Thread David Dahlberg
Am Donnerstag, den 08.01.2015, 12:48 + schrieb Mikolaj Kucharski:

 I didn't look at the distfile of password-store, but only to upstream's
 git repo. You may considering to include the completion files for bash
 and zsh.

For now, I packaged those scripts to 
/usr/local/share/doc/password-store/examples/completion.

If there is a *-completion infrastructure, such as
/etc/bash_completion.d in Debian, I have not found it yet, 
not even with the shells/bash PLIST. But if there is a way, 
please do not hesitate to point me at it.

 Did you consider to take maintainership of the port, while you are
 submitting it?

If you insist, of course I will do ;-)

Attached is a new version, which addresses all (non-controversial)
remarks. As for Linux and OSX, the OpenBSD-specific script is now also
able to edit temporarily decypted passwords in a ramdisk instead of
regular /tmp.

  -dd

-- 
David Dahlberg 

Fraunhofer FKIE, Dept. Communication Systems (KOM) | Tel: +49-228-9435-845
Fraunhoferstr. 20, 53343 Wachtberg, Germany| Fax: +49-228-856277


password-store.tar.gz
Description: password-store.tar.gz