[BACK] Return to cimservera.cpp CVS log [TXT][DIR] Up to [Pegasus] / pegasus / src / Pegasus / Security / Cimservera

Diff for /pegasus/src/Pegasus/Security/Cimservera/Attic/cimservera.cpp between version 1.6.30.2 and 1.6.30.3

version 1.6.30.2, 2006/12/31 21:31:06 version 1.6.30.3, 2006/12/31 22:14:51
Line 21 
Line 21 
 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 // //
 //============================================================================== //==============================================================================
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #include "cimservera.h" #include "cimservera.h"
 #include <cstdio> #include <cstdio>
 #include <Executor/Executor.h> 
  
 int main(int argc, char* argv[]) int main(int argc, char* argv[])
 { {
     // Check argumnents.     // Check argumnents.
  
     if (argc != 2)     if (argc != 2)
     {     {
         fprintf(stderr, "Usage: %s <socket-number>\n", argv[0]);         fprintf(stderr, "Usage: %s <socket-number>\n", argv[0]);
         exit(1);         exit(1);
     }     }
  
     // Open socket stream.     // Open socket stream.
  
     int sock;     int sock;
     {     {
Line 54 
Line 53 
  
         if (*end != '\0')         if (*end != '\0')
         {         {
             fprintf(stderr, "%s : bad socket argument: %s\n", argv[0], argv[1]);             fprintf(stderr, "%s : bad socket argument: %s\n", argv[0], argv[1]);
             exit(1);             exit(1);
         }         }
                  
         sock = int(x);         sock = int(x);
     }     }
  
     // Wait on request.     // Wait on request.
  
     CimserveraRequest request;     CimserveraRequest request;
  
     // Wait on request.     // Wait on request.
     if (CimserveraRecv(sock, &request, sizeof(request)) != sizeof(request))     if (Recv(sock, &request, sizeof(request)) != sizeof(request))
     {     {
         close(sock);         close(sock);
         return -1;         return -1;
     }     }
  
     if (strcmp(request.arg0, "authenticate") == 0)     if (strcmp(request.arg0, "authenticate") == 0)
     {     {
         int status = PAMAuthenticate(request.arg1, request.arg2);         int status = PAMAuthenticate(request.arg1, request.arg2);
         CimserveraSend(sock, &status, sizeof(status));         Send(sock, &status, sizeof(status));
     }     }
     else if (strcmp(request.arg0, "validateUser") == 0)     else if (strcmp(request.arg0, "validateUser") == 0)
     {     {
         int status = PAMValidateUser(request.arg1);         int status = PAMValidateUser(request.arg1);
         CimserveraSend(sock, &status, sizeof(status));         Send(sock, &status, sizeof(status));
     }     }
     else     else
     {     {
         fprintf(stderr, "%s: bad request\n", argv[0]);         fprintf(stderr, "%s: bad request\n", argv[0]);
         close(sock);         close(sock);
         exit(1);         exit(1);
     }     }
  
     close(sock);     close(sock);
  
     exit(0);     exit(0);
     return 0;     return 0;
 } }


Legend:
Removed from v.1.6.30.2 
changed lines
 Added in v.1.6.30.3