summaryrefslogtreecommitdiff
path: root/testsuite/printing/psec.c
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/printing/psec.c')
-rw-r--r--testsuite/printing/psec.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/testsuite/printing/psec.c b/testsuite/printing/psec.c
index 88a111404c..9d38b9b10a 100644
--- a/testsuite/printing/psec.c
+++ b/testsuite/printing/psec.c
@@ -169,7 +169,9 @@ int psec_getsec(char *printer)
/* Open tdb for reading */
- slprintf(tdb_path, sizeof(tdb_path) - 1, "%s/ntdrivers.tdb", LOCKDIR);
+ slprintf(tdb_path, sizeof(tdb_path) - 1, "%s/ntdrivers.tdb",
+ lp_lockdir());
+
tdb = tdb_open(tdb_path, 0, 0, O_RDONLY, 0600);
if (!tdb) {
@@ -268,7 +270,9 @@ int psec_setsec(char *printer)
/* Open tdb for reading */
- slprintf(tdb_path, sizeof(tdb_path) - 1, "%s/ntdrivers.tdb", LOCKDIR);
+ slprintf(tdb_path, sizeof(tdb_path) - 1, "%s/ntdrivers.tdb",
+ lp_lockdir());
+
tdb = tdb_open(tdb_path, 0, 0, O_RDWR, 0600);
if (!tdb) {
@@ -381,6 +385,8 @@ void usage(void)
int main(int argc, char **argv)
{
+ pstring servicesf = CONFIGFILE;
+
/* Argument check */
if (argc == 1) {
@@ -388,6 +394,16 @@ int main(int argc, char **argv)
return 1;
}
+ /* Load smb.conf file */
+
+ charset_initialise();
+
+ if (!lp_load(servicesf,False,False,True)) {
+ fprintf(stderr, "Couldn't load confiuration file %s\n",
+ servicesf);
+ return 1;
+ }
+
/* Do commands */
if (strcmp(argv[1], "setsec") == 0) {