Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav
eepm
Commits
53a84f60
Commit
53a84f60
authored
May 23, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit packed 3.57.2
parent
e0c79f21
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
2 deletions
+42
-2
epm.sh
packed/epm.sh
+0
-0
serv.sh
packed/serv.sh
+42
-2
No files found.
packed/epm.sh
View file @
53a84f60
This diff is collapsed.
Click to expand it.
packed/serv.sh
View file @
53a84f60
...
@@ -33,7 +33,7 @@ SHAREDIR=$PROGDIR
...
@@ -33,7 +33,7 @@ SHAREDIR=$PROGDIR
# will replaced with /etc/eepm during install
# will replaced with /etc/eepm during install
CONFIGDIR
=
$PROGDIR
/../etc
CONFIGDIR
=
$PROGDIR
/../etc
EPMVERSION
=
"3.57.
1
"
EPMVERSION
=
"3.57.
2
"
# package, single (file), pipe, git
# package, single (file), pipe, git
EPMMODE
=
"package"
EPMMODE
=
"package"
...
@@ -512,6 +512,43 @@ assure_root()
...
@@ -512,6 +512,43 @@ assure_root()
is_root
||
fatal
"run me only under root"
is_root
||
fatal
"run me only under root"
}
}
check_su_access
()
{
is_command su
&&
return
[
!
-f
/bin/su
]
&&
warning
"/bin/su is missed. Try install su package (http://altlinux.org/su)."
&&
return
1
local
group
=
"
$(
stat
-c
'%G'
/bin/su
)
"
||
fatal
warning
"Check if you are in
$group
group to have access to su command."
return
1
}
check_sudo_access
()
{
is_command
sudo
&&
return
local
cmd
=
''
local
i
for
i
in
/bin/sudo /usr/bin/sudo
;
do
[
-f
$i
]
&&
cmd
=
"
$i
"
done
[
!
-f
$cmd
]
&&
warning
"sudo command is missed. Try install sudo package (http://altlinux.org/sudo)."
&&
return
1
local
group
=
"
$(
stat
-c
'%G'
$cmd
)
"
||
fatal
warning
"Check if you are in
$group
group to have access to sudo command."
return
1
}
check_sudo_access_only
()
{
is_command
sudo
&&
return
local
cmd
=
''
local
i
for
i
in
/bin/sudo /usr/bin/sudo
;
do
[
-f
$i
]
&&
cmd
=
"
$i
"
done
[
!
-f
$cmd
]
&&
return
1
local
group
=
"
$(
stat
-c
'%G'
$cmd
)
"
||
fatal
warning
"sudo command is presence, but is not accessible for you. Check if you are in
$group
group to have access to sudo command."
return
1
}
esu
()
esu
()
{
{
if
is_root
;
then
if
is_root
;
then
...
@@ -545,9 +582,10 @@ esu()
...
@@ -545,9 +582,10 @@ esu()
escaped
=
"
$(
escape_args
"
$@
"
)
"
escaped
=
"
$(
escape_args
"
$@
"
)
"
check_sudo_access_only
# sudo is not accessible, will ask root password
# sudo is not accessible, will ask root password
if
!
set_sudo
;
then
if
!
set_sudo
;
then
check_su_access
#info "Enter root password:"
#info "Enter root password:"
if
[
-n
"
$*
"
]
;
then
if
[
-n
"
$*
"
]
;
then
[
-n
"
$quiet
"
]
||
showcmd
"su - -c
$escaped
"
[
-n
"
$quiet
"
]
||
showcmd
"su - -c
$escaped
"
...
@@ -559,6 +597,8 @@ esu()
...
@@ -559,6 +597,8 @@ esu()
fi
fi
fi
fi
check_sudo_access
#info "You can be asked about your password:"
#info "You can be asked about your password:"
if
[
-n
"
$*
"
]
;
then
if
[
-n
"
$*
"
]
;
then
[
-n
"
$quiet
"
]
||
showcmd
"
$SUDO
su - -c
$escaped
"
[
-n
"
$quiet
"
]
||
showcmd
"
$SUDO
su - -c
$escaped
"
...
...
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