summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-06-17 20:09:33 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-06-17 20:09:33 -0400
commit4d12729aa4026229e4e118b924cc3b1c75ca214b (patch)
treeabd9a69ec11504844148b1017f9e9601ef7e90b8
parent4f175a22cf726bfa09652d8d9ca6374785561348 (diff)
write setuid, move things around
-rw-r--r--.gitignore17
-rw-r--r--.gitmodules16
-rw-r--r--Makefile59
-rw-r--r--bin/common.rb.in (renamed from scripts/common.rb.in)0
-rwxr-xr-xbin/meta-cat (renamed from scripts/meta-cat)0
-rwxr-xr-xbin/meta-check (renamed from scripts/meta-check)0
-rwxr-xr-xbin/meta-normalize-stdio (renamed from scripts/meta-normalize-stdio)0
-rw-r--r--bin/nshd-tester.c (renamed from test/runner.c)0
-rwxr-xr-xbin/pacman-make-keyring (renamed from scripts/pacman-make-keyring)0
-rwxr-xr-xbin/pgp-list-keyids (renamed from scripts/pgp-list-keyids)0
-rwxr-xr-xbin/postfix-generate-virtual-map (renamed from scripts/postfix-generate-virtual-map)0
-rw-r--r--bin/setuid.c108
-rwxr-xr-xbin/ssh-list-authorized-keys (renamed from scripts/ssh-list-authorized-keys)0
-rwxr-xr-xbin/uid-map (renamed from scripts/uid-map)0
-rw-r--r--build-aux/Makefile.once.head/20-golang.mk3
-rw-r--r--go/cmd-nshd/.gitignore (renamed from src/cmd-nshd/.gitignore)0
-rw-r--r--go/cmd-nshd/main.go.in (renamed from src/cmd-nshd/main.go.in)2
m---------go/gopkg.in/yaml.v2 (renamed from src/gopkg.in/yaml.v2)0
m---------go/lukeshu.com/git/go/libgnulinux.git (renamed from src/lukeshu.com/git/go/libgnulinux.git)0
m---------go/lukeshu.com/git/go/libnslcd.git0
m---------go/lukeshu.com/git/go/libsystemd.git (renamed from src/lukeshu.com/git/go/libsystemd.git)0
-rw-r--r--go/parabola_hackers/.gitignore (renamed from src/parabola_hackers/.gitignore)0
-rw-r--r--go/parabola_hackers/nslcd_backend/db_config.go (renamed from src/parabola_hackers/nslcd_backend/db_config.go)0
-rw-r--r--go/parabola_hackers/nslcd_backend/db_group.go (renamed from src/parabola_hackers/nslcd_backend/db_group.go)0
-rw-r--r--go/parabola_hackers/nslcd_backend/db_pam.go (renamed from src/parabola_hackers/nslcd_backend/db_pam.go)0
-rw-r--r--go/parabola_hackers/nslcd_backend/db_passwd.go (renamed from src/parabola_hackers/nslcd_backend/db_passwd.go)0
-rw-r--r--go/parabola_hackers/nslcd_backend/db_shadow.go (renamed from src/parabola_hackers/nslcd_backend/db_shadow.go)0
-rw-r--r--go/parabola_hackers/nslcd_backend/hackers.go (renamed from src/parabola_hackers/nslcd_backend/hackers.go)0
-rw-r--r--go/parabola_hackers/nslcd_backend/util.go (renamed from src/parabola_hackers/nslcd_backend/util.go)0
-rw-r--r--go/parabola_hackers/passwords.go.in (renamed from src/parabola_hackers/passwords.go.in)3
-rw-r--r--go/parabola_hackers/users.go.in (renamed from src/parabola_hackers/users.go.in)0
-rw-r--r--go/parabola_hackers/util.go (renamed from src/parabola_hackers/util.go)0
m---------src/lukeshu.com/git/go/libnslcd.git0
-rw-r--r--test/.gitignore1
34 files changed, 167 insertions, 42 deletions
diff --git a/.gitignore b/.gitignore
index b128030..a75421c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,15 +1,16 @@
-/pkg
-/bin/
+/LICENSE.*.txt
+/bin/common.rb
+/bin/nshd
+/bin/nshd-tester
+/bin/setuid
+/nshd.service
+/nshd.sysusers
+
+/.gopath
.var.*
.tmp.*
*.o
*~
-
-/nshd.service
-/nshd.sysusers
-/scripts/common.rb
-/LICENSE.*.txt
-
parabola-keyring-*.tar.gz
/config.mk
diff --git a/.gitmodules b/.gitmodules
index 5e18a55..fcf63f4 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,12 +1,12 @@
-[submodule "src/gopkg.in/yaml.v2"]
- path = src/gopkg.in/yaml.v2
+[submodule "go/gopkg.in/yaml.v2"]
+ path = go/gopkg.in/yaml.v2
url = https://gopkg.in/yaml.v2/
-[submodule "src/lukeshu.com/git/go/libgnulinux.git"]
- path = src/lukeshu.com/git/go/libgnulinux.git
+[submodule "go/lukeshu.com/git/go/libgnulinux.git"]
+ path = go/lukeshu.com/git/go/libgnulinux.git
url = https://lukeshu.com/git/go/libgnulinux.git/
-[submodule "src/lukeshu.com/git/go/libnslcd.git"]
- path = src/lukeshu.com/git/go/libnslcd.git
+[submodule "go/lukeshu.com/git/go/libnslcd.git"]
+ path = go/lukeshu.com/git/go/libnslcd.git
url = https://lukeshu.com/git/go/libnslcd.git/
-[submodule "src/lukeshu.com/git/go/libsystemd.git"]
- path = src/lukeshu.com/git/go/libsystemd.git
+[submodule "go/lukeshu.com/git/go/libsystemd.git"]
+ path = go/lukeshu.com/git/go/libsystemd.git
url = https://lukeshu.com/git/go/libsystemd.git/
diff --git a/Makefile b/Makefile
index 4ddef29..3a546fe 100644
--- a/Makefile
+++ b/Makefile
@@ -34,14 +34,15 @@ CGO_CPPFLAGS = $(CPPFLAGS) -U_FORTIFY_SOURCE
CGO_CFLAGS = $(CFLAGS) -O0 -Wno-unused-parameter
CGO_ENABLED = 1
-at.subdirs += src/lukeshu.com/git/go/libnslcd.git/proto
+at.subdirs += go/lukeshu.com/git/go/libnslcd.git/proto
-scripts = $(filter-out common.rb common.rb.in,$(notdir $(wildcard $(srcdir)/scripts/*))) common.rb
+programs = setuid nshd-tester nshd common.rb
+scripts = $(filter-out %.c %.o $(programs) common.rb common.rb.in,$(notdir $(wildcard $(srcdir)/bin/*)))
std.gen_files += LICENSE.lgpl-2.1.txt LICENSE.gpl-2.txt LICENSE.apache-2.0.txt
-std.out_files += bin/cmd-nshd nshd.service nshd.sysusers scripts/common.rb test/runner
-std.sys_files += $(addprefix $(bindir)/,nshd $(scripts)) $(systemunitdir)/nshd.socket $(systemunitdir)/nshd.service $(sysusersdir)/nshd.conf $(conf_file) $(shadow_file)
-std.clean_files += test/*.o pkg/ .tmp* .var* $(_out)
+std.out_files += $(addprefix bin/,$(programs)) nshd.service nshd.sysusers
+std.sys_files += $(addprefix $(bindir)/,$(programs) $(scripts)) $(systemunitdir)/nshd.socket $(systemunitdir)/nshd.service $(sysusersdir)/nshd.conf $(conf_file) $(shadow_file)
+std.clean_files += bin/*.o .gopath/ .tmp* .var* $(_out)
$(srcdir)/LICENSE.lgpl-2.1.txt: $(NET)
curl https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt > $@
@@ -52,39 +53,44 @@ $(srcdir)/LICENSE.apache-2.0.txt: $(NET)
$(srcdir)/LICENSE.wtfpl-2.txt: $(NET)
curl http://www.wtfpl.net/txt/copying/ > $@
-_gen += src/lukeshu.com/git/go/libnslcd.git/proto/server/interface_backend.go
-_gen += src/lukeshu.com/git/go/libnslcd.git/proto/server/func_handlerequest.go
-_gen += src/lukeshu.com/git/go/libnslcd.git/proto/server/type_nilbackend.go
-_out += src/parabola_hackers/users.go
-_out += src/parabola_hackers/passwords.go
-_out += src/cmd-nshd/main.go
-$(outdir)/bin/%-nshd: $(call golang.src,$(srcdir)) $(_gen) $(_out)
- $(call golang.install,$(topsrcdir),cmd-nshd)
+_gen += go/lukeshu.com/git/go/libnslcd.git/proto/server/interface_backend.go
+_gen += go/lukeshu.com/git/go/libnslcd.git/proto/server/func_handlerequest.go
+_gen += go/lukeshu.com/git/go/libnslcd.git/proto/server/type_nilbackend.go
+_out += go/parabola_hackers/users.go
+_out += go/parabola_hackers/passwords.go
+_out += go/cmd-nshd/main.go
+$(outdir)/bin/nshd: \
+$(outdir)/bin/%: $(outdir)/.gopath/bin/cmd-%
+ cp -T $< $@
+$(outdir)/.gopath/src: $(golang.var)
+ rm -rf -- $(@D)
+ mkdir $(@D)
+ ln -sr $(topsrcdir)/go $@
+ touch $@
+$(outdir)/.gopath/bin/cmd-nshd: $(call golang.src,$(outdir)/.gopath) $(_gen) $(_out)
+ $(call golang.install,$(topoutdir)/.gopath,cmd-nshd)
$(outdir)/%.o: $(srcdir)/%.c $(var)CC $(var)CPPFLAGS $(var)CFLAGS
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(filter-out $(var)%,$^)
+$(outdir)/bin/nshd-tester $(outdir)/bin/setuid: \
$(outdir)/%: $(outdir)/%.o $(var)CC $(var)LDFLAGS
$(CC) $(LDFLAGS) -o $@ $(filter-out $(var)%,$^)
$(outdir)/%: $(srcdir)/%.in
< $< sed $(foreach v,$(patsubst $(var)%,%,$(filter $(var)%,$^)), -e 's|@$v@|$($v)|g' ) > $@
+$(outdir)/bin/setuid: -ldl
$(outdir)/nshd.service: $(var)user $(var)bindir
$(outdir)/nshd.sysusers: $(var)user
-$(outdir)/scripts/common.rb: $(var)conf_file
-$(outdir)/src/cmd-nshd/main.go: $(var)conf_file
-$(outdir)/src/parabola_hackers/users.go: $(var)bindir
-$(outdir)/src/parabola_hackers/passwords.go: $(var)shadow_file
+$(outdir)/bin/common.rb: $(var)conf_file
+$(outdir)/go/cmd-nshd/main.go: $(var)conf_file
+$(outdir)/go/parabola_hackers/users.go: $(var)bindir
+$(outdir)/go/parabola_hackers/passwords.go: $(var)shadow_file
-$(DESTDIR)$(bindir)/%: $(outdir)/bin/cmd-%
- $(NORMAL_INSTALL)
- install -TDm755 $< $@
-$(DESTDIR)$(bindir)/%: $(srcdir)/scripts/%
+# Patterns
+$(DESTDIR)$(bindir)/%: $(outdir)/bin/%
$(NORMAL_INSTALL)
install -TDm755 $< $@
-$(DESTDIR)$(bindir)/common.rb: $(srcdir)/scripts/common.rb
- $(NORMAL_INSTALL)
- install -TDm644 $< $@
$(DESTDIR)$(systemunitdir)/%.socket: $(outdir)/%.socket
$(NORMAL_INSTALL)
install -TDm644 $< $@
@@ -94,6 +100,11 @@ $(DESTDIR)$(systemunitdir)/%.service: $(outdir)/%.service
$(DESTDIR)$(sysusersdir)/%.conf: $(outdir)/%.sysusers
$(NORMAL_INSTALL)
install -TDm644 $< $@
+
+# Specific files
+$(DESTDIR)$(bindir)/common.rb: $(srcdir)/bin/common.rb
+ $(NORMAL_INSTALL)
+ install -TDm644 $< $@
$(DESTDIR)$(conf_file): $(srcdir)/parabola-hackers.yml
$(NORMAL_INSTALL)
install -TDm644 $< $@
diff --git a/scripts/common.rb.in b/bin/common.rb.in
index 7c457b8..7c457b8 100644
--- a/scripts/common.rb.in
+++ b/bin/common.rb.in
diff --git a/scripts/meta-cat b/bin/meta-cat
index 5e7097e..5e7097e 100755
--- a/scripts/meta-cat
+++ b/bin/meta-cat
diff --git a/scripts/meta-check b/bin/meta-check
index 4add9d3..4add9d3 100755
--- a/scripts/meta-check
+++ b/bin/meta-check
diff --git a/scripts/meta-normalize-stdio b/bin/meta-normalize-stdio
index a7ca381..a7ca381 100755
--- a/scripts/meta-normalize-stdio
+++ b/bin/meta-normalize-stdio
diff --git a/test/runner.c b/bin/nshd-tester.c
index 110819d..110819d 100644
--- a/test/runner.c
+++ b/bin/nshd-tester.c
diff --git a/scripts/pacman-make-keyring b/bin/pacman-make-keyring
index 702ea69..702ea69 100755
--- a/scripts/pacman-make-keyring
+++ b/bin/pacman-make-keyring
diff --git a/scripts/pgp-list-keyids b/bin/pgp-list-keyids
index 749cb7b..749cb7b 100755
--- a/scripts/pgp-list-keyids
+++ b/bin/pgp-list-keyids
diff --git a/scripts/postfix-generate-virtual-map b/bin/postfix-generate-virtual-map
index f2fb8ec..f2fb8ec 100755
--- a/scripts/postfix-generate-virtual-map
+++ b/bin/postfix-generate-virtual-map
diff --git a/bin/setuid.c b/bin/setuid.c
new file mode 100644
index 0000000..7ae1105
--- /dev/null
+++ b/bin/setuid.c
@@ -0,0 +1,108 @@
+/*
+ Copyright (C) 2006 West Consulting
+ Copyright (C) 2006-2015 Arthur de Jong
+ Copyright (C) 2015-2016 Luke Shumaker <lukeshu@sbcglobal.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA
+*/
+
+#include <dlfcn.h> /* for dlopen(3), dlsym(3), and dlerror(3) */
+#include <errno.h> /* for errno */
+#include <pwd.h> /* for getpwnam(3) */
+#include <stdio.h> /* for printf(3) and fprintf(3) */
+#include <string.h> /* for strerror(3) */
+#include <sys/types.h> /* for 'struct passwd' and 'struct group' */
+#include <systemd/sd-daemon.h> /* for SD_{WARNING,DEBUG} */
+#include <unistd.h> /* for setuid(3), setgid(3), and dup2(3) */
+
+#define EXIT_SUCCESS 0
+#define EXIT_FAILURE 1
+#define EXIT_INVALIDARGUMENT 2
+#define EXIT_NOPERMISSION 4
+
+const char *nss_module_soname = "libnss_ldap.so.2";
+const char *nss_module_sym_version = "_nss_ldap_version";
+const char *nss_module_sym_enablelookups = "_nss_ldap_enablelookups";
+
+static void disable_nss_module(void) {
+ char *err;
+
+ dlerror();
+ void *handle = dlopen(nss_module_soname, RTLD_LAZY | RTLD_NODELETE);
+ err = dlerror();
+ if (handle == NULL) {
+ fprintf(stderr, SD_WARNING "NSS module %s not loaded: %s", nss_module_soname, err);
+ return;
+ }
+
+ dlerror();
+ char **version_info = dlsym(handle, nss_module_sym_version);
+ err = dlerror();
+ if ((version_info != NULL) && (err == NULL)) {
+ fprintf(stderr, SD_DEBUG "NSS module %s version %s %s", nss_module_soname,
+ version_info[0],
+ version_info[1]);
+ } else {
+ fprintf(stderr, SD_WARNING "NSS module %s version missing: %s", nss_module_soname, err);
+ }
+
+ dlerror();
+ int *enable_flag = dlsym(handle, nss_module_sym_enablelookups);
+ err = dlerror();
+ if ((enable_flag == NULL) || (err != NULL)) {
+ fprintf(stderr, SD_WARNING "Unable to disable NSS ldap module for nslcd process: %s", err);
+ dlclose(handle);
+ return;
+ }
+ *enable_flag = 0;
+ dlclose(handle);
+}
+
+void usage(char *cmd) {
+ printf("Usage: %s USERNAME COMMAND...\n", cmd);
+ printf("A simple setuid(3) wrapper that runs with the `ldap' NSS module disabled\n");
+}
+
+int main(int argc, char *argv[]) {
+ if (argc < 3) {
+ dup2(2, 1);
+ usage(argv[0]);
+ return EXIT_INVALIDARGUMENT;
+ }
+
+ disable_nss_module();
+
+ struct passwd *passwd = getpwnam(argv[1]);
+ if (passwd == NULL) {
+ fprintf(stderr, SD_ERR "Could not look up user: %s", argv[1]);
+ return EXIT_FAILURE;
+ }
+
+ if (setgid(passwd->pw_gid) != 0) {
+ fprintf(stderr, SD_ERR "Could not setgid(%lu): %s",
+ (unsigned long int)passwd->pw_gid, strerror(errno));
+ return EXIT_NOPERMISSION;
+ }
+ if (setuid(passwd->pw_uid) != 0) {
+ fprintf(stderr, SD_ERR "Could not setuid(%lu): %s",
+ (unsigned long int)passwd->pw_gid, strerror(errno));
+ return EXIT_NOPERMISSION;
+ }
+
+ execvp(argv[2], &argv[2]);
+ fprintf(stderr, SD_ERR "Could not exec: %s", strerror(errno));
+ return EXIT_FAILURE;
+}
diff --git a/scripts/ssh-list-authorized-keys b/bin/ssh-list-authorized-keys
index 5364ac2..5364ac2 100755
--- a/scripts/ssh-list-authorized-keys
+++ b/bin/ssh-list-authorized-keys
diff --git a/scripts/uid-map b/bin/uid-map
index e759c30..e759c30 100755
--- a/scripts/uid-map
+++ b/bin/uid-map
diff --git a/build-aux/Makefile.once.head/20-golang.mk b/build-aux/Makefile.once.head/20-golang.mk
index 8d10a47..8e3835e 100644
--- a/build-aux/Makefile.once.head/20-golang.mk
+++ b/build-aux/Makefile.once.head/20-golang.mk
@@ -21,7 +21,8 @@ $(foreach v,$(_golang.cgo_variables),$(eval $v ?=))
export $(_golang.cgo_variables)
_golang.src_cmd = find -L $1/src -name '.*' -prune -o \( -type f \( -false $(foreach e,go c s S cc cpp cxx h hh hpp hxx,-o -name '*.$e') \) -o -type d \) -print
-golang.src = $(shell $(_golang.src_cmd)) $(addprefix $(var),$(_golang.cgo_variables))
+golang.src = $1/src $(shell $(_golang.src_cmd) 2>/dev/null)
+golang.var = $(addprefix $(var),$(_golang.cgo_variables))
define golang.install
GOPATH='$(abspath $1)' go install $(golang.FLAGS) $2
diff --git a/src/cmd-nshd/.gitignore b/go/cmd-nshd/.gitignore
index 00870e2..00870e2 100644
--- a/src/cmd-nshd/.gitignore
+++ b/go/cmd-nshd/.gitignore
diff --git a/src/cmd-nshd/main.go.in b/go/cmd-nshd/main.go.in
index b8c3e71..b1b7108 100644
--- a/src/cmd-nshd/main.go.in
+++ b/go/cmd-nshd/main.go.in
@@ -22,9 +22,11 @@ import (
hackers_nslcd_backend "parabola_hackers/nslcd_backend"
nslcd_systemd "lukeshu.com/git/go/libnslcd.git/systemd"
+ "lukeshu.com/git/go/libsystemd.git/sd_daemon/logger"
)
func main() {
+ logger.Debug("starting")
backend := &hackers_nslcd_backend.Hackers{
CfgFilename: "@conf_file@",
}
diff --git a/src/gopkg.in/yaml.v2 b/go/gopkg.in/yaml.v2
-Subproject f7716cbe52baa25d2e9b0d0da546fcf909fc16b
+Subproject f7716cbe52baa25d2e9b0d0da546fcf909fc16b
diff --git a/src/lukeshu.com/git/go/libgnulinux.git b/go/lukeshu.com/git/go/libgnulinux.git
-Subproject d8c4fd9aef9137b04e4311a1f50024ab88d4c6e
+Subproject d8c4fd9aef9137b04e4311a1f50024ab88d4c6e
diff --git a/go/lukeshu.com/git/go/libnslcd.git b/go/lukeshu.com/git/go/libnslcd.git
new file mode 160000
+Subproject 132cb9ec42cc4fb6c4a20c49422413ab0a62ef6
diff --git a/src/lukeshu.com/git/go/libsystemd.git b/go/lukeshu.com/git/go/libsystemd.git
-Subproject 89efdfbee5f9a22f9dd1083f7a383daba54d4f1
+Subproject 89efdfbee5f9a22f9dd1083f7a383daba54d4f1
diff --git a/src/parabola_hackers/.gitignore b/go/parabola_hackers/.gitignore
index 3be3f08..3be3f08 100644
--- a/src/parabola_hackers/.gitignore
+++ b/go/parabola_hackers/.gitignore
diff --git a/src/parabola_hackers/nslcd_backend/db_config.go b/go/parabola_hackers/nslcd_backend/db_config.go
index e78643b..e78643b 100644
--- a/src/parabola_hackers/nslcd_backend/db_config.go
+++ b/go/parabola_hackers/nslcd_backend/db_config.go
diff --git a/src/parabola_hackers/nslcd_backend/db_group.go b/go/parabola_hackers/nslcd_backend/db_group.go
index 18e54b1..18e54b1 100644
--- a/src/parabola_hackers/nslcd_backend/db_group.go
+++ b/go/parabola_hackers/nslcd_backend/db_group.go
diff --git a/src/parabola_hackers/nslcd_backend/db_pam.go b/go/parabola_hackers/nslcd_backend/db_pam.go
index 3374170..3374170 100644
--- a/src/parabola_hackers/nslcd_backend/db_pam.go
+++ b/go/parabola_hackers/nslcd_backend/db_pam.go
diff --git a/src/parabola_hackers/nslcd_backend/db_passwd.go b/go/parabola_hackers/nslcd_backend/db_passwd.go
index 3f32ddd..3f32ddd 100644
--- a/src/parabola_hackers/nslcd_backend/db_passwd.go
+++ b/go/parabola_hackers/nslcd_backend/db_passwd.go
diff --git a/src/parabola_hackers/nslcd_backend/db_shadow.go b/go/parabola_hackers/nslcd_backend/db_shadow.go
index abfff28..abfff28 100644
--- a/src/parabola_hackers/nslcd_backend/db_shadow.go
+++ b/go/parabola_hackers/nslcd_backend/db_shadow.go
diff --git a/src/parabola_hackers/nslcd_backend/hackers.go b/go/parabola_hackers/nslcd_backend/hackers.go
index bb03862..bb03862 100644
--- a/src/parabola_hackers/nslcd_backend/hackers.go
+++ b/go/parabola_hackers/nslcd_backend/hackers.go
diff --git a/src/parabola_hackers/nslcd_backend/util.go b/go/parabola_hackers/nslcd_backend/util.go
index 4fb28f3..4fb28f3 100644
--- a/src/parabola_hackers/nslcd_backend/util.go
+++ b/go/parabola_hackers/nslcd_backend/util.go
diff --git a/src/parabola_hackers/passwords.go.in b/go/parabola_hackers/passwords.go.in
index 0d763b9..b9f93d9 100644
--- a/src/parabola_hackers/passwords.go.in
+++ b/go/parabola_hackers/passwords.go.in
@@ -48,6 +48,9 @@ func LoadAllPasswords() (map[string]string, error) {
lines := strings.Split(string(contents), "\n")
passwords := make(map[string]string, len(lines))
for i, line := range lines {
+ if line == "" {
+ continue
+ }
cols := strings.SplitN(line, ":", 2)
if len(cols) != 2 {
logger.Err("hackers.git %s:%d: malformed line", shadow_file, i+1)
diff --git a/src/parabola_hackers/users.go.in b/go/parabola_hackers/users.go.in
index aeda069..aeda069 100644
--- a/src/parabola_hackers/users.go.in
+++ b/go/parabola_hackers/users.go.in
diff --git a/src/parabola_hackers/util.go b/go/parabola_hackers/util.go
index 9a241db..9a241db 100644
--- a/src/parabola_hackers/util.go
+++ b/go/parabola_hackers/util.go
diff --git a/src/lukeshu.com/git/go/libnslcd.git b/src/lukeshu.com/git/go/libnslcd.git
deleted file mode 160000
-Subproject 99adee24d96f27f08fecc0a56b3c26c68804529
diff --git a/test/.gitignore b/test/.gitignore
deleted file mode 100644
index 09230a9..0000000
--- a/test/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/runner