{ "config", required_argument, 0, 'c' },
{ "debug", no_argument, 0, 'd' },
{ "local", no_argument, 0, 'l' },
+ { "no-per-user-config", no_argument, 0, 'N' },
{ "help-commands", no_argument, 0, 'H' },
{ 0, 0, 0, 0 }
};
pcre_malloc = xmalloc;
pcre_free = xfree;
if(!setlocale(LC_CTYPE, "")) fatal(errno, "error calling setlocale");
- while((n = getopt_long(argc, argv, "hVc:dHl", options, 0)) >= 0) {
+ while((n = getopt_long(argc, argv, "hVc:dHlN", options, 0)) >= 0) {
switch(n) {
case 'h': help();
case 'H': help_commands();
case 'c': configfile = optarg; break;
case 'd': debugging = 1; break;
case 'l': local = 1; break;
+ case 'N': config_per_user = 0; break;
default: fatal(0, "invalid option");
}
}
*/
char *configfile;
+/** @brief Read user configuration
+ *
+ * If clear, the user-specific configuration is not read.
+ */
+int config_per_user = 1;
+
/** @brief Config file parser state */
struct config_state {
/** @brief Filename */
return -1;
xfree(privconf);
/* if there's a per-user system config file for this user, read it */
- if(!(pw = getpwuid(getuid())))
- fatal(0, "cannot determine our username");
- if((privconf = config_usersysconf(pw))
- && access(privconf, F_OK) == 0
- && config_include(c, privconf))
+ if(config_per_user) {
+ if(!(pw = getpwuid(getuid())))
+ fatal(0, "cannot determine our username");
+ if((privconf = config_usersysconf(pw))
+ && access(privconf, F_OK) == 0
+ && config_include(c, privconf))
return -1;
- xfree(privconf);
- /* if we have a password file, read it */
- if((privconf = config_userconf(getenv("HOME"), pw))
- && access(privconf, F_OK) == 0
- && config_include(c, privconf))
- return -1;
- xfree(privconf);
+ xfree(privconf);
+ /* if we have a password file, read it */
+ if((privconf = config_userconf(getenv("HOME"), pw))
+ && access(privconf, F_OK) == 0
+ && config_include(c, privconf))
+ return -1;
+ xfree(privconf);
+ }
/* install default namepart and transform settings */
config_postdefaults(c, server);
/* everything is good so we shall use the new config */
/* get the private config file */
extern char *configfile;
+extern int config_per_user;
#endif /* CONFIGURATION_H */
q = c.queue()
assert len(q) == 10, "queue is at proper length"
print " getting queue via disorder(1)"
- q = dtest.command(["disorder", "--config", disorder._configfile, "queue"])
+ q = dtest.command(["disorder",
+ "--config", disorder._configfile, "--no-per-user-config",
+ "queue"])
tracks = filter(lambda s: re.match("^track", s), q)
assert len(tracks) == 10, "queue is at proper length"