From ac208cafbdf7d1e8eb0908bb42d686a73083c139 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 7 Feb 2011 13:50:40 -0600 Subject: [PATCH] libnm-util: add NM_SETTING_SECRET_FLAG_NOT_REQUIRED Not all connections will require every secret, and sometimes we can't automatically figure out whether we need the secret. For vpnc sometimes the group password isn't used, and sometimes PPP providers require a username but don't want a password, etc. --- libnm-util/nm-setting-private.h | 3 ++- libnm-util/nm-setting.h | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libnm-util/nm-setting-private.h b/libnm-util/nm-setting-private.h index ea43f77526..5c4e0a5ede 100644 --- a/libnm-util/nm-setting-private.h +++ b/libnm-util/nm-setting-private.h @@ -24,7 +24,8 @@ #define NM_SETTING_SECRET_FLAGS_ALL \ (NM_SETTING_SECRET_FLAG_NONE | \ NM_SETTING_SECRET_FLAG_AGENT_OWNED | \ - NM_SETTING_SECRET_FLAG_NOT_SAVED) + NM_SETTING_SECRET_FLAG_NOT_SAVED | \ + NM_SETTING_SECRET_FLAG_NOT_REQUIRED) #endif /* NM_SETTING_PRIVATE_H */ diff --git a/libnm-util/nm-setting.h b/libnm-util/nm-setting.h index d95e558a14..067db14cbc 100644 --- a/libnm-util/nm-setting.h +++ b/libnm-util/nm-setting.h @@ -92,6 +92,10 @@ GQuark nm_setting_error_quark (void); * asked to retrieve it * @NM_SETTING_SECRET_FLAG_NOT_SAVED: this secret should not be saved, but * should be requested from the user each time it is needed + * @NM_SETTING_SECRET_FLAG_NOT_REQUIRED: in situations where it cannot be + * automatically determined that the secret is required (some VPNs and PPP + * providers dont require all secrets) this flag indicates that the specific + * secret is not required * * These flags indicate specific behavior related to handling of a secret. Each * secret has a corresponding set of these flags which indicate how the secret @@ -101,7 +105,8 @@ GQuark nm_setting_error_quark (void); typedef enum { NM_SETTING_SECRET_FLAG_NONE = 0x00000000, NM_SETTING_SECRET_FLAG_AGENT_OWNED = 0x00000001, - NM_SETTING_SECRET_FLAG_NOT_SAVED = 0x00000002 + NM_SETTING_SECRET_FLAG_NOT_SAVED = 0x00000002, + NM_SETTING_SECRET_FLAG_NOT_REQUIRED = 0x00000004 /* NOTE: if adding flags, update nm-setting-private.h as well */ } NMSettingSecretFlags;