mirror of
https://github.com/samba-team/samba.git
synced 2025-12-10 04:23:50 +03:00
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)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -214,9 +214,11 @@ 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 . */
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user