summaryrefslogtreecommitdiff
path: root/localpasswd
diff options
context:
space:
mode:
Diffstat (limited to 'localpasswd')
-rwxr-xr-xlocalpasswd5
1 files changed, 4 insertions, 1 deletions
diff --git a/localpasswd b/localpasswd
index c216bf7..790f10f 100755
--- a/localpasswd
+++ b/localpasswd
@@ -11,4 +11,7 @@
# TODO: Only allow handling regular users
#
-exec sudo /usr/bin/passwd $1
+sudo=sudo
+[ "$(id -u)" -ne 0 ] || sudo=
+
+exec $sudo /usr/bin/passwd $1