qemu-e2k/util
Markus Armbruster 4999f3a8a6 acl: acl_add can't insert before last list element, fix
Watch this:

    $ upstream-qemu -nodefaults -S -vnc :0,acl,sasl -monitor stdio
    QEMU 1.5.50 monitor - type 'help' for more information
    (qemu) acl_add vnc.username drei allow
    acl: added rule at position 1
    (qemu) acl_show vnc.username
    policy: deny
    1: allow drei
    (qemu) acl_add vnc.username zwei allow 1
    acl: added rule at position 2
    (qemu) acl_show vnc.username
    policy: deny
    1: allow drei
    2: allow zwei
    (qemu) acl_add vnc.username eins allow 1
    acl: added rule at position 1
    (qemu) acl_show vnc.username
    policy: deny
    1: allow eins
    2: allow drei
    3: allow zwei

The second acl_add inserts at position 2 instead of 1.

Root cause is an off-by-one in qemu_acl_insert(): when index ==
acl->nentries, it appends instead of inserting before the last list
element.

Cc: qemu-stable@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-06-21 22:52:50 +04:00
..
acl.c acl: acl_add can't insert before last list element, fix 2013-06-21 22:52:50 +04:00
aes.c
bitmap.c
bitops.c
cache-utils.c
compatfd.c
crc32c.c
cutils.c qemu-io: Move qemu_strsep() to cutils.c 2013-06-06 11:27:04 +02:00
envlist.c
error.c error: add error_setg_file_open() helper 2013-06-17 11:01:14 -04:00
event_notifier-posix.c
event_notifier-win32.c
fifo8.c
hbitmap.c
hexdump.c Rename hexdump to avoid FreeBSD libutil conflict 2013-05-20 08:20:08 -05:00
host-utils.c
iov.c Rename hexdump to avoid FreeBSD libutil conflict 2013-05-20 08:20:08 -05:00
Makefile.objs create qemu_openpty_raw() helper function and move it to a separate file 2013-06-14 14:28:43 +04:00
module.c
notify.c
osdep.c
oslib-posix.c osdep: add qemu_get_local_state_pathname() 2013-05-30 11:37:37 -05:00
oslib-win32.c osdep: add qemu_get_local_state_pathname() 2013-05-30 11:37:37 -05:00
path.c
qemu-config.c
qemu-error.c
qemu-openpty.c create qemu_openpty_raw() helper function and move it to a separate file 2013-06-14 14:28:43 +04:00
qemu-option.c qemu-option: check_params() is now unused, drop it 2013-06-19 14:10:42 -05:00
qemu-progress.c
qemu-sockets.c qemu-socket: allow hostnames starting with a digit 2013-06-18 11:42:45 +02:00
qemu-thread-posix.c
qemu-thread-win32.c
qemu-timer-common.c
unicode.c
uri.c clean unnecessary code: don't check g_strdup arg for NULL 2013-05-12 13:25:55 +04:00