Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

awsume-configure adds non-posix commands to ~/.profile #183

Closed
Georift opened this issue Apr 21, 2022 · 2 comments
Closed

awsume-configure adds non-posix commands to ~/.profile #183

Georift opened this issue Apr 21, 2022 · 2 comments
Assignees

Comments

@Georift
Copy link

Georift commented Apr 21, 2022

Hi there! Thanks for this project!

For the past little while I've been having some issues with my computers login screen. After putting it off for far to long (read months...) I did some digging and believe it was caused by installing this package.

I'm running a Debian system, and if I follow the installation instructions:

pip3 install awsume
awsume-configure

I found the following is added to my ~/.profile:

#AWSume alias to source the AWSume script
alias awsume="source awsume"

#Auto-Complete function for AWSume
_awsume() {
    local cur prev opts
    COMPREPLY=() #### <---- this line is causing errors
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"
    opts=$(awsume-autocomplete)
    COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
    return 0
}
complete -F _awsume awsume

Now from what I can see in the source code, this is exactly as we're intending when running this command. However I believe this is using a non-posix feature, and at least in Debian ~/.profile is executed using sh which was causing my login screen to fail.

Apr 21 21:52:37 computer /usr/libexec/gdm-x-session[50583]: /etc/gdm3/Xsession: 35: /home/georift/.profile: Syntax error: "(" unexpected (expecting "}")

Here is at least one related issue that the rust community fixed suggesting it might be worth keeping ~/.profile posix compliant.

And finally here's a quick debian repro:

docker run --rm debian:buster-slim /bin/bash -c "sh ~/.profile && apt update && apt install -y python3 python3-pip && pip3 install awsume && awsume-configure && sh ~/.profile"
@mtskillman mtskillman self-assigned this Aug 28, 2023
@mtskillman
Copy link
Collaborator

thanks for this one @Georift -- we will adjust this

mtskillman added a commit that referenced this issue Sep 8, 2023
…oid adding non-posix commands into ~/.profile
mtskillman added a commit that referenced this issue Sep 8, 2023
#183 no longer place autocomplete script in ~/.profile in order to av…
@mtskillman
Copy link
Collaborator

addressed by PR #231

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants