CUPS sanitizes argv[0] by removing username/password, so use
DEVICE_URI environment variable first.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14128
Signed-off-by: Bryan Mason <bmason@redhat.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Sep 18 12:31:11 UTC 2019 on sn-devel-184
/*
* Find the URI ...
- */
- if (dev_uri == NULL) {
- env = getenv("DEVICE_URI");
- if (env != NULL && env[0] != '\0') {
- dev_uri = env;
- }
- }
+ *
+ * The URI in argv[0] is sanitized to remove username/password, so
+ * use DEVICE_URI if available. Otherwise keep the URI already
+ * discovered in argv.
+ */
+ env = getenv("DEVICE_URI");
+ if (env != NULL && env[0] != '\0') {
+ dev_uri = env;
+ }
if (dev_uri == NULL) {
fprintf(stderr,