-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Save does not return an error when the file does not exist #13
Comments
Signed-off-by: Julien Pivotto <[email protected]>
Just tried to reproduce the error. Apparently, the directory must exist. Tried the following in an empty directory (augeas 1.8, Debian/stretch chroot):
I can confirm that your test program produces no error -- this is a bug in the library, indeed. After creating the directory and repeating the procedure everything works fine from augtool. |
Digging further... a simple C test program to reproduce this issue behaves correctly in the sense that -1 is returned. #include <stdio.h>
#include <augeas.h>
#include <assert.h>
int main(int argc, char** argv) {
augeas *a;
int r;
a = aug_init("./", "", 0);
assert(a != NULL);
r = aug_load(a);
r = aug_set(a, "/augeas/load/Xmgmt/lens", "Sshd.lns");
assert(r!=-1);
r = aug_set(a, "/augeas/load/Xmgmt/incl", "/tmp/foo/bar");
assert(r!=-1);
r = aug_set(a, "/files/tmp/foo/bar/X11Forwarding", "no");
assert(r!=-1);
r = aug_save(a);
printf("aug_save: %d\n", r);
printf("code: %d, msg: %s, minormsg: %s, details: %s\n",
aug_error(a),
aug_error_message(a),
aug_error_minor_message(a),
aug_error_details(a));
assert(r==0);
} However, the
|
…not set error_code Close dominikh#13 The underlying problem is documented in - hercules-team/augeas#464
…not set error_code Close dominikh#13 The underlying problem is documented in hercules-team/augeas#464
in roidelapluie/go-augtest@dca84f5
the file /tmp/foo/bar does not exist, is not created, but still augeas.Save() does not return an error.
The text was updated successfully, but these errors were encountered: