-
Notifications
You must be signed in to change notification settings - Fork 221
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
Uh, get some more numbers #899
base: master
Are you sure you want to change the base?
Commits on May 27, 2024
-
lib/typetraits.h: Add macros that give information about a type
In the case of is_unsigned() and is_signed(), the natural thing would be to compare to 0: #define is_unsigned(x) (((typeof(x)) -1) > 0) #define is_signed(x) (((typeof(x)) -1) < 0) However, that would trigger -Wtype-limits, so we compare against 1, which silences that, and does the same job. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for d06c81f - Browse repository at this point
Copy the full SHA d06c81fView commit details -
src/: Use str2[u]l() instead of atoi(3)
atoi(3) easily triggers Undefined Behavior. Replace it by str2[u]l(), which are safe from that, and add type safety too. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for b8e914f - Browse repository at this point
Copy the full SHA b8e914fView commit details -
lib/get_gid.c: get_gid(): Reimplement in terms of a2i()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 105697f - Browse repository at this point
Copy the full SHA 105697fView commit details -
lib/, libsubid/, po/, src/: get_gid(): Move function to "atoi/getnum.h"
Implement it as an inline function, and add restrict and ATTR_STRING() and ATTR_ACCESS() as appropriate. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 36db6c5 - Browse repository at this point
Copy the full SHA 36db6c5View commit details -
lib/: Don't open-code get_gid()
These functions were open-coding get_gid(). Use the actual function. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 310b3d8 - Browse repository at this point
Copy the full SHA 310b3d8View commit details -
lib/get_pid.c: get_pid(): Reimplement in terms of a2i()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 7b9fe7a - Browse repository at this point
Copy the full SHA 7b9fe7aView commit details -
lib/: get_pid(): Move function to "atoi/getnum.h"
Implement it as an inline function, and add restrict and ATTR_STRING() and ATTR_ACCESS() as appropriate. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 7914f14 - Browse repository at this point
Copy the full SHA 7914f14View commit details -
lib/atoi/getnum.[ch]: get_fd(): Add function for parsing a file descr…
…iptor from a string Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 7d00e66 - Browse repository at this point
Copy the full SHA 7d00e66View commit details -
lib/get_pid.c: get_pidfd_from_fd(): Don't open-code get_fd()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 044396c - Browse repository at this point
Copy the full SHA 044396cView commit details -
src/usermod.c: getulong_range(): Reimplement in terms of a2ul()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 0a81ae8 - Browse repository at this point
Copy the full SHA 0a81ae8View commit details -
lib/get_uid.c: get_uid(): Reimplement in terms of a2i()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for d9e31c7 - Browse repository at this point
Copy the full SHA d9e31c7View commit details -
lib/, po/, src/: get_uid(): Move function to "atoi/getnum.h"
Implement it as an inline function, and add restrict and ATTR_STRING() and ATTR_ACCESS() as appropriate. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 5332860 - Browse repository at this point
Copy the full SHA 5332860View commit details -
lib/limits.c: setrlimit_value(): Reimplement in terms of a2i()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 4d4b471 - Browse repository at this point
Copy the full SHA 4d4b471View commit details -
src/usermod.c: Fix const correctness
Now that we use liba2i's const-generic macros, we can (and must) use a 'const char **' endp where the input string is 'const char *'. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for b85ad7a - Browse repository at this point
Copy the full SHA b85ad7aView commit details -
lib/getdef.c: getdef_num(): Simplify, by calling a2si() instead of st…
…r2sl() Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 451d07a - Browse repository at this point
Copy the full SHA 451d07aView commit details -
lib/getdef.c: getdef_unum(): Fix wrong limit check
The limit, since it's an unsigned int, should have been UINT_MAX, not INT_MAX. By calling a2ui() we can fix that and simplify too. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 6dee811 - Browse repository at this point
Copy the full SHA 6dee811View commit details -
lib/getdef.c: getdef_long(): Simplify, by calling a2sl() instead of s…
…tr2sl() Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 49c4471 - Browse repository at this point
Copy the full SHA 49c4471View commit details -
lib/limits.c: set_prio(): Simplify, by calling str2si() instead of st…
…r2sl() Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for cac5f74 - Browse repository at this point
Copy the full SHA cac5f74View commit details -
lib/limits.c: set_umask(): Simplify, by calling str2i(mode_t, ) inste…
…ad of str2ul() Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for d5ab3b8 - Browse repository at this point
Copy the full SHA d5ab3b8View commit details -
lib/limits.c: setup_limits(): Simplify, by calling a2si() instead of …
…str2sl() Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 4e89e52 - Browse repository at this point
Copy the full SHA 4e89e52View commit details -
lib/limits.c: setup_limits(): Simplify, by calling str2si() instead o…
…f str2sl() Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 426ac24 - Browse repository at this point
Copy the full SHA 426ac24View commit details -
lib/limits.c: setup_limits(): Simplify, by calling str2i(mode_t, ) in…
…stead of str2ul() Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 2ef41f0 - Browse repository at this point
Copy the full SHA 2ef41f0View commit details -
lib/sgetspent.c: sgetspent(): Simplify, by calling a2sl() instead of …
…str2sl() Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 2b25ce9 - Browse repository at this point
Copy the full SHA 2b25ce9View commit details -
lib/shadow.c: my_sgetspent(): Merge 'else {if}' into 'else if'
This reduces indentation. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for bca0f25 - Browse repository at this point
Copy the full SHA bca0f25View commit details -
lib/shadow.c: my_sgetspent(): Remove dead code
spwd.sp_flag is an unsigned long, which can never be negative. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 482ce21 - Browse repository at this point
Copy the full SHA 482ce21View commit details -
lib/shadow.c: my_sgetspent(): Simplify error handling
Handle negative values as errors from a2sl(), and reuse its error-handling code. Cc: Iker Pedrosa <ipedrosa@redhat.com> Cc: "Serge E. Hallyn" <serge@hallyn.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for f3dc975 - Browse repository at this point
Copy the full SHA f3dc975View commit details -
src/check_subid_range.c: Call get_uid() instead of str2sl()
This value represents a uid. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 68ee8b5 - Browse repository at this point
Copy the full SHA 68ee8b5View commit details -
src/useradd.c: Simplify, by calling a2sl() instead of str2sl()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for e6cf1be - Browse repository at this point
Copy the full SHA e6cf1beView commit details -
src/passwd.c: Simplify, by calling a2sl() instead of str2sl()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for dc887b5 - Browse repository at this point
Copy the full SHA dc887b5View commit details -
src/usermod.c: Simplify, by calling a2sl() instead of str2sl()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 2f08f7e - Browse repository at this point
Copy the full SHA 2f08f7eView commit details -
src/faillog.c: Simplify, by calling str2sh() instead of str2sl()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 2fb41cd - Browse repository at this point
Copy the full SHA 2fb41cdView commit details -
src/chage.c: Simplify, by calling a2sl() instead of str2sl()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Configuration menu - View commit details
-
Copy full SHA for 07497fb - Browse repository at this point
Copy the full SHA 07497fbView commit details