diff options
author | Gerald Carter <jerry@samba.org> | 2005-02-02 02:22:32 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2005-02-02 02:22:32 +0000 |
commit | b9e30e904b0f8e6a262bce176264b42a64c19e0a (patch) | |
tree | bcea2967bda6a7ddd8cc65315f77cd4ddfa54215 | |
parent | b59908e48e06253cf3f8663059f65a79bd07c811 (diff) | |
download | samba-b9e30e904b0f8e6a262bce176264b42a64c19e0a.tar.gz samba-b9e30e904b0f8e6a262bce176264b42a64c19e0a.tar.xz samba-b9e30e904b0f8e6a262bce176264b42a64c19e0a.zip |
r5168: more merges from 3_0
svn merge -r5154:5157 $SVNURL/branches/SAMBA_3_0
svn merge -r5157:5158 $SVNURL/branches/SAMBA_3_0
svn merge -r5158:5159 $SVNURL/branches/SAMBA_3_0
svn merge -r5160:5162 $SVNURL/branches/SAMBA_3_0
svn merge -r5163:5165 $SVNURL/branches/SAMBA_3_0
-rw-r--r-- | source/configure.in | 6 | ||||
-rw-r--r-- | source/lib/util_str.c | 14 | ||||
-rw-r--r-- | source/rpcclient/cmd_reg.c | 45 | ||||
-rw-r--r-- | source/smbd/ipc.c | 11 | ||||
-rw-r--r-- | source/smbd/lanman.c | 10 | ||||
-rw-r--r-- | source/smbd/msdfs.c | 7 | ||||
-rw-r--r-- | source/smbd/quotas.c | 2 | ||||
-rw-r--r-- | source/smbd/trans2.c | 5 |
8 files changed, 44 insertions, 56 deletions
diff --git a/source/configure.in b/source/configure.in index 0dcfd9ab1e0..40aa263c7a1 100644 --- a/source/configure.in +++ b/source/configure.in @@ -670,7 +670,7 @@ AC_HEADER_STDC AC_HEADER_DIRENT AC_HEADER_TIME AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h) +AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h rpc/nettype.h) AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h) AC_CHECK_HEADERS(rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h) AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h) @@ -3955,7 +3955,7 @@ AC_ARG_WITH(acl-support, AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available]) ACL_LIBS="$ACL_LIBS -lpacl" ;; - *freebsd5*) + *freebsd5*|*freebsd6*) AC_MSG_RESULT(Using FreeBSD posix ACLs) AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether FreeBSD POSIX ACLs are available]) AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available]) @@ -4303,7 +4303,7 @@ case "$host_os" in *linux*) WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_linux.o" ;; - *freebsd5*) + *freebsd5*|*freebsd6*) # FreeBSD winbind client is implemented as a wrapper around # the Linux version. WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_freebsd.o \ diff --git a/source/lib/util_str.c b/source/lib/util_str.c index 6b6581b4a7b..60fe1306c8e 100644 --- a/source/lib/util_str.c +++ b/source/lib/util_str.c @@ -2016,10 +2016,16 @@ char * base64_encode_data_blob(DATA_BLOB data) { int bits = 0; int char_count = 0; - size_t out_cnt = 0; - size_t len = data.length; - size_t output_len = data.length * 2; - char *result = SMB_MALLOC(output_len); /* get us plenty of space */ + size_t out_cnt, len, output_len; + char *result; + + if (!data.length || !data.data) + return NULL; + + out_cnt = 0; + len = data.length; + output_len = data.length * 2; + result = SMB_MALLOC(output_len); /* get us plenty of space */ while (len-- && out_cnt < (data.length * 2) - 5) { int c = (unsigned char) *(data.data++); diff --git a/source/rpcclient/cmd_reg.c b/source/rpcclient/cmd_reg.c index 8ec50b894f4..7b9bb9b39e5 100644 --- a/source/rpcclient/cmd_reg.c +++ b/source/rpcclient/cmd_reg.c @@ -42,7 +42,7 @@ * */ -#if 0 /* Simo: reg functions need to be updated to the new cmd interface */ +#if 0 /* This whole file need to be rewritten for the cirrent rpcclient interface */ /**************************************************************************** nt registry enum @@ -889,7 +889,6 @@ static void cmd_reg_get_key_sec(struct client_info *info) } } -#endif /* 0 */ /**************************************************************************** nt registry shutdown @@ -964,44 +963,28 @@ static NTSTATUS cmd_reg_abort_shutdown(struct cli_state *cli, return result; } +#endif /* This whole file need to be rewritten for the cirrent rpcclient interface */ + /* List of commands exported by this module */ struct cmd_set reg_commands[] = { { "REG" }, - +#if 0 { "shutdown", RPC_RTYPE_NTSTATUS, cmd_reg_shutdown, NULL, PI_WINREG, "Remote Shutdown", "syntax: shutdown [-m message] [-t timeout] [-r] [-h] [-f] (-r == reboot, -h == halt, -f == force)" }, { "abortshutdown", RPC_RTYPE_NTSTATUS, cmd_reg_abort_shutdown, NULL, PI_WINREG, "Abort Shutdown", "syntax: abortshutdown" }, -/* - { "regenum", cmd_reg_enum, "Registry Enumeration", - "<keyname>" }, - - { "regdeletekey", cmd_reg_delete_key, "Registry Key Delete", - "<keyname>" }, - - { "regcreatekey", cmd_reg_create_key, "Registry Key Create", - "<keyname> [keyclass]" }, - - { "regqueryval", cmd_reg_query_info, "Registry Value Query", - "<valname>" }, - - { "regquerykey", cmd_reg_query_key, "Registry Key Query", - "<keyname>" }, - - { "regdeleteval", cmd_reg_delete_val, "Registry Value Delete", - "<valname>" }, - - { "regcreateval", cmd_reg_create_val, "Registry Key Create", - "<valname> <valtype> <value>" }, - - { "reggetsec", cmd_reg_get_key_sec, "Registry Key Security", - "<keyname>" }, - - { "regtestsec", cmd_reg_test_key_sec, "Test Registry Key Security", - "<keyname>" }, -*/ + { "regenum", cmd_reg_enum, "Registry Enumeration", "<keyname>" }, + { "regdeletekey", cmd_reg_delete_key, "Registry Key Delete", "<keyname>" }, + { "regcreatekey", cmd_reg_create_key, "Registry Key Create", "<keyname> [keyclass]" }, + { "regqueryval", cmd_reg_query_info, "Registry Value Query", "<valname>" }, + { "regquerykey", cmd_reg_query_key, "Registry Key Query", "<keyname>" }, + { "regdeleteval", cmd_reg_delete_val, "Registry Value Delete", "<valname>" }, + { "regcreateval", cmd_reg_create_val, "Registry Key Create", "<valname> <valtype> <value>" }, + { "reggetsec", cmd_reg_get_key_sec, "Registry Key Security", "<keyname>" }, + { "regtestsec", cmd_reg_test_key_sec, "Test Registry Key Security", "<keyname>" }, +#endif { NULL } }; diff --git a/source/smbd/ipc.c b/source/smbd/ipc.c index 3f21a2ac6ad..e3f6521fba8 100644 --- a/source/smbd/ipc.c +++ b/source/smbd/ipc.c @@ -29,8 +29,6 @@ extern int max_send; -extern fstring local_machine; - #define NERR_notsupported 50 extern int smb_read_error; @@ -382,6 +380,7 @@ int reply_trans(connection_struct *conn, char *inbuf,char *outbuf, int size, int unsigned int dscnt = SVAL(inbuf,smb_vwv11); unsigned int dsoff = SVAL(inbuf,smb_vwv12); unsigned int suwcnt = CVAL(inbuf,smb_vwv13); + fstring local_machine_name; START_PROFILE(SMBtrans); memset(name, '\0',sizeof(name)); @@ -543,9 +542,11 @@ int reply_trans(connection_struct *conn, char *inbuf,char *outbuf, int size, int * WinCE wierdness.... */ - if (name[0] == '\\' && (StrnCaseCmp(&name[1],local_machine, strlen(local_machine)) == 0) && - (name[strlen(local_machine)+1] == '\\')) - name_offset = strlen(local_machine)+1; + fstrcpy( local_machine_name, get_local_machine_name() ); + + if (name[0] == '\\' && (StrnCaseCmp(&name[1],local_machine_name, strlen(local_machine_name)) == 0) && + (name[strlen(local_machine_name)+1] == '\\')) + name_offset = strlen(local_machine_name)+1; if (strnequal(&name[name_offset], "\\PIPE", strlen("\\PIPE"))) { name_offset += strlen("\\PIPE"); diff --git a/source/smbd/lanman.c b/source/smbd/lanman.c index 9f2cd214259..d8c5201ce67 100644 --- a/source/smbd/lanman.c +++ b/source/smbd/lanman.c @@ -32,8 +32,6 @@ #endif #define CHECK_TYPES 0 -extern fstring local_machine; - #define NERR_Success 0 #define NERR_badpass 86 #define NERR_notsupported 50 @@ -2372,7 +2370,7 @@ static BOOL api_RNetServerGetInfo(connection_struct *conn,uint16 vuid, char *par p = *rdata; p2 = p + struct_len; if (uLevel != 20) { - srvstr_push(NULL, p,local_machine,16, + srvstr_push(NULL, p,get_local_machine_name(),16, STR_ASCII|STR_UPPER|STR_TERMINATE); } p += 16; @@ -2387,7 +2385,7 @@ static BOOL api_RNetServerGetInfo(connection_struct *conn,uint16 vuid, char *par if ((count=get_server_info(SV_TYPE_ALL,&servers,lp_workgroup()))>0) { for (i=0;i<count;i++) { - if (strequal(servers[i].name,local_machine)) { + if (strequal(servers[i].name,get_local_machine_name())) { servertype = servers[i].type; push_ascii(comment,servers[i].comment,sizeof(pstring),STR_TERMINATE); } @@ -2460,7 +2458,7 @@ static BOOL api_NetWkstaGetInfo(connection_struct *conn,uint16 vuid, char *param SIVAL(p,0,PTR_DIFF(p2,*rdata)); /* host name */ - pstrcpy(p2,local_machine); + pstrcpy(p2,get_local_machine_name()); strupper_m(p2); p2 = skip_string(p2,1); p += 4; @@ -2881,7 +2879,7 @@ static BOOL api_WWkstaUserLogon(connection_struct *conn,uint16 vuid, char *param { fstring mypath; fstrcpy(mypath,"\\\\"); - fstrcat(mypath,local_machine); + fstrcat(mypath,get_local_machine_name()); strupper_m(mypath); PACKS(&desc,"z",mypath); /* computer */ } diff --git a/source/smbd/msdfs.c b/source/smbd/msdfs.c index b5ae7486d38..184dde16354 100644 --- a/source/smbd/msdfs.c +++ b/source/smbd/msdfs.c @@ -22,7 +22,6 @@ #include "includes.h" -extern fstring local_machine; extern uint32 global_client_caps; /********************************************************************** @@ -462,7 +461,7 @@ BOOL get_referred_path(char *pathname, struct junction_map *jucn, parse_dfs_path(pathname, &dp); /* Verify hostname in path */ - if (local_machine && (!strequal(local_machine, dp.hostname))) { + if ( !strequal(get_local_machine_name(), dp.hostname) ) { /* Hostname mismatch, check if one of our IP addresses */ if (!ismyip(*interpret_addr2(dp.hostname))) { DEBUG(3, ("get_referred_path: Invalid hostname %s in path %s\n", @@ -810,7 +809,7 @@ BOOL create_junction(char* pathname, struct junction_map* jucn) parse_dfs_path(pathname,&dp); /* check if path is dfs : validate first token */ - if (local_machine && (!strequal(local_machine,dp.hostname))) { + if ( !strequal(get_local_machine_name(),dp.hostname) ) { /* Hostname mismatch, check if one of our IP addresses */ if (!ismyip(*interpret_addr2(dp.hostname))) { @@ -978,7 +977,7 @@ static BOOL form_junctions(int snum, struct junction_map* jucn, int* jn_count) } slprintf(ref->alternate_path, sizeof(pstring)-1, - "\\\\%s\\%s", local_machine, service_name); + "\\\\%s\\%s", get_local_machine_name(), service_name); cnt++; /* Now enumerate all dfs links */ diff --git a/source/smbd/quotas.c b/source/smbd/quotas.c index a96f50ad02f..1117461bc25 100644 --- a/source/smbd/quotas.c +++ b/source/smbd/quotas.c @@ -938,7 +938,9 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB #include <rpc/rpc.h> #include <rpc/types.h> #include <rpcsvc/rquota.h> +#ifdef HAVE_RPC_NETTYPE_H #include <rpc/nettype.h> +#endif #include <rpc/xdr.h> static int quotastat; diff --git a/source/smbd/trans2.c b/source/smbd/trans2.c index 7269ab91579..a15a89bb766 100644 --- a/source/smbd/trans2.c +++ b/source/smbd/trans2.c @@ -25,7 +25,6 @@ extern enum protocol_types Protocol; extern int smb_read_error; -extern fstring local_machine; extern int global_oplock_break; extern uint32 global_client_caps; extern struct current_user current_user; @@ -1883,7 +1882,7 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)st.st_dev, (unsi * Add volume serial number - hash of a combination of * the called hostname and the service name. */ - SIVAL(pdata,0,str_checksum(lp_servicename(snum)) ^ (str_checksum(local_machine)<<16) ); + SIVAL(pdata,0,str_checksum(lp_servicename(snum)) ^ (str_checksum(get_local_machine_name())<<16) ); len = srvstr_push(outbuf, pdata+l2_vol_szVolLabel, vname, -1, STR_NOALIGN); SCVAL(pdata,l2_vol_cch,len); data_len = l2_vol_szVolLabel + len; @@ -1926,7 +1925,7 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)st.st_dev, (unsi * the called hostname and the service name. */ SIVAL(pdata,8,str_checksum(lp_servicename(snum)) ^ - (str_checksum(local_machine)<<16)); + (str_checksum(get_local_machine_name())<<16)); len = srvstr_push(outbuf, pdata+18, vname, -1, STR_UNICODE); SIVAL(pdata,12,len); |