Wireshark-dev: [Wireshark-dev] Running with special privileges in build dir, result of get_data

From: Anders Broman <anders.broman@xxxxxxxxxxxx>
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