Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
913ec763
Commit
913ec763
authored
Jan 15, 2003
by
Leigh B. Stoller
Browse files
Change jailconfig to return the sshdport.
parent
039f74e9
Changes
1
Show whitespace changes
Inline
Side-by-side
tmcd/tmcd.c
View file @
913ec763
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-200
2
University of Utah and the Flux Group.
* Copyright (c) 2000-200
3
University of Utah and the Flux Group.
* All rights reserved.
*/
...
...
@@ -4258,7 +4258,7 @@ COMMAND_PROTOTYPE(dojailconfig)
char
gid
[
TBDB_FLEN_GID
];
char
physnode
[
TBDB_FLEN_NODEID
];
char
buf
[
MYBUFSIZE
];
int
nrows
,
control_net
,
ipcount
=
0
;
int
nrows
,
control_net
,
ipcount
=
0
,
low
,
high
,
sport
;
/*
* Only vnodes get a jailconfig of course, and only allocated ones.
...
...
@@ -4273,12 +4273,12 @@ COMMAND_PROTOTYPE(dojailconfig)
}
/*
* Get the portrange for the
node
. Cons up the other params I
* Get the portrange for the
experiment
. Cons up the other params I
* can think of right now.
*/
res
=
mydb_query
(
"select
ipport_low,ipport_high from nod
es "
"where
node_
id='%s'"
,
2
,
nod
eid
);
res
=
mydb_query
(
"select
low,high from ipport_rang
es "
"where
pid='%s' and e
id='%s'"
,
2
,
pid
,
eid
);
if
(
!
res
)
{
error
(
"JAILCONFIG: %s: DB Error getting config!
\n
"
,
nodeid
);
...
...
@@ -4290,15 +4290,37 @@ COMMAND_PROTOTYPE(dojailconfig)
return
0
;
}
row
=
mysql_fetch_row
(
res
);
low
=
atoi
(
row
[
0
]);
high
=
atoi
(
row
[
1
]);
mysql_free_result
(
res
);
/*
* Now need the sshdport for this node.
*/
res
=
mydb_query
(
"select sshdport from nodes where node_id='%s'"
,
1
,
nodeid
);
if
(
!
res
)
{
error
(
"JAILCONFIG: %s: DB Error getting config!
\n
"
,
nodeid
);
return
1
;
}
if
((
int
)
mysql_num_rows
(
res
)
==
0
)
{
mysql_free_result
(
res
);
return
0
;
}
row
=
mysql_fetch_row
(
res
);
sport
=
atoi
(
row
[
0
]);
mysql_free_result
(
res
);
sprintf
(
buf
,
"PORTRANGE=
\"
%s,%s
\"\n
"
"PORTRANGE=
\"
%d,%d
\"\n
"
"SSHDPORT=%d
\n
"
"SYSVIPC=1
\n
"
"INETRAW=1
\n
"
"BPFRO=1
\n
"
,
r
ow
[
0
],
row
[
1
]
);
"BPFRO=1
\n
"
,
l
ow
,
high
,
sport
);
client_writeback
(
sock
,
buf
,
strlen
(
buf
),
tcp
);
mysql_free_result
(
res
);
/*
* Now return the IP interface list that this jail has access to.
...
...
Write
Preview
Supports
Markdown
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