diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 8099d4dc60..a8649a3041 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -345,8 +345,9 @@ func main() { } func run(ctx *cli.Context) { + utils.CheckLegalese(ctx.GlobalString(utils.DataDirFlag.Name)) + cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx) - utils.CheckLegalese(cfg.DataDir) ethereum, err := eth.New(cfg) if err != nil { utils.Fatalf("%v", err) @@ -358,6 +359,8 @@ func run(ctx *cli.Context) { } func attach(ctx *cli.Context) { + utils.CheckLegalese(ctx.GlobalString(utils.DataDirFlag.Name)) + // Wrap the standard output with a colorified stream (windows) if isatty.IsTerminal(os.Stdout.Fd()) { if pr, pw, err := os.Pipe(); err == nil { @@ -396,6 +399,8 @@ func attach(ctx *cli.Context) { } func console(ctx *cli.Context) { + utils.CheckLegalese(ctx.GlobalString(utils.DataDirFlag.Name)) + // Wrap the standard output with a colorified stream (windows) if isatty.IsTerminal(os.Stdout.Fd()) { if pr, pw, err := os.Pipe(); err == nil { @@ -405,7 +410,6 @@ func console(ctx *cli.Context) { } cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx) - utils.CheckLegalese(cfg.DataDir) ethereum, err := eth.New(cfg) if err != nil { utils.Fatalf("%v", err) @@ -435,8 +439,9 @@ func console(ctx *cli.Context) { } func execJSFiles(ctx *cli.Context) { + utils.CheckLegalese(ctx.GlobalString(utils.DataDirFlag.Name)) + cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx) - utils.CheckLegalese(cfg.DataDir) ethereum, err := eth.New(cfg) if err != nil { utils.Fatalf("%v", err) @@ -461,6 +466,8 @@ func execJSFiles(ctx *cli.Context) { } func unlockAccount(ctx *cli.Context, am *accounts.Manager, addr string, i int) (addrHex, auth string) { + utils.CheckLegalese(ctx.GlobalString(utils.DataDirFlag.Name)) + var err error addrHex, err = utils.ParamToAddress(addr, am) if err == nil { @@ -484,6 +491,8 @@ func unlockAccount(ctx *cli.Context, am *accounts.Manager, addr string, i int) ( } func blockRecovery(ctx *cli.Context) { + utils.CheckLegalese(ctx.GlobalString(utils.DataDirFlag.Name)) + arg := ctx.Args().First() if len(ctx.Args()) < 1 && len(arg) > 0 { glog.Fatal("recover requires block number or hash") @@ -549,6 +558,8 @@ func startEth(ctx *cli.Context, eth *eth.Ethereum) { } func accountList(ctx *cli.Context) { + utils.CheckLegalese(ctx.GlobalString(utils.DataDirFlag.Name)) + am := utils.MakeAccountManager(ctx) accts, err := am.Accounts() if err != nil { @@ -597,6 +608,8 @@ func getPassPhrase(ctx *cli.Context, desc string, confirmation bool, i int) (pas } func accountCreate(ctx *cli.Context) { + utils.CheckLegalese(ctx.GlobalString(utils.DataDirFlag.Name)) + am := utils.MakeAccountManager(ctx) passphrase := getPassPhrase(ctx, "Your new account is locked with a password. Please give a password. Do not forget this password.", true, 0) acct, err := am.NewAccount(passphrase) @@ -607,6 +620,8 @@ func accountCreate(ctx *cli.Context) { } func accountUpdate(ctx *cli.Context) { + utils.CheckLegalese(ctx.GlobalString(utils.DataDirFlag.Name)) + am := utils.MakeAccountManager(ctx) arg := ctx.Args().First() if len(arg) == 0 { @@ -622,6 +637,8 @@ func accountUpdate(ctx *cli.Context) { } func importWallet(ctx *cli.Context) { + utils.CheckLegalese(ctx.GlobalString(utils.DataDirFlag.Name)) + keyfile := ctx.Args().First() if len(keyfile) == 0 { utils.Fatalf("keyfile must be given as argument") @@ -642,6 +659,8 @@ func importWallet(ctx *cli.Context) { } func accountImport(ctx *cli.Context) { + utils.CheckLegalese(ctx.GlobalString(utils.DataDirFlag.Name)) + keyfile := ctx.Args().First() if len(keyfile) == 0 { utils.Fatalf("keyfile must be given as argument") @@ -656,6 +675,8 @@ func accountImport(ctx *cli.Context) { } func makedag(ctx *cli.Context) { + utils.CheckLegalese(ctx.GlobalString(utils.DataDirFlag.Name)) + args := ctx.Args() wrongArgs := func() { utils.Fatalf(`Usage: geth makedag `) diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go index b01c79d873..d513778f8b 100644 --- a/cmd/utils/cmd.go +++ b/cmd/utils/cmd.go @@ -58,15 +58,16 @@ func PromptConfirm(prompt string) (bool, error) { ) prompt = prompt + " [y/N] " - if liner.TerminalSupported() { - lr := liner.NewLiner() - defer lr.Close() - input, err = lr.Prompt(prompt) - } else { - fmt.Print(prompt) - input, err = bufio.NewReader(os.Stdin).ReadString('\n') - fmt.Println() - } + // if liner.TerminalSupported() { + // fmt.Println("term") + // lr := liner.NewLiner() + // defer lr.Close() + // input, err = lr.Prompt(prompt) + // } else { + fmt.Print(prompt) + input, err = bufio.NewReader(os.Stdin).ReadString('\n') + fmt.Println() + // } if len(input) > 0 && strings.ToUpper(input[:1]) == "Y" { return true, nil diff --git a/cmd/utils/legalese.go b/cmd/utils/legalese.go index 6e96c31357..70f319454a 100644 --- a/cmd/utils/legalese.go +++ b/cmd/utils/legalese.go @@ -1,15 +1,25 @@ package utils const ( - legalese = `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse a tincidunt magna. Phasellus a eros volutpat, sagittis ipsum sit amet, eleifend quam. Aenean venenatis ultricies feugiat. Nulla finibus arcu blandit tincidunt rutrum. Aliquam maximus convallis elementum. Etiam ornare molestie tortor, quis scelerisque est laoreet et. Sed lobortis pellentesque metus, et bibendum libero efficitur quis. Sed posuere sapien erat, vitae tempus neque maximus tincidunt. Nam fermentum lectus in scelerisque convallis. In laoreet volutpat enim, eget laoreet nulla vehicula iaculis. Pellentesque vel mattis lorem. Fusce consectetur orci at bibendum fermentum. Vestibulum venenatis vitae ipsum vel rhoncus. Nulla facilisi. Donec imperdiet, eros a eleifend dignissim, mauris lacus pharetra arcu, et aliquam lacus enim a magna. Phasellus congue consectetur tellus a vehicula. + legalese = ` +======================================= +Disclaimer of Liabilites and Warranties +======================================= -Praesent laoreet quis leo et lacinia. Cras a laoreet orci. Quisque magna nisl, dignissim eget aliquet ut, bibendum mattis justo. Fusce at tortor ligula. Nulla sollicitudin mollis euismod. Nulla enim sem, interdum ac auctor non, faucibus id risus. Duis nisi mauris, maximus vel ex ut, ullamcorper vehicula arcu. Sed nec lobortis nibh. Sed malesuada semper nulla sit amet tristique. Fusce at leo orci. Quisque nec porttitor ante. Nunc scelerisque dolor lectus, iaculis auctor mi mattis id. Donec tempor non tellus id ultricies. Praesent at felis non augue auctor efficitur. - -Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Quisque cursus ullamcorper dapibus. Suspendisse fringilla erat eget nunc dapibus pellentesque eget eget ante. Morbi sollicitudin nec ex eget finibus. Nam volutpat nunc at elit varius, id fringilla lectus sollicitudin. Curabitur ac varius ex. Nam commodo nibh a neque aliquam fringilla. Morbi suscipit magna sit amet enim tincidunt sollicitudin. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; - -Ut pretium iaculis pellentesque. Nam eros tortor, malesuada a varius nec, aliquet placerat magna. Integer rutrum porttitor cursus. Praesent in pharetra turpis, eget fringilla neque. Aliquam venenatis tellus lectus, nec imperdiet nibh accumsan vel. Maecenas semper dapibus velit, ac pretium tortor. Maecenas dapibus, nunc sit amet egestas porttitor, arcu ipsum maximus lorem, non varius lorem turpis eget tortor. Cras at purus aliquam, blandit nunc placerat, imperdiet tellus. Phasellus dignissim venenatis dictum. Aliquam eu nisi nibh. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse sit amet ultrices metus, at pulvinar eros. Suspendisse sollicitudin posuere metus sed pulvinar. Cras et velit vel sem gravida faucibus quis quis mi. Vivamus eleifend ante sit amet ultricies tincidunt. - -Mauris et elementum nulla. Fusce at scelerisque purus. Proin molestie sapien id velit viverra, a pharetra quam tempor. Fusce orci risus, semper et interdum at, imperdiet eget lectus. Praesent feugiat ante ut egestas tempor. Morbi convallis, quam sed mattis consequat, libero diam interdum sem, quis tempor enim nibh a ligula. Quisque est felis, pharetra nec pharetra vel, euismod et tellus. Nulla et dui nulla. Aliquam consectetur nunc ligula, sed molestie odio elementum vitae. Mauris neque nisi, venenatis et est ut, vehicula accumsan lectus. +THE USER EXPRESSLY KNOWS AND AGREES THAT THE USER IS USING THE ETHEREUM PLATFORM AT THE USER’S SOLE +RISK. THE USER REPRESENTS THAT THE USER HAS AN ADEQUATE UNDERSTANDING OF THE RISKS, USAGE AND +INTRICACIES OF CRYPTOGRAPHIC TOKENS AND BLOCKCHAIN-BASED OPEN SOURCE SOFTWARE, ETH PLATFORM AND ETH. +THE USER ACKNOWLEDGES AND AGREES THAT, TO THE FULLEST EXTENT PERMITTED BY ANY APPLICABLE LAW, THE +DISCLAIMERS OF LIABILITY CONTAINED HEREIN APPLY TO ANY AND ALL DAMAGES OR INJURY WHATSOEVER CAUSED +BY OR RELATED TO RISKS OF, USE OF, OR INABILITY TO USE, ETH OR THE ETHEREUM PLATFORM UNDER ANY CAUSE +OR ACTION WHATSOEVER OF ANY KIND IN ANY JURISDICTION, INCLUDING, WITHOUT LIMITATION, ACTIONS FOR +BREACH OF WARRANTY, BREACH OF CONTRACT OR TORT (INCLUDING NEGLIGENCE) AND THAT NEITHER STIFTUNG +ETHEREUM NOR ETHEREUM TEAM SHALL BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR +CONSEQUENTIAL DAMAGES, INCLUDING FOR LOSS OF PROFITS, GOODWILL OR DATA. SOME JURISDICTIONS DO NOT +ALLOW THE EXCLUSION OF CERTAIN WARRANTIES OR THE LIMITATION OR EXCLUSION OF LIABILITY FOR CERTAIN +TYPES OF DAMAGES. THEREFORE, SOME OF THE ABOVE LIMITATIONS IN THIS SECTION MAY NOT APPLY TO A USER. +IN PARTICULAR, NOTHING IN THESE TERMS SHALL AFFECT THE STATUTORY RIGHTS OF ANY USER OR EXCLUDE +INJURY ARISING FROM ANY WILLFUL MISCONDUCT OR FRAUD OF STIFTUNG ETHEREUM. Do you accept this agreement?` )