diff options
Diffstat (limited to 'source')
28 files changed, 117 insertions, 92 deletions
diff --git a/source/Makefile.in b/source/Makefile.in index 1096809b407..250a3fc286f 100644 --- a/source/Makefile.in +++ b/source/Makefile.in @@ -854,7 +854,7 @@ bin/net@EXEEXT@: $(NET_OBJ) @BUILD_POPT@ bin/.dummy bin/profiles@EXEEXT@: $(PROFILES_OBJ) @BUILD_POPT@ bin/.dummy @echo Linking $@ - @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(PROFILES_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ @SOCKWRAP@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(PROFILES_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ bin/smbspool@EXEEXT@: $(CUPS_OBJ) bin/.dummy @echo Linking $@ @@ -1269,15 +1269,15 @@ bin/libmsrpc.a: $(LIBMSRPC_PICOBJ) bin/tdbbackup@EXEEXT@: $(TDBBACKUP_OBJ) bin/.dummy @echo Linking $@ - @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(DYNEXP) $(TDBBACKUP_OBJ) @SOCKWRAP@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(DYNEXP) $(LIBS) $(TDBBACKUP_OBJ) $(SNPRINTF_OBJ) @SOCKWRAP@ bin/tdbtool@EXEEXT@: $(TDBTOOL_OBJ) bin/.dummy @echo Linking $@ - @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(DYNEXP) $(TDBTOOL_OBJ) @SOCKWRAP@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(DYNEXP) $(LIBS) $(TDBTOOL_OBJ) $(SNPRINTF_OBJ) @SOCKWRAP@ bin/tdbdump@EXEEXT@: $(TDBDUMP_OBJ) bin/.dummy @echo Linking $@ - @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(DYNEXP) $(TDBDUMP_OBJ) @SOCKWRAP@ + @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(DYNEXP) $(LIBS) $(TDBDUMP_OBJ) $(SNPRINTF_OBJ) @SOCKWRAP@ bin/t_strcmp@EXEEXT@: bin/libbigballofmud.@SHLIBEXT@ torture/t_strcmp.o $(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(DYNEXP) $(LIBS) torture/t_strcmp.o -L ./bin -lbigballofmud diff --git a/source/configure.in b/source/configure.in index 40a681f5671..0341e9fbe9f 100644 --- a/source/configure.in +++ b/source/configure.in @@ -731,8 +731,6 @@ AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(aio.h 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/ypclnt.h) -## These fail to compile on IRIX so just check for their presence -AC_CHECK_HEADERS(rpcsvc/yp_prot.h, sys/mode.h, [], [] -) AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h) AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h) AC_CHECK_HEADERS(sys/un.h) @@ -742,6 +740,15 @@ AC_CHECK_HEADERS(sys/sysmacros.h security/_pam_macros.h dlfcn.h) AC_CHECK_HEADERS(sys/syslog.h syslog.h execinfo.h) AC_CHECK_HEADERS(langinfo.h locale.h) +AC_CHECK_HEADERS(rpcsvc/yp_prot.h,,,[[ +#if HAVE_RPC_RPC_H +#include <rpc/rpc.h> +#endif +]]) + +## These fail to compile on IRIX so just check for their presence +AC_CHECK_HEADERS(sys/mode.h,,,) + # Look for Darwin headers old_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-Iinclude $CPPFLAGS" @@ -784,8 +791,29 @@ AC_CHECK_HEADERS(sys/capability.h syscall.h sys/syscall.h) AC_CHECK_HEADERS(sys/acl.h sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h) AC_CHECK_HEADERS(sys/cdefs.h glob.h) -## These faile to compile on Solaris so just check for their presence -AC_CHECK_HEADERS(security/pam_modules.h net/if.h netinet/ip.h, [], [], -) +AC_CHECK_HEADERS(netinet/ip.h,,,[[ +#include <sys/types.h> +#if HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#include <netinet/in.h> +#if HAVE_NETINET_IN_SYSTM_H +#include <netinet/in_systm.h> +#endif +]]) + +AC_CHECK_HEADERS(net/if.h,,,[[ +#include <sys/types.h> +#if HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +]]) + +AC_CHECK_HEADERS(security/pam_modules.h,,,[[ +#if HAVE_SECURITY_PAM_APPL_H +#include <security/pam_appl.h> +#endif +]]) # For experimental utmp support (lastlog on some BSD-like systems) AC_CHECK_HEADERS(utmp.h utmpx.h lastlog.h) @@ -928,8 +956,20 @@ AC_CACHE_CHECK([for struct timespec type],samba_cv_struct_timespec, [ #include <stdlib.h> #include <stddef.h> #endif -#include <time.h> -#include <aio.h>],[struct timespec ts;], +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif +#if HAVE_AIO_H +#include <aio.h> +#endif +],[struct timespec ts;], samba_cv_struct_timespec=yes,samba_cv_struct_timespec=no)]) if test x"$samba_cv_struct_timespec" = x"yes"; then AC_DEFINE(HAVE_STRUCT_TIMESPEC,1,[Whether we have struct timespec]) diff --git a/source/include/regfio.h b/source/include/regfio.h index e088a4a344c..3f0c10e8954 100644 --- a/source/include/regfio.h +++ b/source/include/regfio.h @@ -80,6 +80,7 @@ typedef struct regf_hbin { typedef struct { uint32 nk_off; uint8 keycheck[sizeof(uint32)]; + char *fullname; } REGF_HASH_REC; typedef struct { diff --git a/source/include/smb_macros.h b/source/include/smb_macros.h index 7a0afdfc192..652aae2bfaf 100644 --- a/source/include/smb_macros.h +++ b/source/include/smb_macros.h @@ -261,7 +261,7 @@ copy an IP address from one buffer to another #define dos_format(fname) string_replace(fname,'/','\\') /***************************************************************************** - Check to see if we are a DO for this domain + Check to see if we are a DC for this domain *****************************************************************************/ #define IS_DC (lp_server_role()==ROLE_DOMAIN_PDC || lp_server_role()==ROLE_DOMAIN_BDC) diff --git a/source/lib/messages.c b/source/lib/messages.c index 21b5531c898..7d3addd86a4 100644 --- a/source/lib/messages.c +++ b/source/lib/messages.c @@ -314,7 +314,7 @@ unsigned int messages_pending_for_pid(pid_t pid) char *buf; unsigned int message_count = 0; - kbuf = message_key_pid(sys_getpid()); + kbuf = message_key_pid(pid); dbuf = tdb_fetch(tdb, kbuf); if (dbuf.dptr == NULL || dbuf.dsize == 0) { diff --git a/source/lib/util_unistr.c b/source/lib/util_unistr.c index 8ed8c5c37fb..d80bb2ce521 100644 --- a/source/lib/util_unistr.c +++ b/source/lib/util_unistr.c @@ -213,8 +213,9 @@ void init_valid_table(void) size_t dos_PutUniCode(char *dst,const char *src, ssize_t len, BOOL null_terminate) { - return push_ucs2(NULL, dst, src, len, - STR_UNICODE|STR_NOALIGN | (null_terminate?STR_TERMINATE:0)); + int flags = null_terminate ? STR_UNICODE|STR_NOALIGN|STR_TERMINATE + : STR_UNICODE|STR_NOALIGN; + return push_ucs2(NULL, dst, src, len, flags); } diff --git a/source/libads/krb5_setpw.c b/source/libads/krb5_setpw.c index dadce2593c8..c261d15c219 100644 --- a/source/libads/krb5_setpw.c +++ b/source/libads/krb5_setpw.c @@ -317,23 +317,17 @@ static krb5_error_code parse_setpw_reply(krb5_context context, switch(res_code) { case KRB5_KPASSWD_ACCESSDENIED: return KRB5KDC_ERR_BADOPTION; - break; case KRB5_KPASSWD_INITIAL_FLAG_NEEDED: return KRB5KDC_ERR_BADOPTION; /* return KV5M_ALT_METHOD; MIT-only define */ - break; case KRB5_KPASSWD_ETYPE_NOSUPP: return KRB5KDC_ERR_ETYPE_NOSUPP; - break; case KRB5_KPASSWD_BAD_PRINCIPAL: return KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN; - break; case KRB5_KPASSWD_POLICY_REJECT: return KRB5KDC_ERR_POLICY; - break; default: return KRB5KRB_ERR_GENERIC; - break; } } } diff --git a/source/nmbd/nmbd.c b/source/nmbd/nmbd.c index 97e22943b14..bc58dd3a281 100644 --- a/source/nmbd/nmbd.c +++ b/source/nmbd/nmbd.c @@ -650,7 +650,6 @@ static BOOL open_sockets(BOOL isdaemon, int port) pstring logfile; static BOOL opt_interactive; poptContext pc; - int opt; struct poptOption long_options[] = { POPT_AUTOHELP {"daemon", 'D', POPT_ARG_VAL, &is_daemon, True, "Become a daemon(default)" }, @@ -666,7 +665,7 @@ static BOOL open_sockets(BOOL isdaemon, int port) global_nmb_port = NMB_PORT; pc = poptGetContext("nmbd", argc, argv, long_options, 0); - while ((opt = poptGetNextOpt(pc)) != -1) ; + while (poptGetNextOpt(pc) != -1) {}; poptFreeContext(pc); global_in_nmbd = True; diff --git a/source/nsswitch/wb_common.c b/source/nsswitch/wb_common.c index b6f617eb952..5ed0b9161e7 100644 --- a/source/nsswitch/wb_common.c +++ b/source/nsswitch/wb_common.c @@ -280,14 +280,6 @@ static int winbind_named_pipe_sock(const char *dir) close(fd); return -1; - - if (connect(fd, (struct sockaddr *)&sunaddr, - sizeof(sunaddr)) == -1) { - close(fd); - return -1; - } - - return fd; } /* Connect to winbindd socket */ diff --git a/source/nsswitch/winbindd_dual.c b/source/nsswitch/winbindd_dual.c index c55b5914d25..e26cc4729ff 100644 --- a/source/nsswitch/winbindd_dual.c +++ b/source/nsswitch/winbindd_dual.c @@ -158,9 +158,8 @@ static void async_reply_recv(void *private_data, BOOL success) return; } - SMB_ASSERT(cache_retrieve_response(child->pid, - state->response)); - + SMB_ASSERT(cache_retrieve_response(child->pid, + state->response)); DLIST_REMOVE(child->requests, state); schedule_async_request(child); diff --git a/source/nsswitch/winbindd_util.c b/source/nsswitch/winbindd_util.c index fec29fa3ff2..14b6f03fd41 100644 --- a/source/nsswitch/winbindd_util.c +++ b/source/nsswitch/winbindd_util.c @@ -98,7 +98,7 @@ static struct winbindd_domain *add_trusted_domain(const char *domain_name, const { struct winbindd_domain *domain; const char *alternative_name = NULL; - static const DOM_SID null_sid; + static const DOM_SID null_sid = {0}; /* ignore alt_name if we are not in an AD domain */ @@ -445,7 +445,7 @@ enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domai [sizeof(state->request.data.init_conn.dcname)-1]='\0'; if (strlen(state->request.data.init_conn.dcname) > 0) { - fstrcpy(domain->dcname, state->request.data.init_conn.dcname); + fstrcpy(domain->dcname, state->request.data.init_conn.dcname); } if (strlen(domain->dcname) > 0) { diff --git a/source/param/loadparm.c b/source/param/loadparm.c index 00f191db280..3c97a3bb37d 100644 --- a/source/param/loadparm.c +++ b/source/param/loadparm.c @@ -2004,9 +2004,9 @@ FN_LOCAL_INTEGER(lp_oplock_contention_limit, iOplockContentionLimit) FN_LOCAL_INTEGER(lp_csc_policy, iCSCPolicy) FN_LOCAL_INTEGER(lp_write_cache_size, iWriteCacheSize) FN_LOCAL_INTEGER(lp_block_size, iBlock_size) -FN_LOCAL_INTEGER(lp_allocation_roundup_size, iallocation_roundup_size); -FN_LOCAL_INTEGER(lp_aio_read_size, iAioReadSize); -FN_LOCAL_INTEGER(lp_aio_write_size, iAioWriteSize); +FN_LOCAL_INTEGER(lp_allocation_roundup_size, iallocation_roundup_size) +FN_LOCAL_INTEGER(lp_aio_read_size, iAioReadSize) +FN_LOCAL_INTEGER(lp_aio_write_size, iAioWriteSize) FN_LOCAL_CHAR(lp_magicchar, magic_char) FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) FN_GLOBAL_INTEGER(lp_winbind_max_idle_children, &Globals.winbind_max_idle_children) diff --git a/source/python/setup.py b/source/python/setup.py index bfc743603bd..a8b2c2c26d6 100755 --- a/source/python/setup.py +++ b/source/python/setup.py @@ -56,6 +56,9 @@ for lib in string.split(samba_libs): if lib[0:2] == "-l": libraries.append(lib[2:]) continue + if lib[0:8] == "-pthread": + libraries.append(lib[2:]) + continue if lib[0:2] == "-L": library_dirs.append(lib[2:]) continue diff --git a/source/registry/reg_db.c b/source/registry/reg_db.c index 888f7ca7357..92efd6f1b5f 100644 --- a/source/registry/reg_db.c +++ b/source/registry/reg_db.c @@ -486,7 +486,6 @@ int regdb_fetch_values( const char* key, REGVAL_CTR *values ) { TDB_DATA data; pstring keystr; - int len; DEBUG(10,("regdb_fetch_values: Looking for value of key [%s] \n", key)); @@ -500,7 +499,7 @@ int regdb_fetch_values( const char* key, REGVAL_CTR *values ) return 0; } - len = regdb_unpack_values( values, data.dptr, data.dsize ); + regdb_unpack_values( values, data.dptr, data.dsize ); SAFE_FREE( data.dptr ); diff --git a/source/registry/regfio.c b/source/registry/regfio.c index 48683969868..e7b8cdc8bb2 100644 --- a/source/registry/regfio.c +++ b/source/registry/regfio.c @@ -85,7 +85,7 @@ static int read_block( REGF_FILE *file, prs_struct *ps, uint32 file_offset, uint if ( (size_t)file_offset >= sbuf.st_size ) return -1; - /* if block_size == 0, we are parsnig HBIN records and need + /* if block_size == 0, we are parsing HBIN records and need to read some of the header to get the block_size from there */ if ( block_size == 0 ) { @@ -533,7 +533,7 @@ static REGF_HBIN* read_hbin_block( REGF_FILE *file, off_t offset ) } /******************************************************************* - Input a randon offset and receive the correpsonding HBIN + Input a random offset and receive the corresponding HBIN block for it *******************************************************************/ @@ -549,7 +549,7 @@ static BOOL hbin_contains_offset( REGF_HBIN *hbin, uint32 offset ) } /******************************************************************* - Input a randon offset and receive the correpsonding HBIN + Input a random offset and receive the corresponding HBIN block for it *******************************************************************/ @@ -1030,7 +1030,7 @@ static BOOL next_record( REGF_HBIN *hbin, const char *hdr, BOOL *eob ) if ( curr_off == 0 ) prs_set_offset( ps, HBIN_HEADER_REC_SIZE ); - /* assume that the current offset is at the reacord header + /* assume that the current offset is at the record header and we need to backup to read the record size */ curr_off -= sizeof(uint32); @@ -1670,7 +1670,7 @@ static BOOL create_vk_record( REGF_FILE *file, REGF_VK_REC *vk, REGISTRY_VALUE * static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) { - return StrnCaseCmp( h1->keycheck, h2->keycheck, sizeof(uint32) ); + return StrCaseCmp( h1->fullname, h2->fullname ); } /******************************************************************* @@ -1722,6 +1722,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) hash->nk_off = prs_offset( &nk->hbin->ps ) + nk->hbin->first_hbin_off - HBIN_HDR_SIZE; memcpy( hash->keycheck, name, sizeof(uint32) ); + hash->fullname = talloc_strdup( file->mem_ctx, name ); parent->subkey_index++; /* sort the list by keyname */ @@ -1767,22 +1768,28 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) DLIST_ADD_END( file->sec_desc_list, nk->sec_desc, tmp ); - /* initialize offsets */ - - nk->sec_desc->prev_sk_off = nk->sec_desc->sk_off; - nk->sec_desc->next_sk_off = nk->sec_desc->sk_off; - - /* now update the offsets for us and the previous sd in the list */ + /* update the offsets for us and the previous sd in the list. + if this is the first record, then just set the next and prev + offsets to ourself. */ if ( nk->sec_desc->prev ) { REGF_SK_REC *prev = nk->sec_desc->prev; nk->sec_desc->prev_sk_off = prev->hbin_off + prev->hbin->first_hbin_off - HBIN_HDR_SIZE; - prev->next_sk_off = nk->sk_off; + prev->next_sk_off = nk->sec_desc->sk_off; + + /* the end must loop around to the front */ + nk->sec_desc->next_sk_off = file->sec_desc_list->sk_off; + + /* and first must loop around to the tail */ + file->sec_desc_list->prev_sk_off = nk->sec_desc->sk_off; + } else { + nk->sec_desc->prev_sk_off = nk->sec_desc->sk_off; + nk->sec_desc->next_sk_off = nk->sec_desc->sk_off; } } - /* dump the reference count */ + /* bump the reference count +1 */ nk->sk_off = nk->sec_desc->sk_off; nk->sec_desc->ref_count++; @@ -1852,8 +1859,8 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) nk->max_bytes_valuename = namelen * 2; datalen = regval_size( r ); - if ( datalen*2 > nk->max_bytes_value ) - nk->max_bytes_value = datalen * 2; + if ( datalen > nk->max_bytes_value ) + nk->max_bytes_value = datalen; } } diff --git a/source/rpc_parse/parse_lsa.c b/source/rpc_parse/parse_lsa.c index 884012c9be7..d924ea27d1f 100644 --- a/source/rpc_parse/parse_lsa.c +++ b/source/rpc_parse/parse_lsa.c @@ -3036,7 +3036,6 @@ static BOOL lsa_io_trustdom_query(const char *desc, prs_struct *ps, int depth, L default: DEBUG(0,("unsupported info-level: %d\n", info->info_class)); return False; - break; } return True; diff --git a/source/rpc_parse/parse_reg.c b/source/rpc_parse/parse_reg.c index 08eec9ee10c..57157ce17e0 100644 --- a/source/rpc_parse/parse_reg.c +++ b/source/rpc_parse/parse_reg.c @@ -268,10 +268,10 @@ BOOL reg_io_q_create_key_ex(const char *desc, REG_Q_CREATE_KEY_EX *q_u, return False; if ( q_u->sec_info ) { - if(!prs_uint32("ptr2", ps, depth, &q_u->ptr2)) - return False; + if(!prs_uint32("ptr2", ps, depth, &q_u->ptr2)) + return False; if(!reg_io_hdrbuf_sec(q_u->ptr2, &q_u->ptr3, &q_u->hdr_sec, q_u->data, ps, depth)) - return False; + return False; } if(!prs_pointer("disposition", ps, depth, (void**)&q_u->disposition, sizeof(uint32), (PRS_POINTER_CAST)prs_uint32)) diff --git a/source/rpc_server/srv_reg_nt.c b/source/rpc_server/srv_reg_nt.c index feb89be5424..fa13206fbe1 100644 --- a/source/rpc_server/srv_reg_nt.c +++ b/source/rpc_server/srv_reg_nt.c @@ -798,7 +798,7 @@ static WERROR reg_load_tree( REGF_FILE *regfile, const char *topkeypath, for ( i=0; i<key->num_values; i++ ) { regval_ctr_addvalue( &values, key->values[i].valuename, key->values[i].type, - key->values[i].data, (key->values[i].data_size & ~VK_DATA_IN_OFFSET) ); + (char*)key->values[i].data, (key->values[i].data_size & ~VK_DATA_IN_OFFSET) ); } /* copy subkeys into the REGSUBKEY_CTR */ @@ -1067,8 +1067,6 @@ WERROR _reg_save_key(pipes_struct *p, REG_Q_SAVE_KEY *q_u, REG_R_SAVE_KEY *r_u) DEBUG(2,("_reg_save_key: Saving [%s] to %s in share %s\n", regkey->name, filename, lp_servicename(snum) )); return backup_registry_key( regkey, filename ); - - return WERR_OK; } /******************************************************************* @@ -1204,7 +1202,7 @@ WERROR _reg_set_value(pipes_struct *p, REG_Q_SET_VALUE *q_u, REG_R_SET_VALUE *r fetch_reg_values( key, &values ); - regval_ctr_addvalue( &values, valuename, q_u->type, q_u->value.buffer, q_u->value.buf_len ); + regval_ctr_addvalue( &values, valuename, q_u->type, (char*)q_u->value.buffer, q_u->value.buf_len ); /* now write to the registry backend */ diff --git a/source/rpc_server/srv_samr_nt.c b/source/rpc_server/srv_samr_nt.c index 2a3d351f67e..656241a73f9 100644 --- a/source/rpc_server/srv_samr_nt.c +++ b/source/rpc_server/srv_samr_nt.c @@ -804,7 +804,6 @@ NTSTATUS _samr_query_dispinfo(pipes_struct *p, SAMR_Q_QUERY_DISPINFO *q_u, uint32 num_account = 0; enum remote_arch_types ra_type = get_remote_arch(); int max_sam_entries = (ra_type == RA_WIN95) ? MAX_SAM_ENTRIES_W95 : MAX_SAM_ENTRIES_W2K; - DOM_SID domain_sid; struct samr_displayentry *entries = NULL; DEBUG(5, ("samr_reply_query_dispinfo: %d\n", __LINE__)); @@ -814,8 +813,6 @@ NTSTATUS _samr_query_dispinfo(pipes_struct *p, SAMR_Q_QUERY_DISPINFO *q_u, if (!find_policy_by_hnd(p, &q_u->domain_pol, (void **)&info)) return NT_STATUS_INVALID_HANDLE; - domain_sid = info->sid; - /* * calculate how many entries we will return. * based on diff --git a/source/rpc_server/srv_spoolss_nt.c b/source/rpc_server/srv_spoolss_nt.c index 5391ac5f41a..3b50a46e3b8 100644 --- a/source/rpc_server/srv_spoolss_nt.c +++ b/source/rpc_server/srv_spoolss_nt.c @@ -1668,7 +1668,7 @@ WERROR _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u, if (printer_default->access_required & ~(SERVER_ACCESS_ADMINISTER | SERVER_ACCESS_ENUMERATE)) { - DEBUG(3, ("access DENIED for non-printserver bits")); + DEBUG(3, ("access DENIED for non-printserver bits\n")); close_printer_handle(p, handle); return WERR_ACCESS_DENIED; } diff --git a/source/rpc_server/srv_srvsvc_nt.c b/source/rpc_server/srv_srvsvc_nt.c index b607d32e547..e9dd015421c 100644 --- a/source/rpc_server/srv_srvsvc_nt.c +++ b/source/rpc_server/srv_srvsvc_nt.c @@ -1597,11 +1597,9 @@ WERROR _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, S DEBUG(3, ("_srv_net_share_set_info: client is trying to change csc policy from the network; must be done with smb.conf\n")); return WERR_ACCESS_DENIED; } - break; case 1006: case 1007: return WERR_ACCESS_DENIED; - break; case 1501: pstrcpy(pathname, lp_pathname(snum)); fstrcpy(comment, lp_comment(snum)); @@ -1753,7 +1751,6 @@ WERROR _srv_net_share_add(pipes_struct *p, SRV_Q_NET_SHARE_ADD *q_u, SRV_R_NET_S case 1006: case 1007: return WERR_ACCESS_DENIED; - break; case 1501: /* DFS only level. */ return WERR_ACCESS_DENIED; diff --git a/source/rpc_server/srv_svcctl_nt.c b/source/rpc_server/srv_svcctl_nt.c index 6cdc71bf033..2e44dc36922 100644 --- a/source/rpc_server/srv_svcctl_nt.c +++ b/source/rpc_server/srv_svcctl_nt.c @@ -756,7 +756,6 @@ WERROR _svcctl_query_service_config2( pipes_struct *p, SVCCTL_Q_QUERY_SERVICE_CO { POLICY_HND *handle; SERVICE_INFO *service_info; - uint32 level; SERVICE_INFO *info = find_service_info_by_hnd( p, &q_u->handle ); /* perform access checks */ @@ -789,10 +788,8 @@ WERROR _svcctl_query_service_config2( pipes_struct *p, SVCCTL_Q_QUERY_SERVICE_CO in the *r_query_config2 marshalling routine... */ - level = q_u->info_level; - #if 0 - if (SERVICE_CONFIG_DESCRIPTION == level) { + if (SERVICE_CONFIG_DESCRIPTION == q_u->info_level) { if (service_info && service_info->shortdescription) { /* length of the string, plus the terminator... */ string_buffer_size = strlen(service_info->shortdescription)+1; diff --git a/source/sam/idmap_rid.c b/source/sam/idmap_rid.c index a23da3e5789..0ba97946965 100644 --- a/source/sam/idmap_rid.c +++ b/source/sam/idmap_rid.c @@ -159,11 +159,10 @@ static NTSTATUS rid_idmap_get_domains(uint32 *num_domains, fstring **domain_name char **trusted_domain_names; DOM_SID *trusted_domain_sids; uint32 enum_ctx = 0; - DOM_SID builtin_sid; int own_domains = 2; /* put the results together */ - *num_domains = 1; + *num_domains = 2; *domain_names = SMB_MALLOC_ARRAY(fstring, *num_domains); *domain_sids = SMB_MALLOC_ARRAY(DOM_SID, *num_domains); @@ -177,6 +176,10 @@ static NTSTATUS rid_idmap_get_domains(uint32 *num_domains, fstring **domain_name } sid_copy(&(*domain_sids)[0], &sid); + /* add BUILTIN */ + fstrcpy((*domain_names)[1], "BUILTIN"); + sid_copy(&(*domain_sids)[1], &global_sid_Builtin); + return NT_STATUS_OK; } @@ -286,9 +289,8 @@ static NTSTATUS rid_idmap_get_domains(uint32 *num_domains, fstring **domain_name sid_copy(&(*domain_sids)[0], domain_sid); /* then add BUILTIN */ - string_to_sid(&builtin_sid, "S-1-5-32"); fstrcpy((*domain_names)[1], "BUILTIN"); - sid_copy(&(*domain_sids)[1], &builtin_sid); + sid_copy(&(*domain_sids)[1], &global_sid_Builtin); /* then add my local sid */ if (!sid_equal(domain_sid, get_global_sam_sid())) { diff --git a/source/smbd/mangle_hash.c b/source/smbd/mangle_hash.c index 871702623a8..093b60b042e 100644 --- a/source/smbd/mangle_hash.c +++ b/source/smbd/mangle_hash.c @@ -167,10 +167,6 @@ static NTSTATUS is_valid_name(const smb_ucs2_t *fname, BOOL allow_wildcards, BOO if (strcmp_wa(fname, ".")==0 || strcmp_wa(fname, "..")==0) return NT_STATUS_OK; - /* Name cannot start with '.' */ - if (*fname == UCS2_CHAR('.')) - return NT_STATUS_UNSUCCESSFUL; - if (only_8_3) { ret = has_valid_83_chars(fname, allow_wildcards); if (!NT_STATUS_IS_OK(ret)) @@ -247,6 +243,10 @@ static NTSTATUS is_8_3_w(const smb_ucs2_t *fname, BOOL allow_wildcards) if (strcmp_wa(fname, ".") == 0 || strcmp_wa(fname, "..") == 0) return NT_STATUS_OK; + /* Name cannot start with '.' */ + if (*fname == UCS2_CHAR('.')) + return NT_STATUS_UNSUCCESSFUL; + if (!NT_STATUS_IS_OK(is_valid_name(fname, allow_wildcards, True))) goto done; diff --git a/source/utils/net_rpc.c b/source/utils/net_rpc.c index d922b508231..50114d5fac6 100644 --- a/source/utils/net_rpc.c +++ b/source/utils/net_rpc.c @@ -5959,6 +5959,7 @@ int net_rpc_usage(int argc, const char **argv) d_printf(" net rpc shutdown \t\tto shutdown a remote server\n"); d_printf(" net rpc rights\t\tto manage privileges assigned to SIDs\n"); d_printf(" net rpc registry\t\tto manage registry hives\n"); + d_printf(" net rpc service\t\tto start, stop and query services\n"); d_printf("\n"); d_printf("'net rpc shutdown' also accepts the following miscellaneous options:\n"); /* misc options */ d_printf("\t-r or --reboot\trequest remote server reboot on shutdown\n"); diff --git a/source/utils/net_rpc_service.c b/source/utils/net_rpc_service.c index 94644f8dcf4..8f93ab3d060 100644 --- a/source/utils/net_rpc_service.c +++ b/source/utils/net_rpc_service.c @@ -499,7 +499,7 @@ static int net_help_service( int argc, const char **argv ) d_printf("net rpc service start <service> Start a service\n"); d_printf("net rpc service stop <service> Stop a service\n"); d_printf("net rpc service pause <service> Pause a service\n"); - d_printf("net rpc service resume <service> Resume a paused a service\n"); + d_printf("net rpc service resume <service> Resume a paused service\n"); d_printf("net rpc service status <service> View the current status of a service\n"); return -1; diff --git a/source/utils/pdbedit.c b/source/utils/pdbedit.c index 7c934cdb6c5..c88c0d75797 100644 --- a/source/utils/pdbedit.c +++ b/source/utils/pdbedit.c @@ -235,7 +235,7 @@ static int print_user_info (struct pdb_context *in, const char *username, BOOL v static int print_users_list (struct pdb_context *in, BOOL verbosity, BOOL smbpwdstyle) { SAM_ACCOUNT *sam_pwent=NULL; - BOOL check, ret; + BOOL check; check = NT_STATUS_IS_OK(in->pdb_setsampwent(in, False, 0)); if (!check) { @@ -245,7 +245,7 @@ static int print_users_list (struct pdb_context *in, BOOL verbosity, BOOL smbpwd check = True; if (!(NT_STATUS_IS_OK(pdb_init_sam(&sam_pwent)))) return 1; - while (check && (ret = NT_STATUS_IS_OK(in->pdb_getsampwent (in, sam_pwent)))) { + while (check && NT_STATUS_IS_OK(in->pdb_getsampwent (in, sam_pwent))) { if (verbosity) printf ("---------------\n"); print_sam_info (sam_pwent, verbosity, smbpwdstyle); @@ -264,7 +264,7 @@ static int print_users_list (struct pdb_context *in, BOOL verbosity, BOOL smbpwd static int fix_users_list (struct pdb_context *in) { SAM_ACCOUNT *sam_pwent=NULL; - BOOL check, ret; + BOOL check; check = NT_STATUS_IS_OK(in->pdb_setsampwent(in, False, 0)); if (!check) { @@ -274,7 +274,7 @@ static int fix_users_list (struct pdb_context *in) check = True; if (!(NT_STATUS_IS_OK(pdb_init_sam(&sam_pwent)))) return 1; - while (check && (ret = NT_STATUS_IS_OK(in->pdb_getsampwent (in, sam_pwent)))) { + while (check && NT_STATUS_IS_OK(in->pdb_getsampwent (in, sam_pwent))) { printf("Updating record for user %s\n", pdb_get_username(sam_pwent)); if (!pdb_update_sam_account(sam_pwent)) { @@ -430,12 +430,12 @@ static int new_user (struct pdb_context *in, const char *username, const char *profile, char *user_sid, char *group_sid) { SAM_ACCOUNT *sam_pwent=NULL; - NTSTATUS nt_status; + char *password1, *password2, *staticpass; get_global_sam_sid(); - if (!NT_STATUS_IS_OK(nt_status = pdb_init_sam_new(&sam_pwent, username, 0))) { + if (!NT_STATUS_IS_OK(pdb_init_sam_new(&sam_pwent, username, 0))) { DEBUG(0, ("could not create account to add new user %s\n", username)); return -1; } diff --git a/source/web/swat.c b/source/web/swat.c index 43dacb2945e..15612484a35 100644 --- a/source/web/swat.c +++ b/source/web/swat.c @@ -1331,13 +1331,12 @@ static void printers_page(void) **/ int main(int argc, char *argv[]) { - int opt; const char *page; poptContext pc; struct poptOption long_options[] = { POPT_AUTOHELP { "disable-authentication", 'a', POPT_ARG_VAL, &demo_mode, True, "Disable authentication (demo mode)" }, - { "password-menu-only", 'P', POPT_ARG_VAL, &passwd_only, True, "Show only change password menu" }, + { "password-menu-only", 'P', POPT_ARG_VAL, &passwd_only, True, "Show only change password menu" }, POPT_COMMON_SAMBA POPT_TABLEEND }; @@ -1368,7 +1367,7 @@ static void printers_page(void) /* Parse command line options */ - while((opt = poptGetNextOpt(pc)) != -1) { } + while(poptGetNextOpt(pc) != -1) { } poptFreeContext(pc); |