ALT Linux Bugzilla
– Attachment 1609 Details for
Bug 9895
add useradd and groupadd macros
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
Макросы из rpm-build-macros-1.315-1 (PLD)
pld-user-group-macros (text/plain), 2.06 KB, created by
Sergey Vlasov
on 2006-08-28 12:37:43 MSD
(
hide
)
Description:
Макросы из rpm-build-macros-1.315-1 (PLD)
Filename:
MIME Type:
Creator:
Sergey Vlasov
Created:
2006-08-28 12:37:43 MSD
Size:
2.06 KB
patch
obsolete
># useradd/groupadd macros written by glen@pld-linux.org. ># All rights reserved. Permission to copy is hereby granted.. yada, yada, yada ># ># Usage: ># %useradd [-P package] [-u uid] [-d home_dir] [-s shell] [-c comment] ># [-g initial_group] [-G group[,...]] login ># ># -u uid. REQUIRED ># -g gid/group. REQUIRED ># -s defaults to /bin/false ># -d defaults to /usr/share/empty ># -c No default ># -r is accepted but ignored (it's always set) ># -k skeleton dir. defaults to /usr/share/empty ># rpm specific flags ># -P package name. defaults to %{name} ># >%useradd(c:d:e:f:g:G:Mmk:op:s:u:rP:) \ >%{!-u:%{error:useradd: Required argument -u missing}} \ >%{!-g:%{error:useradd: Required argument -g missing}} \ >%{!?1:%{error:useradd: Required parameter login missing}} \ >if [ -n "`/bin/id -u %{expand:%{%{#}}} 2>/dev/null`" ]; then \ > if [ "`/bin/id -u %{expand:%{%{#}}}`" != "%{-u*}" ]; then \ > echo "Error: user %{expand:%{%{#}}} doesn't have uid=%{-u*}. Correct this before installing %{-P*}%{!?-P:%{name}}." 1>&2 \ > exit 1 \ > fi \ >else \ > echo "Adding user %{expand:%{%{#}}} UID=%{-u*}." \ > /usr/sbin/useradd \\\ > %{-m:-m -k %{-k*}%{!-k:/usr/share/empty}} \\\ > -u %{-u*} \\\ > -r \\\ > -d %{-d*}%{!-d:/usr/share/empty} \\\ > -s %{-s*}%{!-s:/bin/false} \\\ > %{-c:-c "%(set -- %{-c*} %{*}; echo $1)"}\\\ > -g %{-g*} \\\ > %{-M} \\\ > %{-G:-G %{-G*}} \\\ > %{expand:%{%{#}}} 1>&2 || exit $? \ > [ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i passwd \ >fi; > ># Usage: ># %groupadd [-P package] [-g gid] group ># ># -g gid. REQUIRED ># ># Sample: ># %groupadd -P %{name}-base -g %{gid} %{name} > >%groupadd(g:P:rfo) \ >%{!-g:%{error:groupadd: Required argument -g missing}} \ >%{!?1:%{error:groupadd: Required parameter group missing}} \ >if [ -n "`/usr/bin/getgid %{1}`" ]; then \ > if [ "`/usr/bin/getgid %{1}`" != "%{-g*}" ]; then \ > echo "Error: group %{1} doesn't have gid=%{-g*}. Correct this before installing %{-P*}%{!?-P:%{name}}." 1>&2 \ > exit 1 \ > fi \ >else \ > echo "Adding group %{1} GID=%{-g*}." \ > /usr/sbin/groupadd -g %{-g*} -r %{1} 1>&2 || exit $? \ > [ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i group \ >fi;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 9895
: 1609