Now compiled with the same CFLAGS as the rest of Squid.
This is tested up to gcc 3.4 standards now. Some may still
be raised by later gcc versions.
- fixes const correctness on several functions and globals
- fixes .h wrapping on several files
- adds prototype definitions for all functions
- adds several missing includes
- adds docs for some functions to auto-doc output
TODO:
Not all code audited, only the bits shown broken right now.
This helper contains a large amount of nasty duplicate code
and re-implements several encryption algoritms that should
probably be sourced from secure places.
/* this one is reallllly haackiish. We really should be using anything from smblib-priv.h
*/
-static char *SMB_Prots[] = {"PC NETWORK PROGRAM 1.0",
+static char const *SMB_Prots[] = {"PC NETWORK PROGRAM 1.0",
"MICROSOFT NETWORKS 1.03",
"MICROSOFT NETWORKS 3.0",
"DOS LANMAN1.0",
/* these are part of rfcnb-priv.h and smblib-priv.h */
extern int SMB_Get_Error_Msg(int msg, char *msgbuf, int len);
-extern int SMB_Get_Last_Error();
-extern int SMB_Get_Last_SMB_Err();
-extern int RFCNB_Get_Last_Error();
+extern int SMB_Get_Last_Error(void);
+extern int SMB_Get_Last_SMB_Err(void);
+extern int RFCNB_Get_Last_Error(void);
+
#include <errno.h>
#include <assert.h>
#endif
+/* local functions */
+void send_bh_or_ld(char const *bhmessage, ntlm_authenticate * failedauth, int authlen);
+void usage(void);
+void process_options(int argc, char *argv[]);
+const char * obtain_challenge(void);
+void manage_request(void);
+
+
#ifdef DEBUG
char error_messages_buffer[BUFFER_SIZE];
#endif
void
-send_bh_or_ld(char *bhmessage, ntlm_authenticate * failedauth, int authlen)
+send_bh_or_ld(char const *bhmessage, ntlm_authenticate * failedauth, int authlen)
{
#ifdef NTLM_FAIL_OPEN
char *creds = NULL;
last_dc->next = controllers; /* close the queue, now it's circular */
}
-/* tries connecting to the domain controllers in the "controllers" ring,
+/**
+ * tries connecting to the domain controllers in the "controllers" ring,
* with failover if the adequate option is specified.
*/
const char *
*/
#include <string.h>
#include "std-defines.h" /* for the types */
+#include "md4.h"
static uint32 A, B, C, D;
-void mdfour(unsigned char *out, unsigned char *in, int n);\r
+#ifndef __SMB_LM_SMBVAL_MD4_H
+#define __SMB_LM_SMBVAL_MD4_H
+
+extern void mdfour(unsigned char *out, unsigned char *in, int n);
+
+#endif /* __SMB_LM_SMBVAL_MD4_H */
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#ifndef _SMB_LM_SMBVAL_RFCNB_COMMON_H
+#define _SMB_LM_SMBVAL_RFCNB_COMMON_H
+
/* A data structure we need */
typedef struct RFCNB_Pkt {
struct RFCNB_Pkt *next;
} RFCNB_Pkt;
+
+#endif /* _SMB_LM_SMBVAL_RFCNB_COMMON_H */
#define RFCNBE_Timeout 16 /* IO Timed out */
/* Text strings for the error responses */
-extern char *RFCNB_Error_Strings[];
+extern char const *RFCNB_Error_Strings[];
/*
* static char *RFCNB_Error_Strings[] = {
*
#include <sys/signal.h>
#include <string.h>
-int RFCNB_Timeout = 0; /* Timeout in seconds ... */
+/* local functions */
+void rfcnb_alarm(int sig);
+int RFCNB_Set_Timeout(int seconds);
+int RFCNB_Discard_Rest(struct RFCNB_Con *con, int len);
+
+/* local globals */
+
+int RFCNB_Timeout = 0; /**< Timeout in seconds ... */
void
rfcnb_alarm(int sig)
{
-
fprintf(stderr, "IO Timed out ...\n");
-
}
-/* Set timeout value and setup signal handling */
-
+/** Set timeout value and setup signal handling */
int
RFCNB_Set_Timeout(int seconds)
{
}
-/* Discard the rest of an incoming packet as we do not have space for it
- * in the buffer we allocated or were passed ... */
-
+/** Discard the rest of an incoming packet as we do not have space for it
+ * in the buffer we allocated or were passed ...
+ */
int
RFCNB_Discard_Rest(struct RFCNB_Con *con, int len)
{
}
-/* Send an RFCNB packet to the connection.
+/** Send an RFCNB packet to the connection.
*
* We just send each of the blocks linked together ...
*
* If we can, try to send it as one iovec ...
*
*/
-
int
RFCNB_Put_Pkt(struct RFCNB_Con *con, struct RFCNB_Pkt *pkt, int len)
{
}
-/* Read an RFCNB packet off the connection.
+/** Read an RFCNB packet off the connection.
*
* We read the first 4 bytes, that tells us the length, then read the
* rest. We should implement a timeout, but we don't just yet
*
*/
-
-
int
RFCNB_Get_Pkt(struct RFCNB_Con *con, struct RFCNB_Pkt *pkt, int len)
{
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-int RFCNB_Put_Pkt(struct RFCNB_Con *con, struct RFCNB_Pkt *pkt, int len);
+#ifndef _SMB_LM_SMBVAL_RFCNB_IO_H
+#define _SMB_LM_SMBVAL_RFCNB_IO_H
-int RFCNB_Get_Pkt(struct RFCNB_Con *con, struct RFCNB_Pkt *pkt, int len);
+extern int RFCNB_Put_Pkt(struct RFCNB_Con *con, struct RFCNB_Pkt *pkt, int len);
-void RFCNB_Free_Pkt(struct RFCNB_Pkt *pkt);
+extern int RFCNB_Get_Pkt(struct RFCNB_Con *con, struct RFCNB_Pkt *pkt, int len);
+
+extern void RFCNB_Free_Pkt(struct RFCNB_Pkt *pkt);
+
+#endif /* _SMB_LM_SMBVAL_RFCNB_IO_H */
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#ifndef SMB_LM_SMBVAL_RFCNB_H
+#define SMB_LM_SMBVAL_RFCNB_H
+
/* Error responses */
#include "rfcnb-error.h"
#include "rfcnb-common.h"
#include "smblib-priv.h"
+#include "rfcnb-priv.h"
/* Defines we need */
/* Definition of routines we define */
-void *RFCNB_Call(char *Called_Name, char *Calling_Name, char *Called_Address,
- int port);
+extern void *RFCNB_Call(char *Called_Name, char *Calling_Name, char *Called_Address, int port);
+
+extern int RFCNB_Send(struct RFCNB_Con *Con_Handle, struct RFCNB_Pkt *Data, int Length);
-int RFCNB_Send(void *Con_Handle, struct RFCNB_Pkt *Data, int Length);
+extern int RFCNB_Recv(void *Con_Handle, struct RFCNB_Pkt *Data, int Length);
-int RFCNB_Recv(void *Con_Handle, struct RFCNB_Pkt *Data, int Length);
+extern int RFCNB_Hangup(struct RFCNB_Con *con_Handle);
-int RFCNB_Hangup(void *con_Handle);
+extern void *RFCNB_Listen(void);
-void *RFCNB_Listen();
+extern void RFCNB_Get_Error(char *buffer, int buf_len);
-void RFCNB_Get_Error(char *buffer, int buf_len);
+extern struct RFCNB_Pkt *RFCNB_Alloc_Pkt(int n);
-struct RFCNB_Pkt *RFCNB_Alloc_Pkt(int n);
+extern void RFCNB_Free_Pkt(struct RFCNB_Pkt *pkt);
-void RFCNB_Free_Pkt(struct RFCNB_Pkt *pkt);
+extern int RFCNB_Set_Sock_NoDelay(struct RFCNB_Con *con_Handle, BOOL yn);
-int RFCNB_Set_Sock_NoDelay(void *con_Handle, BOOL yn);
+#endif /* SMB_LM_SMBVAL_RFCNB_H */
#include "rfcnb-priv.h"
#include "rfcnb-util.h"
#include "rfcnb-io.h"
+#include "rfcnb.h"
+
+
+/* local functions */
+
+int RFCNB_Get_Last_Error(void);
+int RFCNB_Get_Last_Errno(void);
+void RFCNB_Get_Error_Msg(int code, char *msg_buf, int len);
+void RFCNB_Register_Print_Routine(void (*fn) ());
/* global data structures */
-char *RFCNB_Error_Strings[] = {
+char const * RFCNB_Error_Strings[] = {
"RFCNBE_OK: Routine completed successfully.",
"RFCNBE_NoSpace: No space available for a malloc call.",
* up with a different answer to the one above)
*/
+#include "smbdes.h"
+
+/* local functions */
+void cred_hash1(unsigned char *out, unsigned char *in, unsigned char *key);
+void cred_hash2(unsigned char *out, unsigned char *in, unsigned char *key);
static int perm1[56] = {57, 49, 41, 33, 25, 17, 9,
-void E_P16(unsigned char *p14, unsigned char *p16);
-void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24);
+#ifndef __SMB_LM_SMBVAL_SMBDES_H
+#define __SMB_LM_SMBVAL_SMBDES_H
+
+extern void E_P16(unsigned char *p14, unsigned char *p16);
+extern void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24);
+
+#endif /* __SMB_LM_SMBVAL_SMBDES_H */
#include "smblib-priv.h"
#include "md4.h"
#include "smbdes.h"
+
#define uchar unsigned char
extern int DEBUGLEVEL;
#include "byteorder.h"
+#include "smbencrypt.h"
+/* local functions */
char *StrnCpy(char *dest, char *src, int n);
void strupper(char *s);
+void E_md4hash(uchar * passwd, uchar * p16);
+void nt_lm_owf_gen(char *pwd, char *nt_p16, char *p16);
/*
* This implements the X/Open SMB password encryption
return i;
}
-/*
+/**
* Creates the MD4 Hash of the users password in NT UNICODE.
*/
-
void
E_md4hash(uchar * passwd, uchar * p16)
{
}
/* Does the NT MD4 hash then des encryption. */
-
void
SMBNTencrypt(uchar * passwd, uchar * c8, uchar * p24)
{
E_P24(p21, c8, p24);
}
-/* Does both the NT and LM owfs of a user's password */
-
+/** Does both the NT and LM owfs of a user's password */
void
nt_lm_owf_gen(char *pwd, char *nt_p16, char *p16)
{
-void SMBencrypt(uchar * passwd, uchar * c8, uchar * p24);
-void SMBNTencrypt(uchar * passwd, uchar * c8, uchar * p24);
+#ifndef __SMB_LM_SMBVAL_SMBENCRYPT_H
+#define __SMB_LM_SMBVAL_SMBENCRYPT_H
+
+
+extern void SMBencrypt(uchar * passwd, uchar * c8, uchar * p24);
+extern void SMBNTencrypt(uchar * passwd, uchar * c8, uchar * p24);
+
+#endif /* __SMB_LM_SMBVAL_SMBENCRYPT_H */
/* We must make it possible for callers to specify these ... */
#if 0
-extern char *SMB_Prots[];
+extern char const *SMB_Prots[];
/*
* static char *SMB_Prots[] = {"PC NETWORK PROGRAM 1.0",
extern int SMBlib_SMB_Error; /* last Error */
#endif
-SMB_Tree_Handle SMB_TreeConnect(SMB_Handle_Type con, SMB_Tree_Handle tree,
- char *path, char *password, char *dev);
+extern SMB_Tree_Handle SMB_TreeConnect(SMB_Handle_Type con, SMB_Tree_Handle tree,
+ char *path, char *password, char const *dev);
-int SMB_Init();
-void SMB_Get_My_Name(char *name, int len);
-int SMB_Negotiate(SMB_Handle_Type Con_Handle, char *Prots[]);
-int SMB_Discon(SMB_Handle_Type Con_Handle, BOOL KeepHandle);
+extern int SMB_Init(void);
+extern void SMB_Get_My_Name(char *name, int len);
+extern int SMB_Negotiate(SMB_Handle_Type Con_Handle, char const *Prots[]);
+extern int SMB_Discon(SMB_Handle_Type Con_Handle, BOOL KeepHandle);
-int SMB_Logon_Server(SMB_Handle_Type Con_Handle, char *UserName,
+extern int SMB_Logon_Server(SMB_Handle_Type Con_Handle, char *UserName,
char *PassWord, char *UserDomain, int precrypted);
-int SMB_Get_Error_Msg(int msg, char *msgbuf, int len);
+extern int SMB_Get_Error_Msg(int msg, char *msgbuf, int len);
-int SMB_Get_Last_Error();
+extern int SMB_Get_Last_Error(void);
#endif /* __SMBLIB_PRIV_H__ */
#include "rfcnb.h"
+/* local functions */
+char * SMB_DOSTimToStr(int DOS_time);
+char * SMB_AtrToStr(int attribs, BOOL verbose);
+int SMB_Get_Tree_MBS(SMB_Tree_Handle tree);
+int SMB_Get_Max_Buf_Siz(SMB_Handle_Type Con_Handle);
+int SMB_Get_Protocol_IDX(SMB_Handle_Type Con_Handle);
+int SMB_Get_Protocol(SMB_Handle_Type Con_Handle);
+int SMB_Figure_Protocol(char const *dialects[], int prot_index);
+int SMB_TreeDisconnect(SMB_Tree_Handle Tree_Handle, BOOL discard);
+// int SMB_Get_Last_Error(void);
+int SMB_Get_Last_SMB_Err(void);
+
+
/* global data structures */
static int SMB_Types[] = {SMB_P_Core,
-1
};
-static char *SMB_Prots[] = {"PC NETWORK PROGRAM 1.0",
+static char const *SMB_Prots[] = {"PC NETWORK PROGRAM 1.0",
"MICROSOFT NETWORKS 1.03",
"MICROSOFT NETWORKS 3.0",
"DOS LANMAN1.0",
};
/* Print out an SMB pkt in all its gory detail ... */
-
+#if 0 // DEAD CODE
void
SMB_Print_Pkt(FILE fd, RFCNB_Pkt * pkt, BOOL command, int Offset, int Len)
{
/* etc */
}
+#endif /* 0 */
/* Convert a DOS Date_Time to a local host type date time for printing */
}
-/* Convert an attribute byte/word etc to a string ... We return a pointer
+/**
+ * Convert an attribute byte/word etc to a string ... We return a pointer
* to a static string which we guarantee is long enough. If verbose is
- * true, we print out long form of strings ... */
-
+ * true, we print out long form of strings ...
+ */
char *
SMB_AtrToStr(int attribs, BOOL verbose)
{
}
-/* Pick up the Max Buffer Size from the Tree Structure ... */
-
+/** Pick up the Max Buffer Size from the Tree Structure ... */
int
SMB_Get_Tree_MBS(SMB_Tree_Handle tree)
{
}
}
-/* Pick up the Max buffer size */
-
+/** Pick up the Max buffer size */
int
SMB_Get_Max_Buf_Siz(SMB_Handle_Type Con_Handle)
{
}
}
-/* Pickup the protocol index from the connection structure */
+/* Pickup the protocol index from the connection structure */
int
SMB_Get_Protocol_IDX(SMB_Handle_Type Con_Handle)
{
}
-/* Pick up the protocol from the connection structure */
-
+/** Pick up the protocol from the connection structure */
int
SMB_Get_Protocol(SMB_Handle_Type Con_Handle)
{
}
-/* Figure out what protocol was accepted, given the list of dialect strings */
-/* We offered, and the index back from the server. We allow for a user */
-/* supplied list, and assume that it is a subset of our list */
-
+/**
+ * Figure out what protocol was accepted, given the list of dialect strings
+ * We offered, and the index back from the server. We allow for a user
+ * supplied list, and assume that it is a subset of our list
+ */
int
-SMB_Figure_Protocol(char *dialects[], int prot_index)
+SMB_Figure_Protocol(char const *dialects[], int prot_index)
{
int i;
/* none acceptible, and our return value is 0 if ok, <0 if problems */
int
-SMB_Negotiate(SMB_Handle_Type Con_Handle, char *Prots[])
+SMB_Negotiate(SMB_Handle_Type Con_Handle, char const *Prots[])
{
struct RFCNB_Pkt *pkt;
int prots_len, i, pkt_len, prot, alloc_len;
prots_len = 0;
for (i = 0; Prots[i] != NULL; i++) {
-
prots_len = prots_len + strlen(Prots[i]) + 2; /* Account for null etc */
-
}
/* The -1 accounts for the one byte smb_buf we have because some systems */
/* Which is a problem, because the encryption key len eec may be long */
if (pkt_len < (SMB_hdr_wct_offset + (19 * 2) + 40)) {
-
alloc_len = SMB_hdr_wct_offset + (19 * 2) + 40;
-
} else {
-
alloc_len = pkt_len;
-
}
pkt = (struct RFCNB_Pkt *) RFCNB_Alloc_Pkt(alloc_len);
if (pkt == NULL) {
-
SMBlib_errno = SMBlibE_NoSpace;
return (SMBlibE_BAD);
-
}
- /* Now plug in the bits we need */
+ /* Now plug in the bits we need */
memset(SMB_Hdr(pkt), 0, SMB_negp_len);
SIVAL(SMB_Hdr(pkt), SMB_hdr_idf_offset, SMB_DEF_IDF); /* Plunk in IDF */
*(SMB_Hdr(pkt) + SMB_hdr_com_offset) = SMBnegprot;
SSVAL(SMB_Hdr(pkt), SMB_hdr_mid_offset, Con_Handle->mid);
SSVAL(SMB_Hdr(pkt), SMB_hdr_uid_offset, Con_Handle->uid);
*(SMB_Hdr(pkt) + SMB_hdr_wct_offset) = 0;
-
SSVAL(SMB_Hdr(pkt), SMB_negp_bcc_offset, prots_len);
/* Now copy the prot strings in with the right stuff */
p = (char *) (SMB_Hdr(pkt) + SMB_negp_buf_offset);
for (i = 0; Prots[i] != NULL; i++) {
-
*p = SMBdialectID;
strcpy(p + 1, Prots[i]);
p = p + strlen(Prots[i]) + 2; /* Adjust len of p for null plus dialectID */
-
}
/* Now send the packet and sit back ... */
-
if (RFCNB_Send(Con_Handle->Trans_Connect, pkt, pkt_len) < 0) {
-
-
#ifdef DEBUG
fprintf(stderr, "Error sending negotiate protocol\n");
#endif
-
RFCNB_Free_Pkt(pkt);
SMBlib_errno = -SMBlibE_SendFailed; /* Failed, check lower layer errno */
return (SMBlibE_BAD);
-
}
- /* Now get the response ... */
+ /* Now get the response ... */
if (RFCNB_Recv(Con_Handle->Trans_Connect, pkt, alloc_len) < 0) {
-
#ifdef DEBUG
fprintf(stderr, "Error receiving response to negotiate\n");
#endif
-
RFCNB_Free_Pkt(pkt);
SMBlib_errno = -SMBlibE_RecvFailed; /* Failed, check lower layer errno */
return (SMBlibE_BAD);
-
}
- if (CVAL(SMB_Hdr(pkt), SMB_hdr_rcls_offset) != SMBC_SUCCESS) { /* Process error */
+ if (CVAL(SMB_Hdr(pkt), SMB_hdr_rcls_offset) != SMBC_SUCCESS) { /* Process error */
#ifdef DEBUG
fprintf(stderr, "SMB_Negotiate failed with errorclass = %i, Error Code = %i\n",
CVAL(SMB_Hdr(pkt), SMB_hdr_rcls_offset),
SVAL(SMB_Hdr(pkt), SMB_hdr_err_offset));
#endif
-
SMBlib_SMB_Error = IVAL(SMB_Hdr(pkt), SMB_hdr_rcls_offset);
RFCNB_Free_Pkt(pkt);
SMBlib_errno = SMBlibE_Remote;
return (SMBlibE_BAD);
-
}
- if (SVAL(SMB_Hdr(pkt), SMB_negrCP_idx_offset) == 0xFFFF) {
+ if (SVAL(SMB_Hdr(pkt), SMB_negrCP_idx_offset) == 0xFFFF) {
#ifdef DEBUG
fprintf(stderr, "None of our protocols was accepted ... ");
#endif
-
RFCNB_Free_Pkt(pkt);
SMBlib_errno = SMBlibE_NegNoProt;
return (SMBlibE_BAD);
-
}
+
/* Now, unpack the info from the response, if any and evaluate the proto */
/* selected. We must make sure it is one we like ... */
-
Con_Handle->prot_IDX = prot = SVAL(SMB_Hdr(pkt), SMB_negrCP_idx_offset);
Con_Handle->protocol = SMB_Figure_Protocol(Prots, prot);
if (Con_Handle->protocol == SMB_P_Unknown) { /* No good ... */
-
RFCNB_Free_Pkt(pkt);
SMBlib_errno = SMBlibE_ProtUnknown;
return (SMBlibE_BAD);
-
}
switch (CVAL(SMB_Hdr(pkt), SMB_hdr_wct_offset)) {
case 0x01: /* No more info ... */
-
break;
case 13: /* Up to and including LanMan 2.1 */
p = (SMB_Hdr(pkt) + SMB_negrLM_buf_offset + Con_Handle->Encrypt_Key_Len);
strncpy(p, Con_Handle->Svr_PDom, sizeof(Con_Handle->Svr_PDom) - 1);
-
break;
case 17: /* NT LM 0.12 and LN LM 1.0 */
SMB_Tree_Handle Tree_Handle,
char *path,
char *password,
- char *device)
+ char const *device)
{
struct RFCNB_Pkt *pkt;
int param_len, pkt_len;
}
-/* Pick up the last error returned in an SMB packet */
-/* We will need macros to extract error class and error code */
-
+/** Pick up the last error returned in an SMB packet
+ * We will need macros to extract error class and error code
+ */
int
SMB_Get_Last_SMB_Err()
{
/* Keep this table in sync with the message codes in smblib-common.h */
-static char *SMBlib_Error_Messages[] = {
+static char const *SMBlib_Error_Messages[] = {
"Request completed sucessfully.",
"Server returned a non-zero SMB Error Class and Code.",
#include <signal.h>
+/* local functions */
+int SMB_Term(void);
+SMB_Handle_Type SMB_Create_Con_Handle(void);
+int SMBlib_Set_Sock_NoDelay(SMB_Handle_Type Con_Handle, BOOL yn);
+SMB_Handle_Type SMB_Connect_Server(SMB_Handle_Type Con_Handle, char *server, char *NTdomain);
+SMB_Handle_Type SMB_Connect(SMB_Handle_Type Con_Handle, SMB_Tree_Handle * tree, char *service, char *username, char *password);
+
+
/* #define DEBUG */
SMB_State_Types SMBlib_State;
}
-/* SMB_Create: Create a connection structure and return for later use */
-/* We have other helper routines to set variables */
-
+/**
+ * SMB_Create: Create a connection structure and return for later use
+ * We have other helper routines to set variables
+ */
SMB_Handle_Type
SMB_Create_Con_Handle()
{
-
SMBlib_errno = SMBlibE_NotImpl;
return (NULL);
-
}
int
SMBlib_Set_Sock_NoDelay(SMB_Handle_Type Con_Handle, BOOL yn)
{
-
-
if (RFCNB_Set_Sock_NoDelay(Con_Handle->Trans_Connect, yn) < 0) {
-
-#ifdef DEBUG
-#endif
-
fprintf(stderr, "Setting no-delay on TCP socket failed ...\n");
-
}
return (0);
-
}
/* SMB_Connect_Server: Connect to a server, but don't negotiate protocol */
/* or anything else ... */
-
SMB_Handle_Type
SMB_Connect_Server(SMB_Handle_Type Con_Handle,
char *server, char *NTdomain)
/* If Con_Handle == NULL then create a handle and connect, otherwise */
/* use the handle passed */
-char *SMB_Prots_Restrict[] = {"PC NETWORK PROGRAM 1.0",
+char const *SMB_Prots_Restrict[] = {"PC NETWORK PROGRAM 1.0",
NULL
};
return NULL;
}
- /* Now, negotiate the protocol */
+ /* Now, negotiate the protocol */
if (SMB_Negotiate(con, SMB_Prots_Restrict) < 0) {
/* Hmmm what should we do here ... We have a connection, but could not
* negotiate ... */
-
return NULL;
-
}
- /* Now connect to the service ... */
+ /* Now connect to the service ... */
if ((*tree = SMB_TreeConnect(con, NULL, service, password, "A:")) == NULL) {
-
return NULL;
-
}
return (con);
Valid_User(char *username, char *password, char *server, char *backup, char *domain)
{
int pass_is_precrypted_p = 0;
- char *SMB_Prots[] = {
+ char const *SMB_Prots[] = {
/* "PC NETWORK PROGRAM 1.0", */
/* "MICROSOFT NETWORKS 1.03", */
/* "MICROSOFT NETWORKS 3.0", */
- (char*)"LANMAN1.0",
- (char*)"LM1.2X002",
- (char*)"Samba",
+ "LANMAN1.0",
+ "LM1.2X002",
+ "Samba",
/* "NT LM 0.12", */
/* "NT LANMAN 1.0", */
NULL
void *
NTLM_Connect(char *server, char *backup, char *domain, char *nonce)
{
- char *SMB_Prots[] = {
+ char const *SMB_Prots[] = {
/* "PC NETWORK PROGRAM 1.0", */
/* "MICROSOFT NETWORKS 1.03", */
/* "MICROSOFT NETWORKS 3.0", */
- (char*)"LANMAN1.0",
- (char*)"LM1.2X002",
- (char*)"Samba",
+ "LANMAN1.0",
+ "LM1.2X002",
+ "Samba",
/* "NT LM 0.12", */
/* "NT LANMAN 1.0", */
NULL