libsecret not working with user account space for ubuntu2004
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNOME Keyring |
Fix Released
|
Unknown
|
|||
gnome-keyring (Ubuntu) |
Invalid
|
Low
|
Unassigned |
Bug Description
I am using libsecret library and facing problem with ubuntu2004 gnome-keyring
I have written below cpp code
#include<
#include<iostream>
#include<time.h>
#defineSCHEMAge
#defineCREDENTI
constSecretSche
{
staticconst SecretSchema schema = {
"org.example.
SECRET_SCHEMA_NONE,
{
{"username", SECRET_
{NULL, (SecretSchemaAt
return &schema;
}
voidputCredenti
{
GError *error = NULL;
secret_
&error, "username"
}
voiddeleteAllCr
std::cout<
GError *error = NULL;
SecretService *sec = secret_
_SecretCollection *collection = NULL;
collection = secret_
SECRET_
GList *items = secret_
for (unsignedinti = 0; i < g_list_
{
SecretItem *item = (SecretItem *)g_list_
std::stringlabe
if (label=
{
secret_
if (error != NULL)
{
std::cout<<"Error: Cannot delete item:"<
}
}
g_object_
}
g_list_free(items);
std::cout<<"...All credentials deleted...";
}
intmain()
{
std::cout<<"Adding tokens";
std::cout<<"\nEnter new username or type exit :";
std::stringuser
std::stringpass
for (inti = 0; i < 6; i++)
{
std::cout<<"Adding credentials....\n";
std::cout<
std::cout<
putCredentials(
sleep(3);
}
deleteAllCreden
return0;
}
And I compile it using
g++ ubuntu2004-
I have below shell script
#!/bin/bash
location=
EXE_CMD=
echo$EXE_CMD
if [ `whoami` = "root" ]
then
echo"adding in user account: "`logname`
runuser -l `logname` -c "$EXE_CMD 2>/dev/null"
else
$EXE_CMD 2>/dev/null
fi
I get below results "sh ./
Ubuntu 1804: users added and removed in user account ,with and without sudo
Ubuntu 2004: users added and removed in user account only without sudo, sudo run does not add and remove credentials to user account here.
Any help for ubuntu2004 will be appreciated.
Changed in gnome-keyring: | |
status: | Unknown → Fix Released |
Thank you for your bug report, it's likely an upstream issue though so it would be best if you could also report it to the upstream code writers on https:/ /gitlab. gnome.org/ GNOME/libsecret /-/issues