summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/client/clientutil.c2
-rw-r--r--source3/include/includes.h8
-rw-r--r--source3/include/local.h2
-rw-r--r--source3/smbd/reply.c10
-rw-r--r--source3/smbd/server.c4
5 files changed, 15 insertions, 11 deletions
diff --git a/source3/client/clientutil.c b/source3/client/clientutil.c
index ed5497782b..01b4a09321 100644
--- a/source3/client/clientutil.c
+++ b/source3/client/clientutil.c
@@ -460,7 +460,7 @@ BOOL cli_send_login(char *inbuf, char *outbuf, BOOL start_session, BOOL use_setu
/* send a session setup command */
bzero(outbuf,smb_size);
- if (passlen > MAX_PASSWORD_LENGTH) {
+ if (passlen > MAX_PASS_LEN) {
DEBUG(1,("password too long %d\n", passlen));
return False;
}
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 4ca1d4c3b0..a877f1ffb3 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -1114,15 +1114,15 @@ extern char *sys_errlist[];
#endif
#ifndef S_ISREG
-#define S_ISREG(x) ((S_IFREG & x)!=0)
+#define S_ISREG(x) ((S_IFREG & (x))!=0)
#endif
#ifndef S_ISDIR
-#define S_ISDIR(x) ((S_IFDIR & x)!=0)
+#define S_ISDIR(x) ((S_IFDIR & (x))!=0)
#endif
#if !defined(S_ISLNK) && defined(S_IFLNK)
-#define S_ISLNK(x) ((S_IFLNK & x)!=0)
+#define S_ISLNK(x) ((S_IFLNK & (x))!=0)
#endif
#ifdef UFC_CRYPT
@@ -1202,7 +1202,7 @@ it works and getting lots of bug reports */
/* this is a rough check to see if this machine has a lstat() call.
it is not guaranteed to work */
-#if !(defined(S_ISLNK) || defined(S_IFLNK))
+#if !defined(S_ISLNK)
#define lstat stat
#endif
diff --git a/source3/include/local.h b/source3/include/local.h
index 3ce75eeb4e..22d1b2a08e 100644
--- a/source3/include/local.h
+++ b/source3/include/local.h
@@ -43,7 +43,7 @@
#define WORDMAX 0xFFFF
/* the maximum password length before we declare a likely attack */
-#define MAX_PASSWORD_LENGTH 200
+#define MAX_PASS_LEN 200
/* separators for lists */
#define LIST_SEP " \t,;:\n\r"
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index fa641931eb..2a3679553c 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -252,7 +252,7 @@ int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize)
if ((SVAL(inbuf,smb_vwv2) & 0x1) != 0)
close_cnum(SVAL(inbuf,smb_tid),vuid);
- if (passlen > MAX_PASSWORD_LENGTH) {
+ if (passlen > MAX_PASS_LEN) {
overflow_attack(passlen);
}
@@ -388,7 +388,7 @@ int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize)
if (Protocol < PROTOCOL_NT1) {
smb_apasslen = SVAL(inbuf,smb_vwv7);
- if (smb_apasslen > MAX_PASSWORD_LENGTH)
+ if (smb_apasslen > MAX_PASS_LEN)
{
overflow_attack(smb_apasslen);
}
@@ -423,12 +423,12 @@ int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize)
if (passlen1 != 24 && passlen2 != 24)
doencrypt = False;
- if (passlen1 > MAX_PASSWORD_LENGTH) {
+ if (passlen1 > MAX_PASS_LEN) {
overflow_attack(passlen1);
}
- passlen1 = MIN(passlen1, MAX_PASSWORD_LENGTH);
- passlen2 = MIN(passlen2, MAX_PASSWORD_LENGTH);
+ passlen1 = MIN(passlen1, MAX_PASS_LEN);
+ passlen2 = MIN(passlen2, MAX_PASS_LEN);
if(doencrypt) {
/* Save the lanman2 password and the NT md4 password. */
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 2b906a7641..e4d433c06f 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -214,10 +214,12 @@ int dos_mode(int cnum,char *path,struct stat *sbuf)
if (S_ISDIR(sbuf->st_mode))
result = aDIR | (result & aRONLY);
+#ifdef S_ISLNK
#if LINKS_READ_ONLY
if (S_ISLNK(sbuf->st_mode) && S_ISDIR(sbuf->st_mode))
result |= aRONLY;
#endif
+#endif
/* hide files with a name starting with a . */
if (lp_hide_dot_files(SNUM(cnum)))
@@ -863,6 +865,7 @@ BOOL check_name(char *name,int cnum)
/* Patch from David Clerc <David.Clerc@cui.unige.ch>
University of Geneva */
+#ifdef S_ISLNK
if (!lp_symlinks(SNUM(cnum)))
{
struct stat statbuf;
@@ -873,6 +876,7 @@ BOOL check_name(char *name,int cnum)
ret=0;
}
}
+#endif
if (!ret)
DEBUG(5,("check_name on %s failed\n",name));