diff options
author | Cameron Katri <me@cameronkatri.com> | 2021-08-25 19:10:49 -0400 |
---|---|---|
committer | Cameron Katri <me@cameronkatri.com> | 2021-08-28 00:56:53 -0400 |
commit | f290337306e66cc8b4860837032dffedc3f5ebe3 (patch) | |
tree | 96d397e7572df2fbc71f9d1666b48088213aa206 /adduser/adduser.sh | |
parent | fc3eccc659518306f05140eb24e525992f9d9993 (diff) | |
download | pw-darwin-f290337306e66cc8b4860837032dffedc3f5ebe3.tar.gz pw-darwin-f290337306e66cc8b4860837032dffedc3f5ebe3.tar.zst pw-darwin-f290337306e66cc8b4860837032dffedc3f5ebe3.zip |
adduser rmuser: Customizable prefix
Diffstat (limited to 'adduser/adduser.sh')
-rw-r--r-- | adduser/adduser.sh | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/adduser/adduser.sh b/adduser/adduser.sh index b9abd81..3cb11b8 100644 --- a/adduser/adduser.sh +++ b/adduser/adduser.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!@MEMO_PREFIX@/bin/sh # # SPDX-License-Identifier: BSD-2-Clause-FreeBSD # @@ -319,8 +319,8 @@ add_user() { # _dir="`dirname $msgfile`" _file="`basename $msgfile`" - _perms=`/usr/bin/find $_dir -name $_file -perm +07022 -prune` - _owner=`/usr/bin/find $_dir -name $_file -user 0 -prune` + _perms=`@MEMO_PREFIX@@MEMO_SUB_PREFIX@/bin/find $_dir -name $_file -perm +07022 -prune` + _owner=`@MEMO_PREFIX@@MEMO_SUB_PREFIX@/bin/find $_dir -name $_file -user 0 -prune` if [ -z "$_owner" -o -n "$_perms" ]; then err "The message file ($msgfile) may be writeable only by root." return 1 @@ -837,17 +837,17 @@ input_interactive() { #### END SUBROUTINE DEFINITION #### -THISCMD=`/usr/bin/basename $0` -DEFAULTSHELL=/bin/sh -ADDUSERCONF="${ADDUSERCONF:-/etc/adduser.conf}" -PWCMD="${PWCMD:-/usr/sbin/pw}" +THISCMD=`@MEMO_PREFIX@@MEMO_SUB_PREFIX@/bin/basename $0` +DEFAULTSHELL=@PREFIX@/bin/sh +ADDUSERCONF="${ADDUSERCONF:-@MEMO_PREFIX@/etc/adduser.conf}" +PWCMD="${PWCMD:-@MEMO_PREFIX@@MEMO_SUB_PREFIX@/sbin/pw}" MAILCMD="${MAILCMD:-mail}" -ETCSHELLS="${ETCSHELLS:-/etc/shells}" -NOHOME="/nonexistent" +ETCSHELLS="${ETCSHELLS:-@MEMO_PREFIX@/etc/shells}" +NOHOME="@MEMO_PREFIX@/var/lib/empty" NOLOGIN="nologin" -NOLOGIN_PATH="/usr/sbin/nologin" -GREPCMD="/usr/bin/grep" -DATECMD="/bin/date" +NOLOGIN_PATH="@MEMO_PREFIX@@MEMO_SUB_PREFIX@/sbin/nologin" +GREPCMD="@MEMO_PREFIX@@MEMO_SUB_PREFIX@/bin/grep" +DATECMD="@MEMO_PREFIX@/bin/date" # Set default values # @@ -861,13 +861,13 @@ uhome= uhomeperm= upass= ushell= -udotdir=/usr/share/skel +udotdir=@MEMO_PREFIX@@MEMO_SUB_PREFIX@/share/skel ugroups= uexpire= upwexpire= shells="`valid_shells`" passwdtype="yes" -msgfile=/etc/adduser.msg +msgfile=@MEMO_PREFIX@/etc/adduser.msg msgflag= quietflag= configflag= @@ -877,7 +877,7 @@ disableflag= Dflag= Sflag= readconfig="yes" -homeprefix="/var" +homeprefix="@MEMO_PREFIX@/var" randompass= fileline= savedpwtype= @@ -891,7 +891,7 @@ defaultHomePerm= # measure as much as it is a useful method of reminding the user to # 'su -' before he/she wastes time entering data that won't be saved. # -procowner=${procowner:-`/usr/bin/id -u`} +procowner=${procowner:-`@MEMO_PREFIX@@MEMO_SUB_PREFIX@/bin/id -u`} if [ "$procowner" != "0" ]; then err 'you must be the super-user (uid 0) to use this utility.' exit 1 |