Skip to content

Commit

Permalink
[ffwizard] add cgi-bin/has_root-pass to check for configured system-p…
Browse files Browse the repository at this point in the history
…assword

as this script runs as root, it can pass the barrier getting this data
into luci for further processing
  • Loading branch information
SvenRoederer authored and sarumpaet committed Nov 2, 2016
1 parent 1b428cd commit fe76367
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions utils/luci-app-ffwizard-berlin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ define Package/luci-app-ffwizard-berlin/install
$(CP) ./htdocs/* $(1)/www
$(INSTALL_DIR) $(1)/etc
$(CP) ./root/etc/* $(1)/etc
$(INSTALL_DIR) $(1)/www/cgi-bin
$(CP) ./root/www/cgi-bin/* $(1)/www/cgi-bin/
endef

$(eval $(call BuildPackage,luci-app-ffwizard-berlin))
10 changes: 10 additions & 0 deletions utils/luci-app-ffwizard-berlin/root/www/cgi-bin/has_root-pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
echo "Content-type: text/plain"
echo ""
USER=root
# taken from http://serverfault.com/a/240961
grep ${USER} /etc/shadow | awk -F":" '{ if ($2 == "!" || $2 == "") \
printf "password_is_set:no";\
else \
printf "password_is_set:yes"\
}'

0 comments on commit fe76367

Please sign in to comment.