|
@@ -32,6 +32,15 @@
|
32
|
32
|
#include "pxe.h"
|
33
|
33
|
#include "pxe_call.h"
|
34
|
34
|
|
|
35
|
+/** Filename used for last TFTP request
|
|
36
|
+ *
|
|
37
|
+ * This is a bug-for-bug compatibility hack needed in order to work
|
|
38
|
+ * with Microsoft Remote Installation Services (RIS). The filename
|
|
39
|
+ * used in a call to PXENV_RESTART_TFTP must be returned as the DHCP
|
|
40
|
+ * filename in subsequent calls to PXENV_GET_CACHED_INFO.
|
|
41
|
+ */
|
|
42
|
+static char *pxe_ris_filename = NULL;
|
|
43
|
+
|
35
|
44
|
/**
|
36
|
45
|
* UNLOAD BASE CODE STACK
|
37
|
46
|
*
|
|
@@ -122,6 +131,12 @@ PXENV_EXIT_t pxenv_get_cached_info ( struct s_PXENV_GET_CACHED_INFO
|
122
|
131
|
goto err;
|
123
|
132
|
}
|
124
|
133
|
|
|
134
|
+ /* Overwrite filename to work around Microsoft RIS bug */
|
|
135
|
+ if ( pxe_ris_filename ) {
|
|
136
|
+ strncpy ( dhcppkt.dhcphdr->file, pxe_ris_filename,
|
|
137
|
+ sizeof ( dhcppkt.dhcphdr->file ) );
|
|
138
|
+ }
|
|
139
|
+
|
125
|
140
|
/* Copy packet to client buffer */
|
126
|
141
|
buffer = real_to_user ( get_cached_info->Buffer.segment,
|
127
|
142
|
get_cached_info->Buffer.offset );
|
|
@@ -150,6 +165,14 @@ PXENV_EXIT_t pxenv_restart_tftp ( struct s_PXENV_TFTP_READ_FILE
|
150
|
165
|
|
151
|
166
|
DBG ( "PXENV_RESTART_TFTP " );
|
152
|
167
|
|
|
168
|
+ /* Work around Microsoft RIS bug */
|
|
169
|
+ free ( pxe_ris_filename );
|
|
170
|
+ pxe_ris_filename = strdup ( ( char * ) restart_tftp->FileName );
|
|
171
|
+ if ( ! pxe_ris_filename ) {
|
|
172
|
+ restart_tftp->Status = PXENV_STATUS_OUT_OF_RESOURCES;
|
|
173
|
+ return PXENV_EXIT_FAILURE;
|
|
174
|
+ }
|
|
175
|
+
|
153
|
176
|
/* Words cannot describe the complete mismatch between the PXE
|
154
|
177
|
* specification and any possible version of reality...
|
155
|
178
|
*/
|