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

Enahnce pacemaker.c #136

Open
jfriesse opened this issue Feb 5, 2024 · 2 comments
Open

Enahnce pacemaker.c #136

jfriesse opened this issue Feb 5, 2024 · 2 comments
Assignees

Comments

@jfriesse
Copy link
Member

jfriesse commented Feb 5, 2024

pacemaker.c is full of popen/system calls. This are not very safe (escape of arguments, need to run shell, ...) and it would be better to use exec and proper redirection (so stderr are split and could be logged). Another possibility might be to use some library instead of calling crm_ticket (if such library exists).

@clumens
Copy link

clumens commented Feb 5, 2024

We have a long-standing project in pacemaker to move functionality from command line tools into libraries. Then the tools just wrap the library calls. I could start working on converting crm_ticket next if it would help here.

@jfriesse
Copy link
Member Author

jfriesse commented Feb 6, 2024

Perfect. I think it would be much safer and reliable to call function(s) instead of system/popen.

@clumens clumens self-assigned this Apr 22, 2024
clumens added a commit to clumens/booth that referenced this issue Jun 25, 2024
The function itself is very simple.  The rest of the work is in
save_attributes, where it needs to understand both the libpacemaker XML
result as well as the result of calling crm_ticket directly.  It's still
pretty simple, though - just digging around in the XML to set a node
pointer correctly.

Fixes ClusterLabs#136
clumens added a commit to clumens/booth that referenced this issue Oct 1, 2024
The function itself is very simple.  The rest of the work is in
save_attributes, where it needs to understand both the libpacemaker XML
result as well as the result of calling crm_ticket directly.  It's still
pretty simple, though - just digging around in the XML to set a node
pointer correctly.

Fixes ClusterLabs#136
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants