summaryrefslogtreecommitdiff
path: root/overlays/ympd/ympd-password-env.patch
diff options
context:
space:
mode:
Diffstat (limited to 'overlays/ympd/ympd-password-env.patch')
-rw-r--r--overlays/ympd/ympd-password-env.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/overlays/ympd/ympd-password-env.patch b/overlays/ympd/ympd-password-env.patch
new file mode 100644
index 00000000..2bbe1886
--- /dev/null
+++ b/overlays/ympd/ympd-password-env.patch
@@ -0,0 +1,23 @@
1diff --git a/src/ympd.c b/src/ympd.c
2index 3aed7e6..b3b6fda 100644
3--- a/src/ympd.c
4+++ b/src/ympd.c
5@@ -71,6 +71,7 @@ int main(int argc, char **argv)
6 char *run_as_user = NULL;
7 char const *error_msg = NULL;
8 char *webport = "8080";
9+ const char *s;
10
11 atexit(bye);
12 #ifdef WITH_DYNAMIC_ASSETS
13@@ -92,6 +93,10 @@ int main(int argc, char **argv)
14 {0, 0, 0, 0 }
15 };
16
17+ if ((s = getenv("MPD_PASSWORD")) != NULL) {
18+ mpd.password = strdup(s);
19+ }
20+
21 while((n = getopt_long(argc, argv, "h:p:w:u:vm:",
22 long_options, &option_index)) != -1) {
23 switch (n) {