Giter Club home page Giter Club logo

llconf's People

Contributors

lipnitsk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

llconf's Issues

Function name find_node is too generic and conflicts with other packages.

What steps will reproduce the problem?
1. Try to compile with any other headed that defines "find_node".
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.

I think that since it returns a cnfnode*, the function could reasonably be
renamed to find_cnfnode.
Patch attached.

Original issue reported on code.google.com by [email protected] on 25 Jul 2008 at 8:16

Attachments:

Handle smb.conf type ini files

What steps will reproduce the problem?
1. llconf ini -f smb.conf list "global" 
2.
3.

What is the expected output? What do you see instead?
Produces allot of .unparsed output. 
Seems the samba type ini file varies in that 
it uses

multiple keywords = "value"

and when multiple keywords are present the lines are ignored. 

Example 

egrep 'netbios|volume' smb.conf
        netbios name    = hercules       
        volume          = Hercules

./llconf -p ini -f smb.conf get "global/volume"
Hercules

./llconf -p ini -f smb.conf get "global/netbios name" 
(nothing is returned). 


What version of the product are you using? On what operating system?
0.4.6, RHEL5

Please provide any additional information below.
Perhaps the samba ini configurations are not standard ini, However, it's a 
popular file and I would like to use this command line tool to automate 
modification of the file in that format. 

Original issue reported on code.google.com by [email protected] on 13 Dec 2011 at 3:37

Fix an error in the ifupdown parser unparse function that doesn't handle allow-hotplug expressions

What steps will reproduce the problem?
1. Parse an /etc/network/interfaces files that has allow-hotplug entries.
2. Using the dump operation works fine, but the unparse operation produces
(null)
3. Run the command llconf ifupdown -i /etc/network/interfaces -o - unparse

What is the expected output? What do you see instead?

The expected output is 


# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.

auto lo eth0 eth1 eth2 eth3

iface lo inet loopback

allow-hotplug eth0
iface eth0 inet dhcp
        pre-up touch /lib/init/rw/resolv.conf

iface eth1 inet static
        address 192.168.0.1
        netmask 255.255.255.0
        pre-up touch /lib/init/rw/resolv.conf

allow-hotplug eth2
iface eth2 inet dhcp
        pre-up touch /lib/init/rw/resolv.conf

allow-hotplug eth3
iface eth3 inet dhcp
        pre-up touch /lib/init/rw/resolv.conf

allow-hotplug wlan0
iface wlan0 inet dhcp
        pre-up touch /lib/init/rw/resolv.conf
        wpa-ssid ssid
    wpa-psk psk


BUT it actually is

# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.

auto lo eth0 eth1 eth2 eth3

iface lo inet loopback

(null)
iface eth0 inet dhcp
        pre-up touch /lib/init/rw/resolv.conf

iface eth1 inet static
        address 192.168.0.1
        netmask 255.255.255.0
        pre-up touch /lib/init/rw/resolv.conf

(null)
iface eth2 inet dhcp
        pre-up touch /lib/init/rw/resolv.conf

(null)
iface eth3 inet dhcp
        pre-up touch /lib/init/rw/resolv.conf

(null)
iface wlan0 inet dhcp
        pre-up touch /lib/init/rw/resolv.conf
        wpa-ssid ssid
    wpa-psk psk

What version of the product are you using? On what operating system?

Using 0.4.6.

Please provide any additional information below.

Applying the patch below fixes this:

--- ifupdown-old.c 2009-11-18 14:36:30.000000000 -0500
+++ ifupdown.c  2009-11-18 14:37:09.000000000 -0500
@@ -263,6 +263,16 @@
                        }
                        snprintf(b1, 255, "%s\n", b0);
                        cl_list = append_confline(cl_list, cl =
create_confline(b1));
+               }else if(strncmp(cn_top->name, "allow-", 6) == 0){
+                       char buf1[256], *b0 = buf, *b1 = buf1, *tmp;
+
+                       snprintf(b0, 255, "%s", cn_top->name);
+                       for(cn = cn_top->first_child; cn; cn = cn->next){
+                               snprintf(b1, 255, "%s %s", b0, cn->name);
+                               tmp = b0; b0 = b1; b1 = tmp;
+                       }
+                       snprintf(b1, 255, "%s\n", b0);
+                       cl_list = append_confline(cl_list, cl =
create_confline(b1));
                }else if(strcmp(cn_top->name, "mapping") == 0){
                        cn = cn_top->first_child;

Original issue reported on code.google.com by [email protected] on 18 Nov 2009 at 7:49

llconf hangs reading syslog-ng.conf file.

What steps will reproduce the problem?
1. Download latest, and build with "dpkg-buildpackage -rfakeroot -us -uc"
2. llconf syslog-ng -i  /import/tonic/bedge/llconf/syslog-ng.conf -s dump 


What is the expected output? What do you see instead?
I would have expected a syntex tree for the config file.
There was no output, llconf did not complete.

What version of the product are you using?       llconf-0.4.6.tar.gz

On what operating system? Ubuntu 8.04


Please provide any additional information below.

Here's the strace output up to the hang: 

execve("/usr/bin/llconf", ["llconf", "syslog-ng", "-i",
"/import/tonic/bedge/llconf/syslo"..., "-s", "dump"], [/* 58 vars */]) = 0
brk(0)                                  = 0x804c000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb7f1a000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/users/bedge/lib/tls/i686/sse2/cmov/libllconf.so.0", O_RDONLY) = -1
ENOENT (No such file or directory)
stat64("/users/bedge/lib/tls/i686/sse2/cmov", 0xbfed4fe0) = -1 ENOENT (No
such file or directory)
open("/users/bedge/lib/tls/i686/sse2/libllconf.so.0", O_RDONLY) = -1 ENOENT
(No such file or directory)
stat64("/users/bedge/lib/tls/i686/sse2", 0xbfed4fe0) = -1 ENOENT (No such
file or directory)
open("/users/bedge/lib/tls/i686/cmov/libllconf.so.0", O_RDONLY) = -1 ENOENT
(No such file or directory)
stat64("/users/bedge/lib/tls/i686/cmov", 0xbfed4fe0) = -1 ENOENT (No such
file or directory)
open("/users/bedge/lib/tls/i686/libllconf.so.0", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("/users/bedge/lib/tls/i686", 0xbfed4fe0) = -1 ENOENT (No such file
or directory)
open("/users/bedge/lib/tls/sse2/cmov/libllconf.so.0", O_RDONLY) = -1 ENOENT
(No such file or directory)
stat64("/users/bedge/lib/tls/sse2/cmov", 0xbfed4fe0) = -1 ENOENT (No such
file or directory)
open("/users/bedge/lib/tls/sse2/libllconf.so.0", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("/users/bedge/lib/tls/sse2", 0xbfed4fe0) = -1 ENOENT (No such file
or directory)
open("/users/bedge/lib/tls/cmov/libllconf.so.0", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("/users/bedge/lib/tls/cmov", 0xbfed4fe0) = -1 ENOENT (No such file
or directory)
open("/users/bedge/lib/tls/libllconf.so.0", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/users/bedge/lib/tls", 0xbfed4fe0) = -1 ENOENT (No such file or
directory)
open("/users/bedge/lib/i686/sse2/cmov/libllconf.so.0", O_RDONLY) = -1
ENOENT (No such file or directory)
stat64("/users/bedge/lib/i686/sse2/cmov", 0xbfed4fe0) = -1 ENOENT (No such
file or directory)
open("/users/bedge/lib/i686/sse2/libllconf.so.0", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("/users/bedge/lib/i686/sse2", 0xbfed4fe0) = -1 ENOENT (No such file
or directory)
open("/users/bedge/lib/i686/cmov/libllconf.so.0", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("/users/bedge/lib/i686/cmov", 0xbfed4fe0) = -1 ENOENT (No such file
or directory)
open("/users/bedge/lib/i686/libllconf.so.0", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/users/bedge/lib/i686", 0xbfed4fe0) = -1 ENOENT (No such file or
directory)
open("/users/bedge/lib/sse2/cmov/libllconf.so.0", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("/users/bedge/lib/sse2/cmov", 0xbfed4fe0) = -1 ENOENT (No such file
or directory)
open("/users/bedge/lib/sse2/libllconf.so.0", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/users/bedge/lib/sse2", 0xbfed4fe0) = -1 ENOENT (No such file or
directory)
open("/users/bedge/lib/cmov/libllconf.so.0", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/users/bedge/lib/cmov", 0xbfed4fe0) = -1 ENOENT (No such file or
directory)
open("/users/bedge/lib/libllconf.so.0", O_RDONLY) = -1 ENOENT (No such file
or directory)
stat64("/users/bedge/lib", 0xbfed4fe0)  = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=174566, ...}) = 0
mmap2(NULL, 174566, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7eef000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/libllconf.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240,\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=252552, ...}) = 0
mmap2(NULL, 83192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
0xb7eda000
mmap2(0xb7eee000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14) = 0xb7eee000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260e\1"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1364388, ...}) = 0
mmap2(NULL, 1369712, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0)
= 0xb7d8b000
mmap2(0xb7ed4000, 12288, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x149) = 0xb7ed4000
mmap2(0xb7ed7000, 9840, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7ed7000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/cmov/libdl.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p\n\0\000"..., 512)
= 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=9684, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb7d8a000
mmap2(NULL, 12412, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
0xb7d86000
mmap2(0xb7d88000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xb7d88000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb7d85000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7d856b0, limit:1048575,
seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1,
seg_not_present:0, useable:1}) = 0
mprotect(0xb7ed4000, 4096, PROT_READ)   = 0
munmap(0xb7eef000, 174566)              = 0
brk(0)                                  = 0x804c000
brk(0x806d000)                          = 0x806d000
open("/import/tonic/bedge/llconf/syslog-ng.conf", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=9745, ...}) = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb7f18000
read(3, "# \n# vim: set tabstop=4 shiftwid"..., 8192) = 8192
read(3, "on(df_daemon); };\n\n# kern.*     "..., 8192) = 1553
read(3, "", 8192)                       = 0

The conf file is attached.

Original issue reported on code.google.com by [email protected] on 21 Jul 2008 at 11:54

Attachments:

conserver parser not extracting data.

What steps will reproduce the problem?
1. try to extract data from conserver.cf file
2. dump works OK, but get, find, list don't
3.

What is the expected output? 
Any of the following commands should output data.

What do you see instead?
No matches found

eg:

dump is OK:

0 %> llconf conserver -i /import/tonic/bedge/llconf/conserver.cf -s dump | tail

               console ssp8400-b596 { master localhost; type exec; exec
telnet labsuns 9043; }
               console ssp8400-b029 { master localhost; type exec; exec
telnet labsuns 9044; }
               console q29 { master localhost; type exec; exec telnet
labsuns 9029; }


                access * {
                        # trusted localhost
                        #trusted localhost build1 saaz fastbuild melomel
lumpling wave walia tach1 build2;
                        #allow
                        device = ' 10.4.2.0 12.31.172.0 12.31.174.0
12.42.120.0'
                }

I can't get any data back from these commands.
(maybe I'm just blowing it, but similar commands worked with the ifupdown
parser)

0 %> llconf conserver -i /import/tonic/bedge/llconf/conserver.cf list
server/console

1 %> llconf conserver -i /import/tonic/bedge/llconf/conserver.cf list
server/console/q29

0 %> llconf conserver -i /import/tonic/bedge/llconf/conserver.cf find
server/console/q29

0 %> llconf conserver -i /import/tonic/bedge/llconf/conserver.cf find  q29


What version of the product are you using? On what operating system?
ubuntu 7.10

Please provide any additional information below.

onserver.cf is attached

Original issue reported on code.google.com by [email protected] on 23 Jul 2008 at 11:18

Attachments:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.