Skip to content

Update maximum limit #5

@Cyberbeni

Description

@Cyberbeni

sshrc/sshrc

Line 10 in 46b92e2

if [ $SIZE -gt 65536 ]; then

This limit is in place because of $(getconf ARG_MAX), which is 1M on macOS12.3 (I'm using ARG_MAX / 2 in my own version), so the 64k limit could definitely be raised/adapted to the current ARG_MAX.

Now the script also has some spare parts, like also sending over the sshrc file:
https://github.com/cdown/sshrc/blob/master/sshrc#L31-L32
Or creating a bashsshrc file:

sshrc/sshrc

Lines 45 to 58 in 46b92e2

echo $'"$( cat << 'EOF' | openssl enc -base64
#!/usr/bin/env bash
exec bash --rcfile <(echo '
[ -r /etc/profile ] && source /etc/profile
if [ -r ~/.bash_profile ]; then source ~/.bash_profile
elif [ -r ~/.bash_login ]; then source ~/.bash_login
elif [ -r ~/.profile ]; then source ~/.profile
fi
source '$SSHHOME'/.sshrc;
export PATH=$PATH:'$SSHHOME'
') "$@"
EOF
)"' | tr -s ' ' $'\n' | openssl enc -base64 -d > \$SSHHOME/bashsshrc
chmod +x \$SSHHOME/bashsshrc

I don't quite understand what use case would the CMDARG part be useful for but if you really need extra stuff in there, having multiple sshrcs and just symlinking the appropriate one in your wrapper sounds like a much more manageable story.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions