How to get serial number of hard-disk in a snap packed application with strict confinement?

My application uses libudev’s c++ api to get the serial number of hard disk of user. I need this to identify user’s identity since hard disk serial numbers are unique and can’t be changed by user.

so everything works fine in classic confinement since my snap packaged application can see the system and call libudev to get get serial number.

But when the application is packaged in strict confinement for some reasons my application not able to see the serial number if the disk. Am already having all necessary packaged to make libudev work.

is there any interface like udev that can solve this?

Thanks

I used hardware-observe and now libudev working fine. But user have to connect this interface manually. There should be UI for this like android have. If some application needs permission there is a pop-up to ask user if he want to allow or not .

That would be this button here.

2 Likes

Is this live in ubuntu-softwares app ?? This is awesome :heart_eyes:

That’s what I see on my 18.04 system, for sure.

1 Like

Oh, am still on 16.04 softwares team should bring this to all distributions :slight_smile: Softwares app on 16.04

^ @robert.ancell - one for you :slight_smile:

1 Like

@keshavnrj you can also ask to have it auto-connect, using this procedure. (I don’t know what your snap does, nor how, nor if it’s a reasonable interface to autoconnect – but you can always ask :slight_smile: )

1 Like

The permissions feature is being backported to Xenial.

2 Likes