Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
cac10d52
Commit
cac10d52
authored
Jan 19, 2012
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use cfs_read_file in pvemailforward
parent
b555d157
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
pvemailforward
bin/pvemailforward
+7
-6
No files found.
bin/pvemailforward
View file @
cac10d52
...
@@ -5,21 +5,22 @@ use warnings;
...
@@ -5,21 +5,22 @@ use warnings;
use
PVE::
Tools
;
use
PVE::
Tools
;
use
PVE::
SafeSyslog
;
use
PVE::
SafeSyslog
;
use
PVE::
AccessControl
;
use
PVE::
AccessControl
;
use
PVE::
Cluster
qw (cfs_read_file);
#
NOTE:
we
need
to
run
this
with
setgid
www
-
data
#
NOTE:
we
need
to
run
this
with
setgid
www
-
data
# else we cant read /etc/pve/user.cfg
# else we cant read /etc/pve/user.cfg
$(
=
$
);
# $GID = $EGID
$ENV
{'
PATH
'}
=
'
/sbin:/bin:/usr/sbin:/usr/bin
';
$ENV
{'
PATH
'}
=
'
/sbin:/bin:/usr/sbin:/usr/bin
';
initlog
('
pvemailforward
');
initlog
('
pvemailforward
');
eval
{
# note: that fails because we run with wrong uid (nobody)
#my $usercfg = cfs_read_file("user.cfg");
my
$filename
=
"
/etc/pve/user.cfg
";
my
$raw
=
PVE::Tools::
file_get_contents
(
$filename
);
my
$usercfg
=
PVE::AccessControl::
parse_user_config
(
$filename
,
$raw
);
PVE::Cluster::
cfs_update
();
eval
{
my
$usercfg
=
cfs_read_file
("
user.cfg
");
my
$rootcfg
=
$usercfg
->
{
users
}
->
{'
root@pam
'}
||
{};
my
$rootcfg
=
$usercfg
->
{
users
}
->
{'
root@pam
'}
||
{};
my
$mailto
=
$rootcfg
->
{
email
};
my
$mailto
=
$rootcfg
->
{
email
};
...
...
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