Use separate make variables for libutil and libcrypto.
authorJelmer Vernooij <jelmer@samba.org>
Fri, 17 Oct 2008 10:48:19 +0000 (12:48 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 18 Oct 2008 12:28:40 +0000 (14:28 +0200)
22 files changed:
lib/util/util.h
source3/Makefile.in
source3/client/client.c
source3/client/smbspool.c
source3/groupdb/mapping_ldb.c
source3/include/proto.h
source3/lib/smbconf/smbconf_txt.c
source3/lib/util.c
source3/nmbd/nmbd.c
source3/nmbd/nmbd_processlogon.c
source3/param/loadparm.c
source3/registry/reg_perfcount.c
source3/rpc_client/cli_pipe.c
source3/rpc_server/srv_eventlog_lib.c
source3/smbd/server.c
source3/torture/vfstest.c
source3/utils/testparm.c
source3/web/cgi.c
source3/web/swat.c
source3/winbindd/idmap_tdb.c
source3/winbindd/winbindd.c
source4/smbd/pidfile.c

index e4a5a0c662912ffc4035668cfab72a8209094123..47adf067f0a8c6e251f91fd46a1393a186b3e6e4 100644 (file)
@@ -574,7 +574,7 @@ _PUBLIC_ bool same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask
 /**
  Check if a process exists. Does this work on all unixes?
 **/
-_PUBLIC_ bool process_exists(pid_t pid);
+_PUBLIC_ bool process_exists_by_pid(pid_t pid);
 
 /**
  Simple routine to do POSIX file locking. Cruft in NFS and 64->32 bit mapping
index 44f06a6caececa6cf71ffb47d49c81f502de967b..1b460f414e183b649a8e1539dcd288c1bcda9f0f 100644 (file)
@@ -315,29 +315,35 @@ LIBSAMBAUTIL_OBJ = @LIBTALLOC_STATIC@ \
                $(SOCKET_WRAPPER_OBJ) \
                $(NSS_WRAPPER_OBJ)
 
-LIB_OBJ = $(LIBSAMBAUTIL_OBJ) \
+UTIL_OBJ = ../lib/util/rbtree.o ../lib/util/signal.o ../lib/util/time.o \
+                  ../lib/util/xfile.o ../lib/util/util_strlist.o  \
+                  ../lib/util/util_file.o ../lib/util/data_blob.o \
+                  ../lib/util/util.o ../lib/util/fsusage.o 
+
+CRYPTO_OBJ = ../lib/crypto/crc32.o ../lib/crypto/md5.o \
+                        ../lib/crypto/hmacmd5.o ../lib/crypto/arcfour.o \
+                        ../lib/crypto/md4.o
+
+LIB_OBJ = $(LIBSAMBAUTIL_OBJ) $(UTIL_OBJ) $(CRYPTO_OBJ) \
          lib/messages.o librpc/gen_ndr/ndr_messaging.o lib/messages_local.o \
          lib/messages_ctdbd.o lib/packet.o lib/ctdbd_conn.o lib/talloc_stack.o \
-         lib/interfaces.o ../lib/util/rbtree.o lib/memcache.o \
+         lib/interfaces.o lib/memcache.o \
          lib/util_transfer_file.o lib/async_req.o \
          lib/async_sock.o \
          $(TDB_LIB_OBJ) \
          $(VERSION_OBJ) lib/charcnv.o lib/debug.o lib/fault.o \
-         lib/interface.o ../lib/crypto/md4.o \
-         lib/pidfile.o \
-         ../lib/util/signal.o lib/system.o lib/sendfile.o lib/recvfile.o lib/time.o \
-         ../lib/util/time.o \
+         lib/interface.o lib/pidfile.o \
+         lib/system.o lib/sendfile.o lib/recvfile.o lib/time.o \
          lib/ufc.o lib/genrand.o lib/username.o \
          lib/util_pw.o lib/access.o lib/smbrun.o \
-         lib/bitmap.o ../lib/crypto/crc32.o lib/dprintf.o $(UTIL_REG_OBJ) \
-         ../lib/util/xfile.o ../lib/util/util_strlist.o lib/wins_srv.o \
+         lib/bitmap.o lib/dprintf.o $(UTIL_REG_OBJ) \
+         lib/wins_srv.o \
          lib/util_str.o lib/clobber.o lib/util_sid.o lib/util_uuid.o \
-         lib/util_unistr.o ../lib/util/util_file.o lib/util_file.o ../lib/util/data_blob.o \
-         lib/util.o ../lib/util/util.o lib/util_sock.o lib/sock_exec.o lib/util_sec.o \
-         lib/substitute.o ../lib/util/fsusage.o lib/dbwrap_util.o \
+         lib/util_unistr.o lib/util_file.o \
+         lib/util.o lib/util_sock.o lib/sock_exec.o lib/util_sec.o \
+         lib/substitute.o lib/dbwrap_util.o \
          lib/ms_fnmatch.o lib/select.o lib/errmap_unix.o \
          lib/tallocmsg.o lib/dmallocmsg.o libsmb/smb_signing.o \
-         ../lib/crypto/md5.o ../lib/crypto/hmacmd5.o ../lib/crypto/arcfour.o \
          lib/iconv.o lib/pam_errors.o intl/lang_tdb.o lib/conn_tdb.o \
          lib/adt_tree.o lib/gencache.o \
          lib/module.o lib/events.o lib/ldap_escape.o @CHARSET_STATIC@ \
index 0fbf56fedbf633a962c2c4d541554e4e6d254c5a..26badc4051c406f5ff1d74280ed71084635956ce 100644 (file)
@@ -1203,7 +1203,7 @@ static void do_mget(file_info *finfo, const char *dir)
                strlower_m(finfo->name);
        }
 
-       if (!directory_exist(finfo->name,NULL) &&
+       if (!directory_exist(finfo->name) &&
            mkdir(finfo->name,0777) != 0) {
                d_printf("failed to create directory %s\n",finfo->name);
                client_set_cur_dir(saved_curdir);
@@ -1752,7 +1752,7 @@ static int cmd_put(void)
                SMB_STRUCT_STAT st;
                /* allow '-' to represent stdin
                   jdblair, 24.jun.98 */
-               if (!file_exist(lname,&st) &&
+               if (!file_exist_stat(lname,&st) &&
                    (strcmp(lname,"-"))) {
                        d_printf("%s does not exist\n",lname);
                        return 1;
@@ -3566,7 +3566,7 @@ static int cmd_reput(void)
                return 1;
        }
 
-       if (!file_exist(local_name, &st)) {
+       if (!file_exist_stat(local_name, &st)) {
                d_printf("%s does not exist\n", local_name);
                return 1;
        }
index 4a173714fe870de48d4ce81624b8c2b83f8ecccf..1910ccd4feefd2d0a8c81602f4333ba48ad8f4cf 100644 (file)
@@ -482,7 +482,7 @@ smb_connect(const char *workgroup,  /* I - Workgroup */
        /*
          * Get the names and addresses of the client and server...
          */
-       myname = get_myname(talloc_tos());
+       myname = talloc_get_myname(talloc_tos());
        if (!myname) {
                return NULL;
        }
index 7ce879fb6ed9eb40931956a4c42c3acc760287fb..1a6b99fa189540c08ebd1d20f1b8fdd7fbdf890d 100644 (file)
@@ -63,7 +63,7 @@ static bool init_group_mapping(void)
        /* Ensure this db is created read/write for root only. */
        ldb_set_create_perms(ldb, 0600);
 
-       existed = file_exist(db_path, NULL);
+       existed = file_exist(db_path);
 
        if (lp_parm_bool(-1, "groupmap", "nosync", False)) {
                flags |= LDB_FLG_NOSYNC;
@@ -99,7 +99,7 @@ static bool init_group_mapping(void)
 
        /* possibly upgrade */
        tdb_path = state_path("group_mapping.tdb");
-       if (file_exist(tdb_path, NULL) && !mapping_upgrade(tdb_path)) {
+       if (file_exist(tdb_path) && !mapping_upgrade(tdb_path)) {
                unlink(state_path("group_mapping.ldb"));
                goto failed;
        }
index c03c34bc28567c4ca34e13ccc8699a819069d9a8..cb21f895d15c08ef2ffad8f8a61c6ea84030c55c 100644 (file)
@@ -1233,9 +1233,11 @@ bool add_gid_to_array_unique(TALLOC_CTX *mem_ctx, gid_t gid,
                             gid_t **gids, size_t *num_gids);
 const char *get_numlist(const char *p, uint32 **num, int *count);
 bool file_exist_stat(const char *fname,SMB_STRUCT_STAT *sbuf);
+bool file_exist(const char *fname);
 bool socket_exist(const char *fname);
 time_t file_modtime(const char *fname);
 bool directory_exist_stat(char *dname,SMB_STRUCT_STAT *st);
+bool directory_exist(char *dname);
 SMB_OFF_T get_file_size(char *file_name);
 char *attrib_string(uint16 mode);
 void show_msg(char *buf);
@@ -1263,7 +1265,7 @@ void add_to_large_array(TALLOC_CTX *mem_ctx, size_t element_size,
                        void *element, void *_array, uint32 *num_elements,
                        ssize_t *array_size);
 void safe_free(void *p);
-char *get_myname_talloc(TALLOC_CTX *ctx);
+char *talloc_get_myname(TALLOC_CTX *ctx);
 char *get_mydnsdomname(TALLOC_CTX *ctx);
 int interpret_protocol(const char *str,int def);
 char *automount_lookup(TALLOC_CTX *ctx, const char *user_name);
index 1a29f40164924d3d2d9ee7ccab19d94c5ed163d4..1393a098d5d6c51c037ba37febcc2fe0404d02cf 100644 (file)
@@ -183,7 +183,7 @@ static WERROR smbconf_txt_load_file(struct smbconf_ctx *ctx)
        WERROR werr;
        uint64_t new_csn;
 
-       if (!file_exist(ctx->path, NULL)) {
+       if (!file_exist(ctx->path)) {
                return WERR_BADFILE;
        }
 
index 1cdc5c8ac6f7efa1185756320961ce6deb300230..2f1dd83bb112319a20d8dad418f98bbf129181ce 100644 (file)
@@ -2321,7 +2321,7 @@ static char *xx_path(const char *name, const char *rootpath)
        }
        trim_string(fname,"","/");
 
-       if (!directory_exist_stat(fname,NULL)) {
+       if (!directory_exist(fname)) {
                mkdir(fname,0755);
        }
 
index d9f2af4c10bdf2ec6e67ec9910fab6804c35646a..28de212d694b772b7c4deb00a6966ef68384cb09 100644 (file)
@@ -332,7 +332,7 @@ static bool reload_nmbd_services(bool test)
 
        if ( lp_loaded() ) {
                const char *fname = lp_configfile();
-               if (file_exist(fname,NULL) && !strcsequal(fname,get_dyn_CONFIGFILE())) {
+               if (file_exist(fname) && !strcsequal(fname,get_dyn_CONFIGFILE())) {
                        set_dyn_CONFIGFILE(fname);
                        test = False;
                }
@@ -905,7 +905,7 @@ static bool open_sockets(bool isdaemon, int port)
        }
 #endif
 
-       if (!directory_exist(lp_lockdir(), NULL)) {
+       if (!directory_exist(lp_lockdir())) {
                mkdir(lp_lockdir(), 0755);
        }
 
index 814eaf7ca84984856a5ee53dd0998a63d7253d48..9ee0709cb577089e51db7660db35c29c74db39f2 100644 (file)
@@ -442,7 +442,7 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
                                                ("get_mydnsdomname failed.\n"));
                                                return;
                                        }
-                                       hostname = get_myname(talloc_tos());
+                                       hostname = talloc_get_myname(talloc_tos());
                                        if (!hostname) {
                                                DEBUG(2,
                                                ("get_myname failed.\n"));
index d646a79334900335f330370aad72932a56a6ef84..3401bd16a0870210ca00e9b4cd5353bb72676e1a 100644 (file)
@@ -6930,7 +6930,7 @@ static bool handle_include(int snum, const char *pszParmValue, char **ptr)
 
        string_set(ptr, fname);
 
-       if (file_exist(fname, NULL)) {
+       if (file_exist(fname)) {
                bool ret = pm_process(fname, do_section, do_parameter, NULL);
                SAFE_FREE(fname);
                return ret;
index ddff7aa24d0fab3ed4c772c42f35424e96828f08..eda44ace19a21c81eb0e484b3adef3f119a416ac 100644 (file)
@@ -63,7 +63,7 @@ void perfcount_init_keys( void )
 
        /* no registry keys; just create the perfmon directory */
        
-       if ( !directory_exist( p, NULL ) )
+       if ( !directory_exist( p ) )
                mkdir( p, 0755 );
        
        return;
index 9d566ea3d659d7969db3437c6b6cfbf9de2175bf..ca9d3392e7b9c72e1f4ae38c412ae6736c89aeec 100644 (file)
@@ -2810,7 +2810,7 @@ NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path,
        result->abstract_syntax = *abstract_syntax;
        result->transfer_syntax = ndr_transfer_syntax;
 
-       result->desthost = get_myname(result);
+       result->desthost = talloc_get_myname(result);
        result->srv_name_slash = talloc_asprintf_strupper_m(
                result, "\\\\%s", result->desthost);
        if ((result->desthost == NULL) || (result->srv_name_slash == NULL)) {
index e232a30078244bb4dd186d9e7e7b714bdf7bc8dc..9215a86d3ff442ae575c9b57b8acd97322f33504 100644 (file)
@@ -344,7 +344,7 @@ ELOG_TDB *elog_open_tdb( char *logname, bool force_clear )
        /* make sure that the eventlog dir exists */
 
        eventlogdir = state_path( "eventlog" );
-       if ( !directory_exist( eventlogdir, NULL ) )
+       if ( !directory_exist( eventlogdir ) )
                mkdir( eventlogdir, 0755 );
 
        /* get the path on disk */
index 69a483e4fca894e97cf056d3b13093212a3e1bbf..f64ba8c05f72e3a4e473604dfd715fc725e52a58 100644 (file)
@@ -840,7 +840,7 @@ bool reload_services(bool test)
 
        if (lp_loaded()) {
                char *fname = lp_configfile();
-               if (file_exist(fname, NULL) &&
+               if (file_exist(fname) &&
                    !strcsequal(fname, get_dyn_CONFIGFILE())) {
                        set_dyn_CONFIGFILE(fname);
                        test = False;
@@ -1319,7 +1319,7 @@ extern void build_options(bool screen);
                setpgid( (pid_t)0, (pid_t)0);
 #endif
 
-       if (!directory_exist(lp_lockdir(), NULL))
+       if (!directory_exist(lp_lockdir()))
                mkdir(lp_lockdir(), 0755);
 
        if (is_daemon)
index 56e27eec1dc388d558ff83335cf38ea76669b8d0..bb4dc35d2b2446d232c2f31604afcd8e36b2c29a 100644 (file)
@@ -433,7 +433,7 @@ bool reload_services(bool test)
 
        if (lp_loaded()) {
                const char *fname = lp_configfile();
-               if (file_exist(fname, NULL) &&
+               if (file_exist(fname) &&
                    !strcsequal(fname, get_dyn_CONFIGFILE())) {
                        set_dyn_CONFIGFILE(fname);
                        test = False;
index 4370d49523a7cf59d721c9450fa880ab2a7f4d30..05682efe5dcc46fc0d3d5f7030001b0c9f325b3b 100644 (file)
@@ -56,7 +56,7 @@ cannot be set in the smb.conf file. nmbd will abort with this setting.\n");
                ret = 1;
        }
 
-       if (!directory_exist(lp_lockdir(), &st)) {
+       if (!directory_exist_stat(lp_lockdir(), &st)) {
                fprintf(stderr, "ERROR: lock directory %s does not exist\n",
                       lp_lockdir());
                ret = 1;
@@ -66,7 +66,7 @@ cannot be set in the smb.conf file. nmbd will abort with this setting.\n");
                ret = 1;
        }
 
-       if (!directory_exist(lp_piddir(), &st)) {
+       if (!directory_exist_stat(lp_piddir(), &st)) {
                fprintf(stderr, "ERROR: pid directory %s does not exist\n",
                       lp_piddir());
                ret = 1;
index 7e689bcce8b96b4fa018479bddeac104d60f8df7..ce36bd93101b4823f9975f46304fba8b1e726d2f 100644 (file)
@@ -451,7 +451,7 @@ static void cgi_download(char *file)
        if (S_ISDIR(st.st_mode))
        {
                snprintf(buf, sizeof(buf), "%s/index.html", file);
-               if (!file_exist(buf, &st) || !S_ISREG(st.st_mode))
+               if (!file_exist_stat(buf, &st) || !S_ISREG(st.st_mode))
                {
                        cgi_setup_error("404 File Not Found","",
                                        "The requested file was not found");
index 1502c5bc2f13519daef3016f42c9a3071398d8d3..23fc43f776936abbecb60a6212150c6042a23483 100644 (file)
@@ -595,7 +595,7 @@ static void ViewModeBoxes(int mode)
 ****************************************************************************/
 static void welcome_page(void)
 {
-       if (file_exist("help/welcome.html", NULL)) {
+       if (file_exist("help/welcome.html")) {
                include_html("help/welcome.html");
        } else {
                include_html("help/welcome-no-samba-doc.html");
@@ -1439,7 +1439,7 @@ const char *lang_msg_rotate(TALLOC_CTX *ctx, const char *msgid)
 
        cgi_load_variables();
 
-       if (!file_exist(get_dyn_CONFIGFILE(), NULL)) {
+       if (!file_exist(get_dyn_CONFIGFILE())) {
                have_read_access = True;
                have_write_access = True;
        } else {
index 9e66eed0c8882437d63d2335c5b724754afd7823..f9d3a9fbffdd68dc196126168ea757bee6148742 100644 (file)
@@ -228,7 +228,7 @@ static NTSTATUS idmap_tdb_open_db(TALLOC_CTX *memctx, TDB_CONTEXT **tdbctx)
                goto done;
        }
 
-       if (!file_exist(tdbfile, &stbuf)) {
+       if (!file_exist_stat(tdbfile, &stbuf)) {
                tdb_is_new = True;
        }
 
index 44b5415726a70c1ce887057d8c1c40ae1d65a575..5d4f21a8207657efe7fb6f405ee57b8264152433 100644 (file)
@@ -66,7 +66,7 @@ static bool reload_services_file(const char *logfile)
        if (lp_loaded()) {
                const char *fname = lp_configfile();
 
-               if (file_exist(fname,NULL) && !strcsequal(fname,get_dyn_CONFIGFILE())) {
+               if (file_exist(fname) && !strcsequal(fname,get_dyn_CONFIGFILE())) {
                        set_dyn_CONFIGFILE(fname);
                }
        }
@@ -1120,7 +1120,7 @@ int main(int argc, char **argv, char **envp)
                exit(1);
        }
 
-       if (!directory_exist(lp_lockdir(), NULL)) {
+       if (!directory_exist(lp_lockdir())) {
                mkdir(lp_lockdir(), 0755);
        }
 
index 3567846070ac4ffeb755a48bcf1db8b8bd766d2b..d8ba240e406c60ea3668520b8800c3e83986a964 100644 (file)
@@ -57,7 +57,7 @@ pid_t pidfile_pid(const char *piddir, const char *name)
 
        ret = (pid_t)atoi(pidstr);
        
-       if (!process_exists(ret)) {
+       if (!process_exists_by_pid(ret)) {
                goto noproc;
        }