Comments (7)
Thanks @shnhrrsn. I'll merge this.
from vapor.
that seems like it would function normally unless I'm mistaken
from vapor.
Doing something like that would remove the user's root directory right? It's just that you can't expect people to know that an unchecked rm
is going to be performed inside your command. It's not like people should be typing something like that on purpose, but if it was an accident or it somehow happened, it would be really terrible.
So basically I think it's the responsibility of a tool like this to make sure that kind of thing is not even possible. In this specific case maybe you could check that the directory exists and that it's a .git directory before running the command. Make sure there are no spaces in the name that's passed in, something like that.
Hope that helps!
from vapor.
If you do vapor new /
it will create a new vapor project in the root directory of your application then remove the .git
folder normally.
It can only delete something with .git
after it. Also unless you ran it with sudo attempting to delete the root folder would be denied.
from vapor.
Thanks for the response... Last thing: the way it would delete something undesirable is if there was whitespace: vapor new / something
would call rm -rf / something
, and rm
would execute for both /
and something.git/
. /
is really just a placeholder for whatever undesirable thing you don't actually want deleted. Looking at the rest it might not get that far if the git clone
failed due to weird arguments or something. Regardless just seems scary to me to pass that straight through without doing any checking.
from vapor.
Ah okay, I see what you mean. Yeah that would fail the git clone
for sure.
from vapor.
People once thought it was scary to drive with tanks of explosive liquid attached to the bottom of their cars.
from vapor.
Related Issues (20)
- Vapor migrations do not finish running on fly.io HOT 8
- Documentation for cache HOT 5
- Unable to test vapor using .xcodeproj project HOT 8
- Response compression handler not added for HTTP2 requests
- Updating HTTP server configuration on the fly (ie. TLS settings) HOT 3
- Double encoded post requests after recent update (4.89.3 → 4.91.1) HOT 1
- UserAuthnetication middleware is bypassed when auth object is not used HOT 2
- Query decoding broken in 4.90 HOT 3
- vapor and toolbox compile error on arch linux HOT 1
- double slash in URL no longer matches route handlers HOT 3
- URI semantics are broken HOT 1
- commùit
- Double slash in URLs still breaks route matching with variable parts in vapor 4.92.0 HOT 2
- Trying to build on Ubuntu 20 with swift run and getting Building for debugging... error: emit-module command failed due to signal 9 HOT 2
- Unable to shutdown server HOT 1
- Title
- Vapor URLQueryContainer no longer supports valueless query parameters HOT 4
- Swift Vapor-Save records in Mysql JSON data type during mapping with swift get error- Could not convert MySQL data to String: <MYSQL_TYPE_JSON HOT 6
- Large, streamed request body may result in noSignalReceived preconditionFailure crash HOT 6
- Websocket shouldUpgrade() fail causes empty reply from server HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vapor.