Skip to content

Commit

Permalink
Merge pull request #8 from linyows/typo
Browse files Browse the repository at this point in the history
Typo and tiny changes
  • Loading branch information
linyows authored Feb 28, 2017
2 parents 90714c9 + b0bd1f8 commit c30403a
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ testdev: ## Test without dependencies installation

integration_test: build install ## Run integration test
@echo "$(INFO_COLOR)==> $(RESET)$(BOLD)Integration Testing$(RESET)"
test -d /usr/lib/x86_64-linux-gnu && ln -sf /usr/lib/libnss_octopass.so.2.0 /usr/lib/x86_64-linux-gnu/libnss_octopass.so.2.0
test -d /usr/lib/x86_64-linux-gnu && ln -sf /usr/lib/libnss_octopass.so.2.0 /usr/lib/x86_64-linux-gnu/libnss_octopass.so.2.0 || true
cp octopass.conf.example /etc/octopass.conf
sed -i -e 's/^passwd:.*/passwd: files octopass/g' /etc/nsswitch.conf
sed -i -e 's/^shadow:.*/shadow: files octopass/g' /etc/nsswitch.conf
Expand Down
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
octopass (0.3.2-1) xenial; urgency=medium

* Example Typo

-- linyows <[email protected]> Tue, 28 Feb 2017 17:20:00 +0900
octopass (0.3.1-1) xenial; urgency=medium

* Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion octopass.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Team = "yourteam"
#Syslog = false

# Advanced
#SharedUser = [ "admin", "deploy" ]
#SharedUsers = [ "admin", "deploy" ]
2 changes: 1 addition & 1 deletion octopass.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <sys/stat.h>
#include <regex.h>

#define OCTOPASS_VERSION "0.3.1"
#define OCTOPASS_VERSION "0.3.2"
#define OCTOPASS_VERSION_WITH_NAME "octopass/" OCTOPASS_VERSION
#ifndef OCTOPASS_CONFIG_FILE
#define OCTOPASS_CONFIG_FILE "/etc/octopass.conf"
Expand Down
16 changes: 8 additions & 8 deletions octopass_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void help(void)
printf("\n");
}

int public_keys_unlocked(char *name)
int octopass_public_keys_unlocked(char *name)
{
struct config con;
octopass_config_loading(&con, OCTOPASS_CONFIG_FILE);
Expand All @@ -80,15 +80,15 @@ int public_keys_unlocked(char *name)
return 0;
}

int public_keys(char *name)
int octopass_public_keys(char *name)
{
OCTOPASS_LOCK();
int res = public_keys_unlocked(name);
int res = octopass_public_keys_unlocked(name);
OCTOPASS_UNLOCK();
return res;
}

int authentication_unlocked(int argc, char **argv)
int octopass_authentication_unlocked(int argc, char **argv)
{
char token[40 + 1];
fgets(token, sizeof(token), stdin);
Expand All @@ -113,10 +113,10 @@ int authentication_unlocked(int argc, char **argv)
return octopass_autentication_with_token(&con, user, token);
}

int authentication(int argc, char **argv)
int octopass_authentication(int argc, char **argv)
{
OCTOPASS_LOCK();
int res = authentication_unlocked(argc, argv);
int res = octopass_authentication_unlocked(argc, argv);
OCTOPASS_UNLOCK();
return res;
}
Expand Down Expand Up @@ -182,9 +182,9 @@ int main(int argc, char **argv)

// PAM
if (strcmp(argv[1], "pam") == 0) {
return authentication(argc, argv);
return octopass_authentication(argc, argv);
}

// PUBLIC KEYS
return public_keys((char *)argv[1]);
return octopass_public_keys((char *)argv[1]);
}
4 changes: 3 additions & 1 deletion rpm/octopass.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Summary: Management linux user and authentication with the organization/team on Github.
Name: octopass
Version: 0.3.1
Version: 0.3.2
Release: 1
License: GPLv3
URL: https://github.com/linyows/octopass
Expand Down Expand Up @@ -52,6 +52,8 @@ install -m 644 octopass.conf.example %{buildroot}%{_sysconfdir}/octopass.conf.ex
/etc/octopass.conf.example

%changelog
* Tue Feb 28 2017 linyows <[email protected]> - 0.3.2-1
- Example typo
* Mon Feb 27 2017 linyows <[email protected]> - 0.3.1-1
- Bugfixes
* Sun Feb 26 2017 linyows <[email protected]> - 0.3.0-1
Expand Down
15 changes: 15 additions & 0 deletions test/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,21 @@ function test_public_keys_user_not_on_github() {
fi
}

function test_shared_user_public_keys() {
sed -i -e 's/^#SharedUser/SharedUser/g' /etc/octopass.conf

actual="$(/usr/bin/octopass admin | wc -l)"
expected="5"

if [ "x$actual" == "x$expected" ]; then
pass "${FUNCNAME[0]}"
else
fail "${FUNCNAME[0]}" "$expected" "$actual"
fi

sed -i -e 's/^SharedUser/#SharedUser/g' /etc/octopass.conf
}

function test_authentication() {
actual="$(echo $OCTOPASS_TOKEN | /usr/bin/octopass pam linyows; echo $?)"
expected="0"
Expand Down

0 comments on commit c30403a

Please sign in to comment.