Skip to content

Commit

Permalink
Prevent root password modification during reset to default and the in…
Browse files Browse the repository at this point in the history
…itialize setup wizard
  • Loading branch information
developsessions committed Dec 25, 2022
1 parent cbf2e9f commit b3351bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions patches/0003-Prevent-changing-root-password.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- a/etc/uci-defaults/10_migrate-shadow 2020-09-28 05:05:55.000000000 -0400
+++ b/etc/uci-defaults/10_migrate-shadow 2022-12-25 17:17:00.681549715 -0500
@@ -6,7 +6,6 @@
if [ -n "${ppwd#[\!x]}" ] && [ -z "${spwd#[\!x]}" ]; then
logger -t migrate-shadow "Moving root password hash into shadow database"
sed -i -e "s:^root\:[^\:]*\::root\:x\::" /etc/passwd
- sed -i -e "s:^root\:[^\:]*\::root\:$ppwd\::" /etc/shadow
fi

exit 0
1 change: 1 addition & 0 deletions repack-squashfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ sed -i 's/romVersion%>/& xqrepack/;' "$FSDIR/usr/lib/lua/luci/view/web/inc/foote

# stop resetting root password
sed -i '/set_user(/a return 0' "$FSDIR/etc/init.d/system"
sed -i 's/flg_init_pwd=.*/flg_init_pwd=0/' "$FSDIR/etc/init.d/boot_check"

# make sure our backdoors are always enabled by default
sed -i '/ssh_en/d;' "$FSDIR/usr/share/xiaoqiang/xiaoqiang-reserved.txt"
Expand Down

0 comments on commit b3351bc

Please sign in to comment.