Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zimbra
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
zimbra
Commits
0c17ba49
Commit
0c17ba49
authored
Apr 16, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disable root check; run scripts as user current user instead of zimbra
parent
59b5be37
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
ZimbraServer/src/bin/zmcertmgr
ZimbraServer/src/bin/zmcertmgr
+11
-9
No files found.
ZimbraServer/src/bin/zmcertmgr
View file @
0c17ba49
...
@@ -14,10 +14,11 @@
...
@@ -14,10 +14,11 @@
# ***** END LICENSE BLOCK *****
# ***** END LICENSE BLOCK *****
#
#
if
[
x
`
whoami
`
!=
"xroot"
]
;
then
## XXX SLAPOS need to run this as regular user
echo
"
$0
must be run as user root"
#if [ x`whoami` != "xroot" ]; then
exit
1
# echo "$0 must be run as user root"
fi
# exit 1
#fi
umask
027
umask
027
platform
=
$(
/opt/zimbra/libexec/get_plat_tag.sh 2> /dev/null :
=
UNKNOWN
)
platform
=
$(
/opt/zimbra/libexec/get_plat_tag.sh 2> /dev/null :
=
UNKNOWN
)
...
@@ -30,6 +31,7 @@ zmsetvars -f \
...
@@ -30,6 +31,7 @@ zmsetvars -f \
zimbra_java_home
\
zimbra_java_home
\
zimbra_uid
\
zimbra_uid
\
zimbra_gid
\
zimbra_gid
\
zimbra_user
\
zimbra_zmcertmgr_expiration_threshold
\
zimbra_zmcertmgr_expiration_threshold
\
ldap_is_master
\
ldap_is_master
\
ldap_host
\
ldap_host
\
...
@@ -40,7 +42,7 @@ zmsetvars -f \
...
@@ -40,7 +42,7 @@ zmsetvars -f \
mailboxd_truststore_password
\
mailboxd_truststore_password
\
postfix_smtpd_tls_cert_file
\
postfix_smtpd_tls_cert_file
\
postfix_smtpd_tls_key_file
postfix_smtpd_tls_key_file
export
JAVA_HOME
=
${
zimbra_java_home
}
export
JAVA_HOME
=
${
zimbra_java_home
}
java_version
=
$(
${
zimbra_java_home
}
/bin/java
-version
2>&1 |
grep
"java version"
|
sed
-e
's/"//g'
|
awk
'{print $NF}'
|
awk
-F_
'{print $1}'
)
java_version
=
$(
${
zimbra_java_home
}
/bin/java
-version
2>&1 |
grep
"java version"
|
sed
-e
's/"//g'
|
awk
'{print $NF}'
|
awk
-F_
'{print $1}'
)
...
@@ -181,7 +183,7 @@ getHostInfo() {
...
@@ -181,7 +183,7 @@ getHostInfo() {
isLdapRunning
()
{
isLdapRunning
()
{
su -
zimbra
-c
"/opt/zimbra/bin/ldap status > /dev/null 2>&1"
su -
${
zimbra_user
}
-c
"/opt/zimbra/bin/ldap status > /dev/null 2>&1"
LDAP_IS_RUNNING
=
$?
LDAP_IS_RUNNING
=
$?
}
}
...
@@ -208,7 +210,7 @@ saveConfigKey() {
...
@@ -208,7 +210,7 @@ saveConfigKey() {
#fi
#fi
echo
-n
"** Saving
$location
config key
$key
..."
echo
-n
"** Saving
$location
config key
$key
..."
su -
zimbra
-c
"
${
zimbra_home
}
/bin/zmprov -m -l --
${
zmprov_opts
}
${
key
}
\"
$content
\"
2> /dev/null"
su -
${
zimbra_user
}
-c
"
${
zimbra_home
}
/bin/zmprov -m -l --
${
zmprov_opts
}
${
key
}
\"
$content
\"
2> /dev/null"
if
[
$?
=
0
]
;
then
if
[
$?
=
0
]
;
then
echo
"done."
echo
"done."
else
else
...
@@ -237,7 +239,7 @@ loadConfigKey() {
...
@@ -237,7 +239,7 @@ loadConfigKey() {
chown
${
zimbra_uid
}
${
tmpfile
}
chown
${
zimbra_uid
}
${
tmpfile
}
if
[
!
-s
${
file
}
]
;
then
if
[
!
-s
${
file
}
]
;
then
echo
-n
"** Retrieving
$location
config key
$key
..."
echo
-n
"** Retrieving
$location
config key
$key
..."
su -
zimbra
-c
"
${
zimbra_home
}
/bin/zmprov -m -l --
${
zmprov_opts
}
${
key
}
| sed -e 's/^
${
key
}
: //' >
${
tmpfile
}
2> /dev/null"
2>/dev/null
&&
mv
-f
${
tmpfile
}
${
file
}
2> /dev/null
su -
${
zimbra_user
}
-c
"
${
zimbra_home
}
/bin/zmprov -m -l --
${
zmprov_opts
}
${
key
}
| sed -e 's/^
${
key
}
: //' >
${
tmpfile
}
2> /dev/null"
2>/dev/null
&&
mv
-f
${
tmpfile
}
${
file
}
2> /dev/null
if
[
$?
=
0
-a
-s
"
${
file
}
"
]
;
then
if
[
$?
=
0
-a
-s
"
${
file
}
"
]
;
then
echo
"done."
echo
"done."
else
else
...
@@ -1006,7 +1008,7 @@ createCert() {
...
@@ -1006,7 +1008,7 @@ createCert() {
if
[
x
"
${
ALLSERVERS
}
"
=
"x-allserver"
]
;
then
if
[
x
"
${
ALLSERVERS
}
"
=
"x-allserver"
]
;
then
# merge these with cli specified. -bp
# merge these with cli specified. -bp
subject_alt_names
=
`
su -
zimbra
-c
"
${
zimbra_home
}
/bin/zmprov -m -l gas | xargs "
`
subject_alt_names
=
`
su -
${
zimbra_user
}
-c
"
${
zimbra_home
}
/bin/zmprov -m -l gas | xargs "
`
createCSR self
-new
-keysize
${
KEYSIZE
}
createCSR self
-new
-keysize
${
KEYSIZE
}
shift
shift
elif
[
!
-s
"
${
server_csr
}
"
-o
x
"
${
IS_NEW_CRT
}
"
=
"x-new"
]
;
then
elif
[
!
-s
"
${
server_csr
}
"
-o
x
"
${
IS_NEW_CRT
}
"
=
"x-new"
]
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment