Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. alan@ajf-rh ~$ g++ -laugeas aug.cpp
  2. /tmp/ccKAoo7L.o: In function `main':
  3. aug.cpp:(.text+0x1f): undefined reference to `aug_init(char const*, char const*, unsigned int)'
  4. aug.cpp:(.text+0x39): undefined reference to `aug_set(augeas*, char const*, char const*)'
  5. aug.cpp:(.text+0x45): undefined reference to `aug_close(augeas*)'
  6. collect2: ld returned 1 exit status
  7. alan@ajf-rh ~$ grep aug_init /usr/include/augeas.h
  8. /* Function: aug_init
  9. augeas *aug_init(const char *root, const char *loadpath, unsigned int flags);
  10. alan@ajf-rh ~$ objdump -t /usr/lib64/libaugeas.so.0.13.1 |grep aug_init
  11. 00000000000061e0 g F .text 000000000000067f aug_init
  12. alan@ajf-rh ~$ ll /usr/lib64/libaugeas.*
  13. -rw-r--r-- 1 root root 1530886 May 23 19:14 /usr/lib64/libaugeas.a
  14. -rwxr-xr-x 1 root root 957 May 23 19:14 /usr/lib64/libaugeas.la
  15. lrwxrwxrwx 1 root root 19 May 23 19:14 /usr/lib64/libaugeas.so -> libaugeas.so.0.13.1
  16. lrwxrwxrwx 1 root root 19 May 23 19:14 /usr/lib64/libaugeas.so.0 -> libaugeas.so.0.13.1
  17. -rwxr-xr-x 1 root root 915492 May 23 19:14 /usr/lib64/libaugeas.so.0.13.1
  18. alan@ajf-rh ~$ pkg-config --cflags --libs augeas
  19. -laugeas
  20.  
  21. alan@ajf-rh ~$ cat aug.cpp
  22. #include <augeas.h>
  23.  
  24. int main(int argc, char *argv[])
  25. {
  26. augeas *aug = aug_init("/", "/usr/share/augeas/lenses/", 0);
  27. aug_set(aug, "/files/etc/ssh/sshd_config/PermitRootLogin", "no");
  28. aug_close(aug);
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement