projects
/
nbd.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ce6a93c
)
Actually disable oldstyle export when requested
author
Wouter Verhelst <w@uter.be>
Tue, 27 Jul 2010 12:25:10 +0000
(08:25 -0400)
committer
Wouter Verhelst <w@uter.be>
Tue, 27 Jul 2010 12:25:10 +0000
(08:25 -0400)
nbd-server.c
patch
|
blob
|
history
diff --git
a/nbd-server.c
b/nbd-server.c
index
b92170a
..
30b6181
100644
(file)
--- a/
nbd-server.c
+++ b/
nbd-server.c
@@
-109,6
+109,8
@@
gchar* config_file_pos;
gchar* runuser=NULL;
/** What group we're running as */
gchar* rungroup=NULL;
gchar* runuser=NULL;
/** What group we're running as */
gchar* rungroup=NULL;
+/** whether to export using the old negotiation protocol (port-based) */
+gboolean do_oldstyle=FALSE;
/** Logging macros, now nothing goes to syslog unless you say ISSERVER */
#ifdef ISSERVER
/** Logging macros, now nothing goes to syslog unless you say ISSERVER */
#ifdef ISSERVER
@@
-696,7
+698,6
@@
GArray* parse_cfile(gchar* f, GError** e) {
{ "listenaddr", FALSE, PARAM_STRING, NULL, 0 },
};
const int lp_size=sizeof(lp)/sizeof(PARAM);
{ "listenaddr", FALSE, PARAM_STRING, NULL, 0 },
};
const int lp_size=sizeof(lp)/sizeof(PARAM);
- int do_oldstyle;
PARAM gp[] = {
{ "user", FALSE, PARAM_STRING, &runuser, 0 },
{ "group", FALSE, PARAM_STRING, &rungroup, 0 },
PARAM gp[] = {
{ "user", FALSE, PARAM_STRING, &runuser, 0 },
{ "group", FALSE, PARAM_STRING, &rungroup, 0 },
@@
-1785,6
+1786,9
@@
int setup_serve(SERVER *serve) {
gchar *port = NULL;
int e;
gchar *port = NULL;
int e;
+ if(!do_oldstyle) {
+ return serve->servename ? 1 : 0;
+ }
memset(&hints,'\0',sizeof(hints));
hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG | AI_NUMERICSERV;
hints.ai_socktype = SOCK_STREAM;
memset(&hints,'\0',sizeof(hints));
hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG | AI_NUMERICSERV;
hints.ai_socktype = SOCK_STREAM;