Fossil SCM
Print an error message and quite if the --user option appears on a "fossil commit" command but specifies a username not found in the database. Ticket [3ed2e994e1750b]
Commit
b120bc8b262ac0056935c0c9365957fe331d29b4
Parent
839f105098f1091…
1 file changed
+7
-1
+7
-1
| --- src/user.c | ||
| +++ src/user.c | ||
| @@ -312,11 +312,17 @@ | ||
| 312 | 312 | */ |
| 313 | 313 | void user_select(void){ |
| 314 | 314 | Stmt s; |
| 315 | 315 | |
| 316 | 316 | if( g.userUid ) return; |
| 317 | - if( attempt_user(g.zLogin) ) return; | |
| 317 | + if( g.zLogin ){ | |
| 318 | + if( attempt_user(g.zLogin)==0 ){ | |
| 319 | + fossil_fatal("no such user: %s", g.zLogin); | |
| 320 | + }else{ | |
| 321 | + return; | |
| 322 | + } | |
| 323 | + } | |
| 318 | 324 | |
| 319 | 325 | if( g.localOpen && attempt_user(db_lget("default-user",0)) ) return; |
| 320 | 326 | |
| 321 | 327 | if( attempt_user(db_get("default-user", 0)) ) return; |
| 322 | 328 | |
| 323 | 329 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -312,11 +312,17 @@ | |
| 312 | */ |
| 313 | void user_select(void){ |
| 314 | Stmt s; |
| 315 | |
| 316 | if( g.userUid ) return; |
| 317 | if( attempt_user(g.zLogin) ) return; |
| 318 | |
| 319 | if( g.localOpen && attempt_user(db_lget("default-user",0)) ) return; |
| 320 | |
| 321 | if( attempt_user(db_get("default-user", 0)) ) return; |
| 322 | |
| 323 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -312,11 +312,17 @@ | |
| 312 | */ |
| 313 | void user_select(void){ |
| 314 | Stmt s; |
| 315 | |
| 316 | if( g.userUid ) return; |
| 317 | if( g.zLogin ){ |
| 318 | if( attempt_user(g.zLogin)==0 ){ |
| 319 | fossil_fatal("no such user: %s", g.zLogin); |
| 320 | }else{ |
| 321 | return; |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | if( g.localOpen && attempt_user(db_lget("default-user",0)) ) return; |
| 326 | |
| 327 | if( attempt_user(db_get("default-user", 0)) ) return; |
| 328 | |
| 329 |