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

Cannot leave 'computername_prefix' unset #28

Open
wiad opened this issue Aug 13, 2024 · 1 comment · May be fixed by #33
Open

Cannot leave 'computername_prefix' unset #28

wiad opened this issue Aug 13, 2024 · 1 comment · May be fixed by #33

Comments

@wiad
Copy link

wiad commented Aug 13, 2024

If I leave computername_prefix unset/commented in the config:

#:computername_prefix: ''

the realm plugin crashes with:

2024-08-13T07:39:51 6d7a0a0a [E] undefined method `empty?' for false:FalseClass
2024-08-13T07:39:51 6d7a0a0a [W] Error details for undefined method `empty?' for false:FalseClass: <NoMethodError>: undefined method `empty?' for false:FalseClass
/usr/share/gems/gems/smart_proxy_realm_ad_plugin-0.1/lib/smart_proxy_realm_ad/provider.rb:79:in `apply_computername_prefix?'

The apply_computername_prefix? function maybe should be extended to check if the variable is set since it is supposed to be optional:

    def apply_computername_prefix?(computername)
      computername_prefix && !computername_prefix.nil? && !computername_prefix.empty? && (computername_hash || !computername[0, computername_prefix.size].casecmp(computername_prefix).zero?)
    end

(i.e. add computername_prefix && )

@martencassel
Copy link
Contributor

martencassel commented Aug 15, 2024

Thanks for your issue, i can take a look into it.

@martencassel martencassel linked a pull request Sep 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants