Skip to contentSkip to conversation

standalone-reset: use mkdir -p

PATCH In review Wei Liu 2 participants 6 messages Feb 5, 2017 – Feb 6, 2017

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 standalone-reset: use mkdir -p

---
 standalone-reset | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
standalone-reset +1 -1
index 69a3226..d3a8f0d 100755
@@ -49,7 +49,7 @@ fi
 
 ensure_dir () {
 	if test -d "$1"; then return; fi
-	mkdir "$1"
+	mkdir -p "$1"
 }
 
 ensure_key () {
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw

Wei Liu writes ("[OSSTEST PATCH] standalone-reset: use mkdir -p"):
...

standalone-reset fi · line 52

Quoted 4 lines

ensure_dir () {

standalone-reset +1 -1
 	if test -d "$1"; then return; fi
-	mkdir "$1"
+	mkdir -p "$1"

This deliberately doesn't do this. Otherwise wrong (or partially missing) configuration can create strangely-named directories.

What missing parent directory did you want it to create ?

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

author
#2 lore raw
Quoted 10 lines · Ian Jackson

Wei Liu writes ("[OSSTEST PATCH] standalone-reset: use mkdir -p"):
...

standalone-reset fi · line 52

Quoted 4 lines

ensure_dir () {

standalone-reset +1 -1
 	if test -d "$1"; then return; fi
-	mkdir "$1"
+	mkdir -p "$1"

This deliberately doesn't do this. Otherwise wrong (or partially missing) configuration can create strangely-named directories.

Quoted 2 lines

What missing parent directory did you want it to create ?

/tmp/wei/osstest/

Quoted 1 line

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#3 lore raw

Wei Liu writes ("Re: [OSSTEST PATCH] standalone-reset: use mkdir -p"):

Quoted 11 lines · Ian Jackson
Quoted 10 lines

Wei Liu writes ("[OSSTEST PATCH] standalone-reset: use mkdir -p"):
...

standalone-reset fi · line 52

Quoted 4 lines

ensure_dir () {

standalone-reset +1 -1
 	if test -d "$1"; then return; fi
-	mkdir "$1"
+	mkdir -p "$1"

This deliberately doesn't do this. Otherwise wrong (or partially missing) configuration can create strangely-named directories.

Quoted 3 lines
Quoted 1 line

What missing parent directory did you want it to create ?

/tmp/wei/osstest/

I guess I mean, which configuration option ? What was your configuration ? Did /tmp/wei exist ?

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

author
#4 lore raw
Quoted 12 lines · Ian Jackson

Wei Liu writes ("Re: [OSSTEST PATCH] standalone-reset: use mkdir -p"):

Quoted 11 lines · Ian Jackson
Quoted 10 lines

Wei Liu writes ("[OSSTEST PATCH] standalone-reset: use mkdir -p"):
...

standalone-reset fi · line 52

Quoted 4 lines

ensure_dir () {

standalone-reset +1 -1
 	if test -d "$1"; then return; fi
-	mkdir "$1"
+	mkdir -p "$1"

This deliberately doesn't do this. Otherwise wrong (or partially missing) configuration can create strangely-named directories.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

What missing parent directory did you want it to create ?

/tmp/wei/osstest/

I guess I mean, which configuration option ? What was your configuration ?

tftptmp=getconfig TftpTmpDir
ensure_dir "$tftp$tftptmp"

And $tftp is set to /tmp/ in my standalone config.

Quoted 1 line

Did /tmp/wei exist ?

No.

Quoted 2 lines

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#5 lore raw

Wei Liu writes ("Re: [OSSTEST PATCH] standalone-reset: use mkdir -p"):

Quoted 2 lines

tftptmp=getconfig TftpTmpDir
ensure_dir "$tftp$tftptmp"

OK. I'm afraid I think if TftpTmpDir's parent does not exist, osstest should not create it automatically.

Quoted 1 line

And $tftp is set to /tmp/ in my standalone config.

As an aside: this habit of using /tmp as a personal playground is a really bad one.

It may be fine on your single-user workstation, but if it slips into any code or config which you ship to anyone else, it is a security problem.

You should probably create a ~/tmp.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel