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

Executing factory reset RPC via sysrepocfg requires sudo permission #416

Closed
jovatn opened this issue Apr 25, 2024 · 1 comment
Closed

Executing factory reset RPC via sysrepocfg requires sudo permission #416

jovatn opened this issue Apr 25, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@jovatn
Copy link
Contributor

jovatn commented Apr 25, 2024

As 'admin' I am not able to execute factory reset via sysrepocfg ...

$ cat file.json
{
   "ietf-factory-default:factory-reset": {
   }
}
$ scp file.json admin@example.local:/tmp/file.json
$ ssh admin@example.local 'sysrepocfg -fjson -R /tmp/file.json'
admin@example.local's password: 
[ERR] Read permission "ietf-factory-default" check failed.
sysrepocfg error: Sending RPC/action failed (Operation not authorized)
For more details you may try to increase the verbosity up to "-v3".
$

... but doing it as sudo works

$ ssh admin@example.local 'sudo sysrepocfg -fjson -R /tmp/file.json'
admin@example.local's password: 
^C
$ 
troglobit added a commit that referenced this issue Apr 25, 2024
Fixes #416

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
troglobit added a commit that referenced this issue Apr 25, 2024
Fixes #416

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
@troglobit
Copy link
Contributor

Fixed in PR #411, with a fuzz, the command now works but you get errors because sysrepocfg does not return before we initiate the factory-reset with reboot.

$ ssh admin@infix-00-00-00.local 'sysrepocfg -fjson -R /tmp/file.json'
admin@infix-00-00-00.local's password: 
[ERR] EV ORIGIN: "rpc" ID 1 processing timed out.
[ERR] Opening "/etc/sysrepo/sr_evpipe4294967295" for writing failed (No such file or directory).
[ERR] User callback failed.
sysrepocfg error: Sending RPC/action failed (User callback failed)
For more details you may try to increase the verbosity up to "-v3".

@troglobit troglobit added this to the Infix v24.04 milestone Apr 25, 2024
@troglobit troglobit added the bug Something isn't working label Apr 25, 2024
@wkz wkz closed this as completed in 0f79830 Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants