Configurable user-profile loading: WINRS_NOPROFILE is hardcoded (winrs -noprofile)

Aperta
#139 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
68/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
java

Direzione di ricerca

Inizia da Envelopes.createShell e segui il flusso esistente di blocco della directory di lavoro e ricreazione della shell. Poi esamina il parsing della CLI per i comandi e la shell, oltre a commands.md e cli.md, e aggiungi o aggiorna i test per l’opzione Create, la riproduzione con directory bloccata e il comportamento della CLI. Il lavoro è completato quando il caricamento dei profili rimane disabilitato per impostazione predefinita, può essere richiesto per ogni shell, viene riprodotto dopo la ricreazione e il relativo errore per i non amministratori è documentato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

winrs parity: -nop[rofile] — except our polarity is reversed: winrs loads the profile by default and -noprofile turns it off; this client hardcodes WINRS_NOPROFILE=TRUE in the shell Create options, so the profile is never loaded and there is no way to ask for it.

Context

Envelopes.createShell always sends:

<wsman:Option Name="WINRS_NOPROFILE">TRUE</wsman:Option>

That is the safe default — winrs's load-the-profile default fails for users who are not local administrators on the target — but some commands genuinely need the user profile (HKCU hive, %APPDATA%, per-user PATH), and today they cannot have it.

Proposed API

CommandResult result = client.command("reg query HKCU\Software\...")
    .loadUserProfile()          // shell-scoped, like workingDirectory: first command pins it
    .execute();

Keep NOT loading the profile as the default — it is both the current behavior and the choice that works for non-admin users.

CLI

--profile on command (and shell, #136):

winrm-java -h server -u 'DOMAIN\user' -pf pw.txt --profile exec 'echo %APPDATA%'

Requirements

  • Shell-scoped setting with the same pinning semantics as the working directory (replayed with its original value when a reaped shell is silently recreated).
  • Document the failure mode: requesting the profile as a non-admin typically faults — the fault surfaces through the normal WinRMFaultException path with its code and detail.
  • Tests: wire assertion of the option value on Create, pinned replay on recreation, CLI parsing; docs (commands.md + cli.md).

🤖 Generated with Claude Code

Lingua principale
Java
Stelle
11
Fork
4
Merge medio
5g 5h
PR unite (30g)
6

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MetricsHub/winrm-java

Tutte le issue di MetricsHub/winrm-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.