Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Elijah Grubb
emulab-devel
Commits
6ae8e298
Commit
6ae8e298
authored
Dec 07, 2010
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes for protogeni cooked mode.
parent
7a82778e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
tmcd/tmcd.c
tmcd/tmcd.c
+22
-22
No files found.
tmcd/tmcd.c
View file @
6ae8e298
...
...
@@ -209,7 +209,8 @@ typedef struct {
char
testdb
[
TBDB_FLEN_TINYTEXT
];
char
sharing_mode
[
TBDB_FLEN_TINYTEXT
];
char
privkey
[
PRIVKEY_LEN
+
1
];
char
urn
[
URN_LEN
+
1
];
/* This key is a replacement for privkey, on protogeni resources */
char
external_key
[
PRIVKEY_LEN
+
1
];
}
tmcdreq_t
;
static
int
iptonodeid
(
struct
in_addr
,
tmcdreq_t
*
,
char
*
);
static
int
checkdbredirect
(
tmcdreq_t
*
);
...
...
@@ -1075,23 +1076,21 @@ handle_request(int sock, struct sockaddr_in *client, char *rdata, int istcp)
}
/*
* Look for
URN.
* Look for
external key
*/
if
(
sscanf
(
bp
,
"
URN=%"
XSTRINGIFY
(
URN
_LEN
)
"s"
,
buf
))
{
if
(
sscanf
(
bp
,
"
KEY=%"
XSTRINGIFY
(
PRIV
_LEN
)
"s"
,
buf
))
{
for
(
i
=
0
;
i
<
strlen
(
buf
);
i
++
){
if
(
!
(
isalnum
(
buf
[
i
])
||
buf
[
i
]
==
'_'
||
buf
[
i
]
==
'-'
||
buf
[
i
]
==
'.'
||
buf
[
i
]
==
'/'
||
buf
[
i
]
==
':'
||
buf
[
i
]
==
'+'
))
{
if
(
!
isalnum
(
buf
[
i
]))
{
info
(
"tmcd client provided invalid "
"characters in
URN
"
);
"characters in
KEY
"
);
goto
skipit
;
}
}
strncpy
(
reqp
->
urn
,
buf
,
sizeof
(
reqp
->
urn
));
strncpy
(
reqp
->
external_key
,
buf
,
sizeof
(
reqp
->
external_key
));
if
(
debug
)
{
info
(
"
URN
%s
\n
"
,
buf
);
info
(
"
KEY
%s
\n
"
,
buf
);
}
continue
;
}
...
...
@@ -1120,12 +1119,13 @@ handle_request(int sock, struct sockaddr_in *client, char *rdata, int istcp)
if
(
privkey
)
{
error
(
"No such node with wanode_key [%s]
\n
"
,
privkey
);
}
else
if
(
reqp
->
urn
[
0
])
{
else
if
(
reqp
->
external_key
[
0
])
{
if
(
reqp
->
isvnode
)
error
(
"No such vnode %s with
urn
%s
\n
"
,
reqp
->
vnodeid
,
reqp
->
urn
);
error
(
"No such vnode %s with
key
%s
\n
"
,
reqp
->
vnodeid
,
reqp
->
external_key
);
else
error
(
"No such node with urn %s
\n
"
,
reqp
->
urn
);
error
(
"No such node with key %s
\n
"
,
reqp
->
external_key
);
}
else
if
(
reqp
->
isvnode
)
{
error
(
"No such vnode %s associated with %s
\n
"
,
...
...
@@ -5546,11 +5546,11 @@ iptonodeid(struct in_addr ipaddr, tmcdreq_t *reqp, char* nodekey)
else
if
(
reqp
->
isvnode
)
{
char
clause
[
BUFSIZ
];
if
(
reqp
->
urn
[
0
])
{
if
(
reqp
->
external_key
[
0
])
{
sprintf
(
clause
,
"r.external_resource_
id
is not null and "
"r.external_resource_
id
='%s'"
,
reqp
->
urn
);
"r.external_resource_
key
is not null and "
"r.external_resource_
key
='%s'"
,
reqp
->
external_key
);
}
else
{
sprintf
(
clause
,
...
...
@@ -5596,11 +5596,11 @@ iptonodeid(struct in_addr ipaddr, tmcdreq_t *reqp, char* nodekey)
else
{
char
clause
[
BUFSIZ
];
if
(
reqp
->
urn
[
0
])
{
if
(
reqp
->
external_key
[
0
])
{
sprintf
(
clause
,
"r.external_resource_
id
is not null and "
"r.external_resource_
id
='%s'"
,
reqp
->
urn
);
"r.external_resource_
key
is not null and "
"r.external_resource_
key
='%s'"
,
reqp
->
external_key
);
}
else
{
sprintf
(
clause
,
...
...
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