Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
5bdfdfef
Commit
5bdfdfef
authored
Aug 11, 2019
by
neilpang
Browse files
start 2.8.3 Forbidden sudo
parent
f82ff90f
Changes
1
Show whitespace changes
Inline
Side-by-side
acme.sh
View file @
5bdfdfef
#!/usr/bin/env sh
#!/usr/bin/env sh
VER
=
2.8.
2
VER
=
2.8.
3
PROJECT_NAME
=
"acme.sh"
PROJECT_NAME
=
"acme.sh"
...
@@ -135,6 +135,8 @@ _DNS_MANUAL_WIKI="https://github.com/Neilpang/acme.sh/wiki/dns-manual-mode"
...
@@ -135,6 +135,8 @@ _DNS_MANUAL_WIKI="https://github.com/Neilpang/acme.sh/wiki/dns-manual-mode"
_NOTIFY_WIKI
=
"https://github.com/Neilpang/acme.sh/wiki/notify"
_NOTIFY_WIKI
=
"https://github.com/Neilpang/acme.sh/wiki/notify"
_SUDO_WIKI
=
"https://github.com/Neilpang/acme.sh/wiki/sudo"
_DNS_MANUAL_ERR
=
"The dns manual mode can not renew automatically, you must issue it again manually. You'd better use the other modes instead."
_DNS_MANUAL_ERR
=
"The dns manual mode can not renew automatically, you must issue it again manually. You'd better use the other modes instead."
_DNS_MANUAL_WARN
=
"It seems that you are using dns manual mode. please take care:
$_DNS_MANUAL_ERR
"
_DNS_MANUAL_WARN
=
"It seems that you are using dns manual mode. please take care:
$_DNS_MANUAL_ERR
"
...
@@ -6233,6 +6235,23 @@ _processAccountConf() {
...
@@ -6233,6 +6235,23 @@ _processAccountConf() {
}
}
_checkSudo
()
{
if
[
"
$SUDO_GID
"
]
&&
[
"
$SUDO_COMMAND
"
]
&&
[
"
$SUDO_USER
"
]
&&
[
"
$SUDO_UID
"
]
;
then
if
[
"
$SUDO_USER
"
=
"root"
]
&&
[
"
$SUDO_UID
"
=
"0"
]
;
then
#it's root using sudo, no matter it's using sudo or not, just fine
return
0
fi
if
[
"
$SUDO_COMMAND
"
=
"/bin/su"
]
;
then
#it's a normal user doing "sudo su"
#fine
return
0
fi
#otherwise
return
1
fi
return
0
}
_process
()
{
_process
()
{
_CMD
=
""
_CMD
=
""
_domain
=
""
_domain
=
""
...
@@ -6761,6 +6780,14 @@ _process() {
...
@@ -6761,6 +6780,14 @@ _process() {
done
done
if
[
"
${
_CMD
}
"
!=
"install"
]
;
then
if
[
"
${
_CMD
}
"
!=
"install"
]
;
then
if
[
"
$__INTERACTIVE
"
]
&&
!
_checkSudo
;
then
if
[
-z
"
$FORCE
"
]
;
then
#Use "echo" here, instead of _info. it's too early
echo
"It seems that you are using sudo, please read this link first:"
echo
"
$_SUDO_WIKI
"
return
1
fi
fi
__initHome
__initHome
if
[
"
$_log
"
]
;
then
if
[
"
$_log
"
]
;
then
if
[
-z
"
$_logfile
"
]
;
then
if
[
-z
"
$_logfile
"
]
;
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