Lines 514-520
Link Here
|
514 |
fi |
514 |
fi |
515 |
else |
515 |
else |
516 |
for shell in /sbin/nologin /usr/sbin/nologin /bin/false /usr/bin/false /dev/null ; do |
516 |
for shell in /sbin/nologin /usr/sbin/nologin /bin/false /usr/bin/false /dev/null ; do |
517 |
[[ -x ${ROOT}${shell} ]] && break |
517 |
[[ -x ${EROOT}${shell} ]] && break |
518 |
done |
518 |
done |
519 |
|
519 |
|
520 |
if [[ ${shell} == "/dev/null" ]] ; then |
520 |
if [[ ${shell} == "/dev/null" ]] ; then |
Lines 529-535
Link Here
|
529 |
|
529 |
|
530 |
eshell=${shell} |
530 |
eshell=${shell} |
531 |
fi |
531 |
fi |
532 |
einfo " - Shell: ${eshell}" |
532 |
einfo " - Shell: ${EROOT}${eshell}" |
533 |
opts="${opts} -s ${eshell}" |
533 |
opts="${opts} -s ${eshell}" |
534 |
|
534 |
|
535 |
# handle homedir |
535 |
# handle homedir |
Lines 537-543
Link Here
|
537 |
if [[ -z ${ehome} ]] || [[ ${ehome} == "-1" ]] ; then |
537 |
if [[ -z ${ehome} ]] || [[ ${ehome} == "-1" ]] ; then |
538 |
ehome="/dev/null" |
538 |
ehome="/dev/null" |
539 |
fi |
539 |
fi |
540 |
einfo " - Home: ${ehome}" |
540 |
einfo " - Home: ${EROOT}${ehome}" |
541 |
opts="${opts} -d ${ehome}" |
541 |
opts="${opts} -d ${ehome}" |
542 |
|
542 |
|
543 |
# handle groups |
543 |
# handle groups |
Lines 566-571
Link Here
|
566 |
if [[ ! -z ${exgroups} ]] ; then |
566 |
if [[ ! -z ${exgroups} ]] ; then |
567 |
opts="${opts} -G ${exgroups:1}" |
567 |
opts="${opts} -G ${exgroups:1}" |
568 |
fi |
568 |
fi |
|
|
569 |
edefgroup="${defgroup}" |
570 |
eexgroups="${exgroups:1}" |
569 |
else |
571 |
else |
570 |
egroups="(none)" |
572 |
egroups="(none)" |
571 |
fi |
573 |
fi |
Lines 575-580
Link Here
|
575 |
local oldsandbox=${SANDBOX_ON} |
577 |
local oldsandbox=${SANDBOX_ON} |
576 |
export SANDBOX_ON="0" |
578 |
export SANDBOX_ON="0" |
577 |
case ${CHOST} in |
579 |
case ${CHOST} in |
|
|
580 |
*-darwin9) |
581 |
# FAFHRD: So, altering this in a way that assumes: |
582 |
# 1) We're on OSX 10.5 |
583 |
# 2) We're doing things prefix-style |
584 |
### Make the user |
585 |
if [[ -z $@ ]] ; then |
586 |
dscl . create /Users/${euser} UniqueID ${euid} |
587 |
dscl . create /Users/${euser} UserShell "${EROOT}${eshell}" |
588 |
dscl . create /Users/${euser} NFSHomeDirectory "${EROOT}${ehome}" |
589 |
dscl . create /Users/${euser} RealName "${euser}, added by portage for ${PN}" |
590 |
# FAFHRD NOTE: So, it seems that Password = '*' is really |
591 |
# the key to a user being able to login via the login |
592 |
# screen or not; also, all users created via the |
593 |
# System Preferences.app menu are in group 'staff'; |
594 |
# so, given both of these facts, allow "real" users to |
595 |
# be created if their primary group is 'staff'; |
596 |
# granted, you still need to set a password |
597 |
# post user creation to actually log in. |
598 |
# WARNING: you need to log out first to see the user |
599 |
# in the login screen or the account switching menu. |
600 |
[[ ! "${edefgroup}" == "staff" ]] && \ |
601 |
dscl . create /Users/${euser} Password '*' |
602 |
### Add the user to the groups specified |
603 |
# Yes, the default user group is 'staff' (on OSX 10.5) |
604 |
if [[ ! -z "${edefgroup}" ]]; then |
605 |
local defgid=$(dscl . -read /Groups/$edefgroup |grep PrimaryGroupID |awk -F' ' '{print $2}') |
606 |
dscl . create /Users/${euser} PrimaryGroupID "${defgid}" |
607 |
dscl . merge /Groups/${edefgroup} GroupMembership ${euser} |
608 |
fi |
609 |
local oldifs=${IFS} |
610 |
export IFS="," |
611 |
if [ ! -z ${eexgroups} ]; then |
612 |
for g in ${eexgroups} ; do |
613 |
dscl . merge /Groups/${g} GroupMembership ${euser} |
614 |
done |
615 |
fi |
616 |
export IFS=${oldifs} |
617 |
else |
618 |
einfo "Extra options are not supported on Darwin yet" |
619 |
einfo "Please report the ebuild along with the info below" |
620 |
einfo "eextra: $@" |
621 |
die "Required function missing" |
622 |
fi |
623 |
;; |
578 |
*-darwin*) |
624 |
*-darwin*) |
579 |
### Make the user |
625 |
### Make the user |
580 |
if [[ -z $@ ]] ; then |
626 |
if [[ -z $@ ]] ; then |