@@ -167,10 +167,9 @@ impl Args {
167167 }
168168
169169 pub fn local_config ( & self ) -> Result < PathBuf , Error > {
170- // When --config-dir is explicitly set, do not walk ancestors of that
171- // path — doing so would let callers read identities from outside the
172- // selected profile (security finding 004). Use the real process cwd
173- // for local-config discovery regardless.
170+ // Always use the real process cwd for local-config discovery, regardless
171+ // of whether --config-dir is set. This prevents ancestor-walking outside
172+ // the selected profile.
174173 let pwd = std:: env:: current_dir ( ) . map_err ( |_| Error :: CurrentDirNotFound ) ?;
175174 Ok ( find_config_dir ( pwd. clone ( ) ) . unwrap_or_else ( |_| pwd. join ( ".stellar" ) ) )
176175 }
@@ -512,7 +511,9 @@ pub fn print_deprecation_warning(dir: &Path) {
512511 return ;
513512 }
514513
515- print. warnln ( format ! ( "A local config was found at {dir:?}." ) ) ;
514+ print. warnln ( format ! (
515+ "A local config was found at {dir:?} but is no longer read."
516+ ) ) ;
516517 print. blankln ( format ! (
517518 " Run `stellar config migrate` to move the local config into the global config ({global_dir:?})."
518519 ) ) ;
@@ -724,7 +725,6 @@ impl KeyType {
724725 pub fn list_paths ( & self , paths : & [ Location ] ) -> Result < Vec < ( String , Location ) > , Error > {
725726 Ok ( paths
726727 . iter ( )
727- . unique_by ( |p| location_to_string ( p) )
728728 . filter ( |p| {
729729 if let Location :: Local ( dir) = p {
730730 if dir. exists ( ) {
@@ -734,6 +734,7 @@ impl KeyType {
734734 }
735735 true
736736 } )
737+ . unique_by ( |p| location_to_string ( p) )
737738 . flat_map ( |p| self . list ( p, false ) . unwrap_or_default ( ) )
738739 . collect ( ) )
739740 }
0 commit comments