Wireshark mailing list archives

Running with special privileges in build dir, result of get_datafile_dir()


From: Anders Broman <anders.broman () ericsson com>
Date: Wed, 31 Aug 2011 10:26:02 +0200

Hi,
Do we need the check for special privileges in get_datafile_dir()?

        if (running_in_build_directory_flag && progfile_dir != NULL) {
                /*
                 * We're (probably) being run from the build directory and
                 * weren't started with special privileges, and we were
                 * able to determine the directory in which the program
                 * was found, so use that.
                 */
                datafile_dir = progfile_dir;
        } else {
                /*
                 * Return the directory specified when the build was
                 * configured, prepending the run path prefix if it exists.
                 */
                if (getenv("WIRESHARK_DATA_DIR") && !started_with_special_privs()) {
                        /*
                         * The user specified a different directory for data files
                         * and we aren't running with special privileges.
                         * XXX - We might be able to dispense with the priv check
                         */
                        datafile_dir = g_strdup(getenv("WIRESHARK_DATA_DIR"));
                } else {
                        datafile_dir = DATAFILE_DIR;
                }
        }

If we do I'd like to be able to oweride the check - yet another environment variable?
Regards
Anders

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: