Save client name for userok().
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4857 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -47,6 +47,7 @@ RCSID("$Id$");
|
|||||||
|
|
||||||
struct gss_data {
|
struct gss_data {
|
||||||
gss_ctx_id_t context_hdl;
|
gss_ctx_id_t context_hdl;
|
||||||
|
char *client_name;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@@ -164,11 +165,27 @@ gss_adat(void *app_data, void *buf, size_t len)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(maj_stat == GSS_S_COMPLETE){
|
if(maj_stat == GSS_S_COMPLETE){
|
||||||
|
char *name;
|
||||||
|
gss_buffer_desc export_name;
|
||||||
|
maj_stat = gss_export_name(&min_stat, client_name, &export_name);
|
||||||
|
if(maj_stat != 0) {
|
||||||
|
reply(500, "Error exporting name");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
name = realloc(export_name.value, export_name.length + 1);
|
||||||
|
if(name == NULL) {
|
||||||
|
reply(500, "Out of memory");
|
||||||
|
free(export_name.value);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
name[export_name.length] = '\0';
|
||||||
|
d->client_name = name;
|
||||||
if(p)
|
if(p)
|
||||||
reply(235, "ADAT=%s", p);
|
reply(235, "ADAT=%s", p);
|
||||||
else
|
else
|
||||||
reply(235, "ADAT Complete");
|
reply(235, "ADAT Complete");
|
||||||
sec_complete = 1;
|
sec_complete = 1;
|
||||||
|
|
||||||
} else if(maj_stat == GSS_S_CONTINUE_NEEDED)
|
} else if(maj_stat == GSS_S_CONTINUE_NEEDED)
|
||||||
if(p)
|
if(p)
|
||||||
reply(335, "ADAT=%s", p);
|
reply(335, "ADAT=%s", p);
|
||||||
@@ -176,15 +193,12 @@ gss_adat(void *app_data, void *buf, size_t len)
|
|||||||
reply(335, "OK, need more data");
|
reply(335, "OK, need more data");
|
||||||
else
|
else
|
||||||
reply(535, "foo?");
|
reply(535, "foo?");
|
||||||
|
out:
|
||||||
free(p);
|
free(p);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
int gss_userok(void*, char*);
|
||||||
gss_userok()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct sec_server_mech gss_server_mech = {
|
struct sec_server_mech gss_server_mech = {
|
||||||
"GSSAPI",
|
"GSSAPI",
|
||||||
|
Reference in New Issue
Block a user