Alejandro Colomar
f6701d3efa
lib/prefix_flag.c: Invert conditional to remove a branch
...
This simplifies the code, and is preparation for a following commit.
Signed-off-by: Alejandro Colomar <alx@kernel.org >
2023-12-04 12:21:55 +01:00
Alejandro Colomar
dbb37b1b31
lib/string/: Move string-related files to string/ subdir
...
Signed-off-by: Alejandro Colomar <alx@kernel.org >
2023-12-03 12:22:11 -06:00
Alejandro Colomar
4f16458b6c
lib/, src/: Say 'long' instead of 'long int'
...
We were using 'long' in most places, so be consistent and use it
everywhere.
Signed-off-by: Alejandro Colomar <alx@kernel.org >
2023-12-03 09:58:19 -06:00
Joakim Tjernlund
ee3a79c695
Define SUBUID_FILE/SUBGID_FILE
...
These where hard coded, make them definable like SHADOW_FILE
Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com >
2023-11-13 12:40:48 +01:00
Alejandro Colomar
d5e1c1e475
lib/, src/: Use xasprintf() instead of its pattern
...
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com >
Signed-off-by: Alejandro Colomar <alx@kernel.org >
2023-10-20 21:05:33 +02:00
Alejandro Colomar
ad3b31a59e
lib/, src/: Use asprintf(3) instead of strlen(3)+malloc(3)+snprintf(3)
...
asprintf(3) is non-standard, but is provided by GNU, the BSDs, and musl.
That makes it portable enough for us to use.
This function is much simpler than the burdensome code for allocating
the right size. Being simpler, it's thus safer.
I took the opportunity to fix the style to my preferred one in the
definitions of variables used in these calls, and also in the calls to
free(3) with these pointers. That isn't gratuituous, but has a reason:
it makes those appear in the diff for this patch, which helps review it.
Oh, well, I had an excuse :)
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com >
Signed-off-by: Alejandro Colomar <alx@kernel.org >
2023-10-20 21:05:33 +02:00
Alejandro Colomar
093fb605f9
lib: Merge libmisc into libshadow
...
The separation was unnecessary, and caused build problems. Let's go
wild and obliterate the library. The files are moved to libshadow.
Scripted change:
$ find libmisc/ -type f \
| grep '\.[chy]$' \
| xargs mv -t lib;
Plus updating the Makefile and other references. While at it, I've
sorted the sources lists.
Link: <https://github.com/shadow-maint/shadow/pull/792 >
Reported-by: David Seifert <soap@gentoo.org >
Cc: Sam James <sam@gentoo.org >
Cc: Christian Bricart <christian@bricart.de >
Cc: Michael Vetter <jubalh@iodoru.org >
Cc: Robert Förster <Dessa@gmake.de >
[ soap tested the Gentoo package ]
Tested-by: David Seifert <soap@gentoo.org >
Acked-by: David Seifert <soap@gentoo.org >
Acked-by: Serge Hallyn <serge@hallyn.com >
Acked-by: Iker Pedrosa <ipedrosa@redhat.com >
Acked-by: <lslebodn@fedoraproject.org >
Signed-off-by: Alejandro Colomar <alx@kernel.org >
2023-08-31 08:55:26 +02:00