summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1997-10-09 06:36:04 +0000
committerAndrew Tridgell <tridge@samba.org>1997-10-09 06:36:04 +0000
commite10ba4b97a219e87b62d32834bf15ed2e323ed2e (patch)
treee5bfcb33fa3bdaf8621d938fd9b9e7e34bee291d
parente789179dfda669bd768720cb3732cf56a49027b5 (diff)
downloadsamba-e10ba4b97a219e87b62d32834bf15ed2e323ed2e.tar.gz
samba-e10ba4b97a219e87b62d32834bf15ed2e323ed2e.tar.xz
samba-e10ba4b97a219e87b62d32834bf15ed2e323ed2e.zip
bracket some macros
change MAX_PASSWORD_LENGTH to MAX_PASS_LEN to prevent conflict on some systems add #ifdef around soft link dependent code (for systems that don't have soft links)
-rw-r--r--source/client/clientutil.c2
-rw-r--r--source/include/includes.h8
-rw-r--r--source/include/local.h2
-rw-r--r--source/smbd/reply.c10
-rw-r--r--source/smbd/server.c4
5 files changed, 15 insertions, 11 deletions
diff --git a/source/client/clientutil.c b/source/client/clientutil.c
index ed5497782b3..01b4a093214 100644
--- a/source/client/clientutil.c
+++ b/source/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/source/include/includes.h b/source/include/includes.h
index 4ca1d4c3b0d..a877f1ffb35 100644
--- a/source/include/includes.h
+++ b/source/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/source/include/local.h b/source/include/local.h
index 3ce75eeb4e7..22d1b2a08e0 100644
--- a/source/include/local.h
+++ b/source/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/source/smbd/reply.c b/source/smbd/reply.c
index fa641931eb2..2a3679553c0 100644
--- a/source/smbd/reply.c
+++ b/source/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/source/smbd/server.c b/source/smbd/server.c
index 2b906a76417..e4d433c06f9 100644
--- a/source/smbd/server.c
+++ b/source/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));