Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: iwd@lists.01.org
Subject: Re: [PATCH 04/13] storage: allow NULL type on storage_network_ssid_from_path
Date: Tue, 20 Oct 2020 13:30:25 -0500	[thread overview]
Message-ID: <62300562-1a3c-1f75-d35d-48e4cd4b75ae@gmail.com> (raw)
In-Reply-To: <20201020180256.1630120-4-prestwoj@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1543 bytes --]

Hi James,

On 10/20/20 1:02 PM, James Prestwood wrote:
> This is to allow this API to be used simply to get the file name
> without extension. AP will be storing provisioning files similarly
> to the network format but the extension will not map to existing
> security types. For this case it makes sense to allow a NULL type
> which will prevent the security type from being set/parsed.
> ---
>   src/storage.c | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/src/storage.c b/src/storage.c
> index 00d93933..9ef84e32 100644
> --- a/src/storage.c
> +++ b/src/storage.c
> @@ -287,6 +287,11 @@ char *storage_get_network_file_path(enum security type, const char *ssid)
>   	return path;
>   }
>   
> +/*
> + * Get filename (without extension) which IWD treats as an SSID. Optionally
> + * parse the extension to get the security type (*.psk, *.open, *.8021x) by
> + * providing a 'type' pointer.
> + */
>   const char *storage_network_ssid_from_path(const char *path,
>   							enum security *type)

No, please don't do this.  Make up a AP specific API function instead and 
commonize the implementation if needed.

>   {
> @@ -302,7 +307,10 @@ const char *storage_network_ssid_from_path(const char *path,
>   
>   	end = strchr(filename, '.');
>   
> -	if (!end || !security_from_str(end + 1, type))
> +	if (!end)
> +		return NULL;
> +
> +	if (type && !security_from_str(end + 1, type))
>   		return NULL;
>   
>   	if (filename[0] != '=') {
> 

Regards,
-Denis

  reply	other threads:[~2020-10-20 18:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-20 18:02 [PATCH 01/13] auto-t: no hostapd instance graceful failure James Prestwood
2020-10-20 18:02 ` [PATCH 02/13] auto-t: add copy_to_ap utility James Prestwood
2020-10-20 18:02 ` [PATCH 03/13] auto-t: simplify copy_to_hotspot James Prestwood
2020-10-20 18:02 ` [PATCH 04/13] storage: allow NULL type on storage_network_ssid_from_path James Prestwood
2020-10-20 18:30   ` Denis Kenzior [this message]
2020-10-20 18:02 ` [PATCH 05/13] storage: add storage_get_ap_path James Prestwood
2020-10-20 18:02 ` [PATCH 06/13] ap: refactor AP to use provisioning files James Prestwood
2020-10-20 18:02 ` [PATCH 07/13] doc: update AP docs with new Start() arguments James Prestwood
2020-10-20 18:02 ` [PATCH 08/13] ap: remove 'psk' from Start() James Prestwood
2020-10-20 20:19   ` Andrew Zaborowski
2020-10-20 20:27     ` James Prestwood
2020-10-20 18:02 ` [PATCH 09/13] auto-t: update start_ap() to remove psk argument James Prestwood
2020-10-20 18:02 ` [PATCH 10/13] auto-t: update AP tests with provisioning files James Prestwood
2020-10-20 18:02 ` [PATCH 11/13] build: add ELL dhcp-util.c to build James Prestwood
2020-10-20 18:02 ` [PATCH 12/13] ap: add support for DHCPv4 server James Prestwood
2020-10-20 18:28   ` Denis Kenzior
2020-10-20 18:41     ` James Prestwood
2020-10-20 18:51       ` Denis Kenzior
2020-10-20 20:48         ` Andrew Zaborowski
2020-10-20 21:03           ` Denis Kenzior
2020-10-20 21:41             ` Andrew Zaborowski
2020-10-20 18:02 ` [PATCH 13/13] auto-t: add AP test with DHCP server James Prestwood
2020-10-20 18:32 ` [PATCH 01/13] auto-t: no hostapd instance graceful failure Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=62300562-1a3c-1f75-d35d-48e4cd4b75ae@gmail.com \
    --to=denkenz@gmail.com \
    --cc=iwd@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox