source: trunk/openwrt/package/samba/patches/100-samba.patch @ 3321

Last change on this file since 3321 was 3321, checked in by olli, 11 years ago

fix patches and closes #350

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 15.8 KB
  • source/include/smb.h

    diff -ruN samba-2.0.10.orig/source/include/smb.h samba-2.0.10/source/include/smb.h
    old new  
    115115 *               Usage: 
    116116 *                 DEBUGADD( 2, ("Some additional text.\n") ); 
    117117 */ 
     118  
     119#ifdef NDEBUG 
     120 
     121#define DEBUGLVL( level ) \ 
     122  ( (0 == (level)) \ 
     123   && dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) ) ) 
     124 
     125#define DEBUG( level, body ) \ 
     126  (void)( (0 == (level)) \ 
     127       && (dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) )) \ 
     128       && (dbgtext body) ) 
     129 
     130#define DEBUGADD( level, body ) \ 
     131  (void)( (0 == (level)) && (dbgtext body) ) 
     132 
     133#else 
    118134#define DEBUGLVL( level ) \ 
    119135  ( (DEBUGLEVEL >= (level)) \ 
    120136   && dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) ) ) 
     
    140156  (void)( (DEBUGLEVEL >= (level)) && (dbgtext body) ) 
    141157 
    142158#endif 
    143  
     159#endif 
    144160/* End Debugging code section. 
    145161 * -------------------------------------------------------------------------- ** 
    146162 */ 
     
    16121628#define CAP_LOCK_AND_READ    0x0100 
    16131629#define CAP_NT_FIND          0x0200 
    16141630#define CAP_DFS              0x1000 
     1631#define CAP_W2K_SMBS         0x2000 
    16151632#define CAP_LARGE_READX      0x4000 
     1633#define CAP_LARGE_WRITEX     0x8000 
    16161634#define CAP_EXTENDED_SECURITY 0x80000000 
    16171635 
    16181636/* protocol types. It assumes that higher protocols include lower protocols 
  • source/Makefile.in

    diff -ruN samba-2.0.10.orig/source/Makefile.in samba-2.0.10/source/Makefile.in
    old new  
    3737# set these to where to find various files 
    3838# These can be overridden by command line switches (see smbd(8)) 
    3939# or in smb.conf (see smb.conf(5)) 
    40 SMBLOGFILE = $(VARDIR)/log.smb 
    41 NMBLOGFILE = $(VARDIR)/log.nmb 
     40SMBLOGFILE = $(VARDIR)/smb 
     41NMBLOGFILE = $(VARDIR)/nmb 
    4242CONFIGFILE = $(LIBDIR)/smb.conf 
    4343LMHOSTSFILE = $(LIBDIR)/lmhosts 
    4444DRIVERFILE = $(LIBDIR)/printers.def 
     
    5555LOCKDIR = @lockdir@ 
    5656 
    5757# The directory where code page definition files go 
    58 CODEPAGEDIR = $(LIBDIR)/codepages 
     58CODEPAGEDIR = $(BASEDIR)/codepages 
    5959 
    6060# The current codepage definition list. 
    6161CODEPAGELIST= 437 737 775 850 852 861 932 866 949 950 936 1251 ISO8859-1 ISO8859-2 ISO8859-5 ISO8859-7 KOI8-R 
     
    8282PROGS2 = bin/rpcclient bin/smbpasswd bin/make_smbcodepage bin/make_unicodemap @WRAP@ @WRAP32@ 
    8383MPROGS = @MPROGS@ 
    8484PROGS = $(PROGS1) $(PROGS2) $(MPROGS) bin/nmblookup bin/make_printerdef  
     85SHAREDPROGS = bin/smbd.shared bin/nmbd.shared bin/smbpasswd.shared 
    8586 
    8687SCRIPTS = $(srcdir)/script/smbtar $(srcdir)/script/addtosmbpass $(srcdir)/script/convert_smbpasswd 
    8788 
     
    159160           $(RPC_SERVER_OBJ) $(RPC_CLIENT_OBJ) $(RPC_PARSE_OBJ) \ 
    160161           $(LOCKING_OBJ) $(PASSDB_OBJ) $(PRINTING_OBJ) $(PROFILE_OBJ) $(LIB_OBJ) 
    161162 
     163SMBDSHARED_OBJ = $(SMBD_OBJ1) $(RPC_SERVER_OBJ) \ 
     164           $(LOCKING_OBJ) $(PROFILE_OBJ) #$(PRINTING_OBJ) 
    162165 
    163166NMBD_OBJ1 = nmbd/asyncdns.o nmbd/nmbd.o nmbd/nmbd_become_dmb.o \ 
    164167            nmbd/nmbd_become_lmb.o nmbd/nmbd_browserdb.o \ 
     
    176179NMBD_OBJ = $(NMBD_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) \ 
    177180           $(LIB_OBJ) 
    178181 
     182NMBDSHARED_OBJ = $(NMBD_OBJ1) 
     183 
    179184SWAT_OBJ = web/cgi.o web/diagnose.o web/startstop.o web/statuspage.o \ 
    180185           web/swat.o $(LIBSMB_OBJ) $(LOCKING_OBJ) \ 
    181186           $(PARAM_OBJ) $(PASSDB_OBJ) $(RPC_CLIENT_OBJ) $(RPC_PARSE_OBJ) \ 
     
    207212SMBPASSWD_OBJ = utils/smbpasswd.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(PASSDB_OBJ) \ 
    208213                $(UBIQX_OBJ) $(RPC_CLIENT_OBJ) $(RPC_PARSE_OBJ) $(LIB_OBJ) 
    209214 
     215SMBPASSWDSHARED_OBJ = utils/smbpasswd.o 
     216 
    210217RPCCLIENT_OBJ = rpcclient/rpcclient.o \ 
    211218             rpcclient/display.o \ 
    212219             rpcclient/cmd_lsarpc.o \ 
     
    265272PROTO_OBJ = $(SMBD_OBJ) $(NMBD_OBJ) $(SWAT_OBJ) $(CLIENT_OBJ) \ 
    266273            $(RPCCLIENT_OBJ) $(SMBWRAPPER_OBJ) $(SMBTORTURE_OBJ) 
    267274 
     275LIBSMBSHARED_OBJ = $(LIB_OBJ) $(LIBSMB_OBJ) $(PARAM_OBJ) $(UBIQX_OBJ) \ 
     276                $(PASSDB_OBJ) $(RPC_PARSE_OBJ) #$(RPC_CLIENT_OBJ) 
     277 
     278LIBSMB_PICOBJS = $(LIBSMBSHARED_OBJ:.o=.po) 
     279 
    268280PICOBJS = $(SMBWRAPPER_OBJ:.o=.po) 
    269281PICOBJS32 = $(SMBWRAPPER_OBJ:.o=.po32) 
    270282 
     
    274286 
    275287all : CHECK $(SPROGS) $(PROGS)  
    276288 
     289shared : CHECK $(SHAREDPROGS) 
     290 
    277291smbwrapper : CHECK bin/smbsh bin/smbwrapper.@SHLIBEXT@ @WRAP32@ 
    278292 
    279293smbtorture : CHECK bin/smbtorture 
     
    359373        @echo Linking $@ 
    360374        @$(CC) $(FLAGS) -o $@ $(SMBD_OBJ) $(LDFLAGS) $(LIBS)  
    361375 
     376bin/smbd.shared: $(SMBDSHARED_OBJ) bin/libsmb.@SHLIBEXT@ bin/.dummy 
     377        @echo Linking $@ 
     378        @$(CC) $(FLAGS) -o $@ $(SMBDSHARED_OBJ) $(LDFLAGS) $(LIBS) -Lbin -lsmb 
     379 
    362380bin/nmbd: $(NMBD_OBJ) bin/.dummy 
    363381        @echo Linking $@ 
    364382        @$(CC) $(FLAGS) -o $@ $(NMBD_OBJ) $(LDFLAGS) $(LIBS) 
    365383 
     384bin/nmbd.shared: $(NMBDSHARED_OBJ) bin/libsmb.@SHLIBEXT@ bin/.dummy 
     385        @echo Linking $@ 
     386        @$(CC) $(FLAGS) -o $@ $(NMBDSHARED_OBJ) $(LDFLAGS) $(LIBS) -Lbin -lsmb 
     387 
    366388bin/swat: $(SWAT_OBJ) bin/.dummy 
    367389        @echo Linking $@ 
    368390        @$(CC) $(FLAGS) -o $@ $(SWAT_OBJ) $(LDFLAGS) $(LIBS)  
     
    411433        @echo Linking $@ 
    412434        @$(CC) $(FLAGS) -o $@ $(SMBPASSWD_OBJ) $(LDFLAGS) $(LIBS) 
    413435 
     436bin/smbpasswd.shared: $(SMBPASSWDSHARED_OBJ) bin/libsmb.@SHLIBEXT@ bin/.dummy 
     437        @echo Linking $@ 
     438        @$(CC) $(FLAGS) -o $@ $(SMBPASSWDSHARED_OBJ) $(LDFLAGS) $(LIBS) -Lbin -lsmb 
     439 
    414440bin/make_smbcodepage: $(MAKE_SMBCODEPAGE_OBJ) bin/.dummy 
    415441        @echo Linking $@ 
    416442        @$(CC) $(FLAGS) -o $@ $(MAKE_SMBCODEPAGE_OBJ) $(LDFLAGS) $(LIBS) 
     
    459485        @echo Linking $@ 
    460486        @$(CC) $(FLAGS) -o $@ $(SMBSH_OBJ) $(LDFLAGS) $(LIBS) 
    461487 
     488bin/libsmb.@SHLIBEXT@: $(LIBSMB_PICOBJS) bin/.dummy 
     489        @echo Linking shared library $@ 
     490        @$(LD) @LDSHFLAGS@ -o $@ $(LIBSMB_PICOBJS) $(LIBS) 
     491 
    462492install: installbin installman installscripts installcp installswat 
    463493 
    464494installdirs: 
     
    518548        ctags `find . -name "*.[ch]" | grep -v /CVS/` 
    519549 
    520550realclean: clean 
    521         -rm -f config.log $(PROGS) $(SPROGS) bin/.dummy 
     551        -rm -f config.log $(PROGS) $(SPROGS) $(SHAREDPROGS) bin/.dummy 
    522552        -rmdir bin 
    523553 
    524554distclean: realclean 
  • source/nmbd/nmbd_mynames.c

    diff -ruN samba-2.0.10.orig/source/nmbd/nmbd_mynames.c samba-2.0.10/source/nmbd/nmbd_mynames.c
    old new  
    215215         */ 
    216216        if( !is_refresh_already_queued( subrec, namerec) ) 
    217217          refresh_name( subrec, namerec, NULL, NULL, NULL ); 
    218         namerec->data.death_time += lp_max_ttl(); 
    219         namerec->data.refresh_time += MIN(lp_max_ttl(), MAX_REFRESH_TIME); 
     218        namerec->data.death_time = t + lp_max_ttl(); 
     219        namerec->data.refresh_time = t + MIN(lp_max_ttl(), MAX_REFRESH_TIME); 
    220220      } 
    221221    } 
    222222  } 
  • source/smbd/close.c

    diff -ruN samba-2.0.10.orig/source/smbd/close.c samba-2.0.10/source/smbd/close.c
    old new  
    122122                last_reference = True; 
    123123 
    124124    fsp->fd_ptr = NULL; 
    125  
     125#ifdef PRINTING 
    126126        /* NT uses smbclose to start a print - weird */ 
    127127        if (normal_close && fsp->print_file) 
    128128                print_file(conn, fsp); 
    129  
     129#endif 
    130130        /* check for magic scripts */ 
    131131        if (normal_close) { 
    132132                check_magic(fsp,conn); 
  • source/smbd/ipc.c

    diff -ruN samba-2.0.10.orig/source/smbd/ipc.c samba-2.0.10/source/smbd/ipc.c
    old new  
    472472  PACK(desc,t,v); 
    473473} 
    474474 
    475  
     475#ifdef PRINTING 
    476476/**************************************************************************** 
    477477  get a print queue 
    478478  ****************************************************************************/ 
     
    10041004   
    10051005  return True; 
    10061006} 
    1007  
     1007#endif 
    10081008/**************************************************************************** 
    10091009  get info level for a server list query 
    10101010  ****************************************************************************/ 
     
    18341834 
    18351835  return(True); 
    18361836} 
    1837  
     1837#ifdef PRINTING 
    18381838/**************************************************************************** 
    18391839  delete a print job 
    18401840  Form: <W> <>  
     
    20912091         
    20922092        return(True); 
    20932093} 
    2094  
     2094#endif 
    20952095 
    20962096/**************************************************************************** 
    20972097  get info about the server 
     
    27562756 
    27572757  return(True); 
    27582758} 
    2759  
     2759#ifdef PRINTING 
    27602760/**************************************************************************** 
    27612761  api_WPrintJobEnumerate 
    27622762  ****************************************************************************/ 
     
    31893189  DEBUG(4,("WPrintPortEnum: errorcode %d\n",desc.errcode)); 
    31903190  return(True); 
    31913191} 
    3192  
     3192#endif 
    31933193/**************************************************************************** 
    31943194 Start the first part of an RPC reply which began with an SMBtrans request. 
    31953195****************************************************************************/ 
     
    34073407  {"RNetUserGetInfo",   56,     api_RNetUserGetInfo,0}, 
    34083408  {"NetUserGetGroups",  59,     api_NetUserGetGroups,0}, 
    34093409  {"NetWkstaGetInfo",   63,     api_NetWkstaGetInfo,0}, 
     3410#ifdef PRINTING 
    34103411  {"DosPrintQEnum",     69,     api_DosPrintQEnum,0}, 
    34113412  {"DosPrintQGetInfo",  70,     api_DosPrintQGetInfo,0}, 
    34123413  {"WPrintQueuePause",  74, api_WPrintQueuePurge,0}, 
     
    34183419  {"RDosPrintJobResume",83,     api_RDosPrintJobDel,0}, 
    34193420  {"WPrintDestEnum",    84,     api_WPrintDestEnum,0}, 
    34203421  {"WPrintDestGetInfo", 85,     api_WPrintDestGetInfo,0}, 
     3422#endif 
    34213423  {"NetRemoteTOD",      91,     api_NetRemoteTOD,0}, 
     3424#ifdef PRINTING 
    34223425  {"WPrintQueuePurge",  103,    api_WPrintQueuePurge,0}, 
     3426#endif 
    34233427  {"NetServerEnum",     104,    api_RNetServerEnum,0}, 
    34243428  {"WAccessGetUserPerms",105,   api_WAccessGetUserPerms,0}, 
    34253429  {"SetUserPassword",   115,    api_SetUserPassword,0}, 
    34263430  {"WWkstaUserLogon",   132,    api_WWkstaUserLogon,0}, 
     3431#ifdef PRINTING 
    34273432  {"PrintJobInfo",      147,    api_PrintJobInfo,0}, 
    34283433  {"WPrintDriverEnum",  205,    api_WPrintDriverEnum,0}, 
    34293434  {"WPrintQProcEnum",   206,    api_WPrintQProcEnum,0}, 
    34303435  {"WPrintPortEnum",    207,    api_WPrintPortEnum,0}, 
     3436#endif 
    34313437  {"SamOEMChangePassword", 214, api_SamOEMChangePassword,0}, 
    34323438  {NULL,                -1,     api_Unsupported,0}}; 
    34333439 
  • source/smbd/negprot.c

    diff -ruN samba-2.0.10.orig/source/smbd/negprot.c samba-2.0.10/source/smbd/negprot.c
    old new  
    160160  /* dual names + lock_and_read + nt SMBs + remote API calls */ 
    161161  int capabilities = CAP_NT_FIND|CAP_LOCK_AND_READ| 
    162162                     (lp_nt_smb_support() ? CAP_NT_SMBS | CAP_RPC_REMOTE_APIS : 0) | 
    163                      (SMB_OFF_T_BITS == 64 ? CAP_LARGE_FILES : 0); 
     163                     (SMB_OFF_T_BITS == 64 ? CAP_LARGE_FILES | CAP_LARGE_READX | CAP_LARGE_WRITEX /*| CAP_W2K_SMBS*/ : 0); 
    164164 
    165165 
    166166/* 
  • source/smbd/password.c

    diff -ruN samba-2.0.10.orig/source/smbd/password.c samba-2.0.10/source/smbd/password.c
    old new  
    11491149 
    11501150  return(True); 
    11511151} 
    1152  
     1152#ifdef RPCCLIENT 
    11531153/*********************************************************************** 
    11541154 Connect to a remote machine for domain security authentication 
    11551155 given a name or IP address. 
     
    15041504  cli_shutdown(&cli); 
    15051505  return True; 
    15061506} 
     1507#endif 
  • source/smbd/process.c

    diff -ruN samba-2.0.10.orig/source/smbd/process.c samba-2.0.10/source/smbd/process.c
    old new  
    343343   {SMBlseek,"SMBlseek",reply_lseek,AS_USER}, 
    344344   {SMBflush,"SMBflush",reply_flush,AS_USER}, 
    345345   {SMBctemp,"SMBctemp",reply_ctemp,AS_USER | QUEUE_IN_OPLOCK }, 
     346#ifdef PRINTING 
    346347   {SMBsplopen,"SMBsplopen",reply_printopen,AS_USER | QUEUE_IN_OPLOCK }, 
    347348   {SMBsplclose,"SMBsplclose",reply_printclose,AS_USER}, 
    348349   {SMBsplretq,"SMBsplretq",reply_printqueue,AS_USER}, 
    349350   {SMBsplwr,"SMBsplwr",reply_printwrite,AS_USER}, 
     351#endif 
    350352   {SMBlock,"SMBlock",reply_lock,AS_USER}, 
    351353   {SMBunlock,"SMBunlock",reply_unlock,AS_USER}, 
    352354    
     
    908910    DEBUG(2,("Closing idle connection 2.\n")); 
    909911    return False; 
    910912  } 
    911  
     913#ifdef RPCLIENT 
    912914  if(global_machine_password_needs_changing) 
    913915  { 
    914916    unsigned char trust_passwd_hash[16]; 
     
    954956    trust_password_unlock(); 
    955957    global_machine_password_needs_changing = False; 
    956958  } 
    957  
     959#endif 
    958960  /* 
    959961   * Check to see if we have any blocking locks 
    960962   * outstanding on the queue. 
  • source/smbd/reply.c

    diff -ruN samba-2.0.10.orig/source/smbd/reply.c samba-2.0.10/source/smbd/reply.c
    old new  
    597597 
    598598  if (!check_domain_match(orig_user, domain)) 
    599599     return False; 
    600  
     600#ifdef RPCCLIENT 
    601601  ret = domain_client_validate(orig_user, domain, 
    602602                                smb_apasswd, smb_apasslen, 
    603603                                smb_ntpasswd, smb_ntpasslen, 
    604604                                &user_exists); 
    605  
     605#endif 
    606606  if(ret) { 
    607607    /* 
    608608     * User validated ok against Domain controller. 
     
    29912991        return -1; 
    29922992} 
    29932993 
    2994  
     2994#ifdef PRINTING 
    29952995/**************************************************************************** 
    29962996  reply to a printopen 
    29972997****************************************************************************/ 
     
    31763176   
    31773177  return(outsize); 
    31783178} 
    3179  
     3179#endif 
    31803180 
    31813181/**************************************************************************** 
    31823182  reply to a mkdir 
  • source/smbd/server.c

    diff -ruN samba-2.0.10.orig/source/smbd/server.c samba-2.0.10/source/smbd/server.c
    old new  
    300300        lp_killunused(conn_snum_used); 
    301301 
    302302        ret = lp_load(servicesf,False,False,True); 
    303  
     303#ifdef PRINTING 
    304304        load_printers(); 
    305  
     305#endif 
    306306        /* perhaps the config filename is now set */ 
    307307        if (!test) 
    308308                reload_services(True); 
  • source/smbd/service.c

    diff -ruN samba-2.0.10.orig/source/smbd/service.c samba-2.0.10/source/smbd/service.c
    old new  
    121121      } 
    122122     } 
    123123   } 
    124  
     124#ifdef PRINTING 
    125125   /* If we still don't have a service, attempt to add it as a printer. */ 
    126126   if (iService < 0) 
    127127   { 
     
    146146            DEBUG(3,("%s is not a valid printer name\n", service)); 
    147147      } 
    148148   } 
    149  
     149#endif 
    150150   /* just possibly it's a default service? */ 
    151151   if (iService < 0)  
    152152   { 
  • source/utils/smbpasswd.c

    diff -ruN samba-2.0.10.orig/source/utils/smbpasswd.c samba-2.0.10/source/utils/smbpasswd.c
    old new  
    7171        } 
    7272        exit(1); 
    7373} 
    74  
     74#ifdef RPCCLIENT 
    7575/********************************************************* 
    7676Join a domain. 
    7777**********************************************************/ 
     
    143143         
    144144        return (int)ret; 
    145145} 
    146  
     146#endif 
    147147 
    148148static void set_line_buffering(FILE *f) 
    149149{ 
     
    335335        if((local_flags & (LOCAL_ADD_USER|LOCAL_DELETE_USER)) && ((remote_machine != NULL) || joining_domain)) { 
    336336                usage(); 
    337337        } 
    338          
     338#ifdef RPCCLIENT         
    339339        if(joining_domain) { 
    340340                if (argc != 0) 
    341341                        usage(); 
    342342                return join_domain(new_domain, remote_machine); 
    343343        } 
    344  
     344#endif 
    345345        /* 
    346346         * Deal with root - can add a user, but only locally. 
    347347         */ 
  • source/web/swat.c

    diff -ruN samba-2.0.10.orig/source/web/swat.c samba-2.0.10/source/web/swat.c
    old new  
    357357                return 0; 
    358358        } 
    359359        iNumNonAutoPrintServices = lp_numservices(); 
     360#ifdef PRINTING 
    360361        load_printers(); 
    361  
     362#endif 
    362363        return 1; 
    363364} 
    364365 
     
    997998        charset_initialise(); 
    998999        load_config(True); 
    9991000        iNumNonAutoPrintServices = lp_numservices(); 
     1001#ifdef PRINTING 
    10001002        load_printers(); 
    1001  
     1003#endif 
    10021004        cgi_setup(SWATDIR, !demo_mode); 
    10031005 
    10041006        print_header(); 
Note: See TracBrowser for help on using the repository browser.