Skip to content

Commit

Permalink
Merge branch 'release/2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelOstertag committed Apr 21, 2020
2 parents cb33ea9 + 24005c9 commit 34766ba
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 111 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Expand Up @@ -147,3 +147,10 @@ doc/NEWS.adoc
doc/NEWS.html
doc/README.adoc
doc/yapet.adoc
config.sub
compile
config.guess
depcomp
install-sh
missing
test-driver
162 changes: 61 additions & 101 deletions Jenkinsfile
Expand Up @@ -16,6 +16,7 @@ pipeline {

triggers {
pollSCM '@hourly'
cron '@daily'
}

stages {
Expand Down Expand Up @@ -47,7 +48,7 @@ pipeline {

stage("(FB64) Build Docs") {
environment {
PATH = "$PATH:$HOME/.gem/ruby/2.5/bin"
PATH = "$PATH:$HOME/.gem/ruby/2.6/bin"
}
steps {
sh 'gem install --user-install asciidoctor'
Expand Down Expand Up @@ -81,9 +82,8 @@ pipeline {
steps {
dir("obj") {
sh '$MAKE distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-nls --with-libiconv-prefix=/usr/local --with-libintl-prefix=/usr/local"'
sshagent(['0b266ecf-fa80-4fe8-bce8-4c723f5ba47a']) {
// Eventhorizon only allows sftp
sh """sftp yapet-deploy@eventhorizon.dmz.kruemel.home:/var/www/jails/yapet/usr/local/www/apache24/data/downloads/ <<EOF
sshagent(['897482ed-9233-4d56-88c3-254b909b6316']) {
sh """sftp ec2-deploy@ec2-52-29-59-221.eu-central-1.compute.amazonaws.com:/data/www/yapet.guengel.ch/downloads <<EOF
put yapet-*.tar.*
EOF
"""
Expand All @@ -106,57 +106,6 @@ EOF
}
} // stage("FreeBSD amd64")

stage("FreeBSD i386") {
agent {
label "freebsd&&i386"
}
stages {
stage("(FB32) Bootstrap Build") {
steps {
sh "git log --stat > ChangeLog"
dir("libyacurs") {
sh "git log --stat > ChangeLog"
}
sh "touch README NEWS"
sh "autoreconf -I m4 -i"
}
}

stage("(FB32) Configure") {
steps {
dir("obj") {
sh "../configure --enable-debug"
}
}
}

stage("(FB32) Stub Docs") {
steps {
dir("doc") {
sh 'touch csv2yapet.1 yapet.1 yapet2csv.1 yapet_colors.5 yapet_config.5 csv2yapet.html INSTALL.html README.html NEWS.html yapet2csv.html yapet_colors.html yapet_config.html yapet.html'
}
sh 'touch NEWS'
}
}

stage("(FB32) Build") {
steps {
dir("obj") {
sh '$MAKE all CXXFLAGS="${PEDANTIC_FLAGS}"'
}
}
}

stage("(FB32) Test") {
steps {
dir("obj") {
sh '$MAKE check CXXFLAGS="${PEDANTIC_FLAGS}"'
}
}
}
}
} // stage("FreeBSD i386")

stage("Linux") {
agent {
label "linux"
Expand Down Expand Up @@ -199,7 +148,7 @@ EOF

stage("(LX) Test") {
environment {
EXTRA_LD_PRELOAD = "/usr/lib/gcc/x86_64-linux-gnu/6/libasan.so:"
EXTRA_LD_PRELOAD = "/usr/lib/gcc/x86_64-linux-gnu/8/libasan.so:"
}
steps {
dir("obj") {
Expand Down Expand Up @@ -262,55 +211,66 @@ EOF
}
} // stage("OpenBSD amd64")

// stage("NetBSD") {
// stages {
// stage("(NB) Bootstrap Build") {
// steps {
// sh "touch ChangeLog"
// dir("libyacurs") {
// sh "touch ChangeLog"
// }
// sh "touch README NEWS"
// sh "autoreconf -I m4 -i"
// }
// }
stage("NetBSD") {
agent {
label "netbsd&&amd64"
}
stages {
stage("(NB) Bootstrap Build") {
steps {
sh "touch ChangeLog"
dir("libyacurs") {
sh "touch ChangeLog"
}
sh "touch README NEWS"
sh "autoreconf -I m4 -i"
}
}

// stage("(NB) Configure") {
// steps {
// dir("obj") {
// sh "../configure --enable-debug LDFLAGS='-L/usr/pkg/lib -R/usr/pkg/lib' ARGON2_CFLAGS='-I/usr/pkg/include' ARGON2_LIBS='-L/usr/pkg/lib -largon2'"
// }
// }
// }
stage("(NB) Configure") {
steps {
dir("obj") {
sh "../configure --enable-debug LDFLAGS='-L/usr/pkg/lib -R/usr/pkg/lib' ARGON2_CFLAGS='-I/usr/pkg/include' ARGON2_LIBS='-L/usr/pkg/lib -largon2'"
}
}
}

// stage("(NB) Stub Docs") {
// steps {
// dir("doc") {
// sh 'touch csv2yapet.1 yapet.1 yapet2csv.1 yapet_colors.5 yapet_config.5 csv2yapet.html INSTALL.html README.html NEWS.html yapet2csv.html yapet_colors.html yapet_config.html yapet.html'
// }
// }
// }
// stage("(NB) Build") {
// steps {
// dir("obj") {
// sh '$MAKE all CXXFLAGS="${PEDANTIC_FLAGS} ${CODE_INSTRUMENTATION_FLAGS}"'
// }
// }
// }
stage("(NB) Stub Docs") {
steps {
dir("doc") {
sh 'touch csv2yapet.1 yapet.1 yapet2csv.1 yapet_colors.5 yapet_config.5 csv2yapet.html INSTALL.html README.html NEWS.html yapet2csv.html yapet_colors.html yapet_config.html yapet.html'
}
}
}
stage("(NB) Build") {
steps {
dir("obj") {
sh '$MAKE all CXXFLAGS="${PEDANTIC_FLAGS} ${CODE_INSTRUMENTATION_FLAGS}"'
}
}
}

// stage("(NB) Test") {
// environment {
// EXTRA_LD_PRELOAD = "/usr/lib/libasan.so:"
// }
// steps {
// dir("obj") {
// sh '$MAKE check CXXFLAGS="${PEDANTIC_FLAGS} ${CODE_INSTRUMENTATION_FLAGS}"'
// }
// }
// }
// }
// } // stage("NetBSD")
stage("(NB) Test") {
environment {
EXTRA_LD_PRELOAD = "/usr/lib/libasan.so:"
}
steps {
dir("obj") {
sh '$MAKE check CXXFLAGS="${PEDANTIC_FLAGS} ${CODE_INSTRUMENTATION_FLAGS}"'
}
}
}
}
} // stage("NetBSD")
} // parallel
} // stage("OS Build")
} // stages

post {
always {
mail to: "rafi@guengel.ch",
subject: "${JOB_NAME} (${BRANCH_NAME};${env.BUILD_DISPLAY_NAME}) -- ${currentBuild.currentResult}",
body: "Refer to ${currentBuild.absoluteUrl}"
}
}
}
2 changes: 1 addition & 1 deletion configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ([2.61])
AC_REVISION([1])
AC_INIT([YAPET],[2.3],[https://github.com/RafaelOstertag/yapet/issues])
AC_INIT([YAPET],[2.4],[https://github.com/RafaelOstertag/yapet/issues])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
Expand Down
4 changes: 4 additions & 0 deletions doc/NEWS.adoc.in
@@ -1,6 +1,10 @@
// -*- adoc -*-
= News

== YAPET 2.4

* Fix issue https://github.com/RafaelOstertag/yapet/issues/20[#20]

== YAPET 2.3

* Fix issue https://github.com/RafaelOstertag/yapet/issues/17[#17]
Expand Down
4 changes: 2 additions & 2 deletions src/converters/csv2yapet/main.cc
Expand Up @@ -198,7 +198,7 @@ int main(int argc, char** argv) {
show_help(argv[0]);
return 0;
case 'p':
strncpy(passwd, optarg, MAX_PASSWD);
strncpy(passwd, optarg, MAX_PASSWD - 1);
passwd[MAX_PASSWD - 1] = 0;
cmdline_pw = true;
break;
Expand Down Expand Up @@ -269,7 +269,7 @@ int main(int argc, char** argv) {
return ERR_PASSWDMISMATCH;
}

strncpy(passwd, pw1.c_str(), MAX_PASSWD);
strncpy(passwd, pw1.c_str(), MAX_PASSWD - 1);
passwd[MAX_PASSWD - 1] = '\0';
}

Expand Down
5 changes: 3 additions & 2 deletions src/converters/yapet2csv/main.cc
Expand Up @@ -42,6 +42,7 @@
#endif

#include <libgen.h>

#include <cerrno>
#include <cstdio>
#include <cstring>
Expand Down Expand Up @@ -195,7 +196,7 @@ int main(int argc, char** argv) {
show_help(argv[0]);
return 0;
case 'p':
strncpy(passwd, optarg, MAX_PASSWD);
strncpy(passwd, optarg, MAX_PASSWD - 1);
passwd[MAX_PASSWD - 1] = 0;
cmdline_pw = true;
break;
Expand Down Expand Up @@ -256,7 +257,7 @@ int main(int argc, char** argv) {
std::cout << std::endl;
enable_echo();

strncpy(passwd, pw1.c_str(), MAX_PASSWD);
strncpy(passwd, pw1.c_str(), MAX_PASSWD - 1);
passwd[MAX_PASSWD - 1] = 0;
}

Expand Down
3 changes: 2 additions & 1 deletion src/libs/pwgen/pwgen.cc
Expand Up @@ -33,6 +33,7 @@

#include <cassert>
#include <limits>
#include <stdexcept>

#include "consts.h"
#include "intl.h"
Expand Down Expand Up @@ -159,4 +160,4 @@ yapet::SecureArray PasswordGenerator::generatePassword(int size) {
password[size] = '\0';
} while (!containsSelectedPools(_characterPools, password));
return password;
}
}
8 changes: 4 additions & 4 deletions src/libs/pwgen/rngengine.cc
Expand Up @@ -31,14 +31,15 @@
#include "config.h"
#endif

#include <assert.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif

#include <assert.h>
#include <stdexcept>

#include "consts.h"
#include "intl.h"
Expand Down Expand Up @@ -81,8 +82,7 @@ RngEngine::RngEngine() : fd{openDevUrandom()}, positionInCache{EMPTY_CACHE} {}
RngEngine::~RngEngine() { closeFd(fd); }

RngEngine::RngEngine(const RngEngine& other)
: byteCache{other.byteCache},
positionInCache{other.positionInCache} {
: byteCache{other.byteCache}, positionInCache{other.positionInCache} {
fd = ::dup(other.fd);
}

Expand All @@ -102,7 +102,7 @@ RngEngine& RngEngine::operator=(const RngEngine& other) {
fd = ::dup(fd);
byteCache = other.byteCache;
positionInCache = other.positionInCache;

return *this;
}

Expand Down

0 comments on commit 34766ba

Please sign in to comment.