- Timestamp:
- Sep 16, 2018, 8:56:38 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile.in
r532 r534 128 128 sh_restrict.h sh_sub.h sh_fInotify.h sh_checksum.h \ 129 129 sh_dbIO.h sh_dbIO_int.h sh_guid.h sh_dbCheck.h sh_dbCreate.h \ 130 sh_sem.h 130 sh_sem.h sh_subuid.h 131 131 132 132 … … 175 175 $(srcsrc)/sh_checksum.c $(srcsrc)/sh_guid.c $(srcsrc)/sh_sem.c \ 176 176 $(srcsrc)/sh_dbIO.c $(srcsrc)/sh_dbCheck.c $(srcsrc)/sh_dbCreate.c \ 177 $(srcsrc)/sh_subuid.c \ 177 178 $(srcsrc)/t-test1.c 178 179 … … 197 198 sh_audit.o sh_registry.o sh_ipvx.o sh_restrict.o \ 198 199 sh_filetype.o sh_sub.o sh_fInotify.o sh_checksum.o \ 199 sh_guid.o sh_sem.o sh_dbIO.o sh_dbCheck.o sh_dbCreate.o 200 sh_guid.o sh_sem.o sh_dbIO.o sh_dbCheck.o sh_dbCreate.o \ 201 sh_subuid.o 200 202 201 203 … … 1631 1633 1632 1634 samhain.o: $(srcsrc)/samhain.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_getopt.h $(srcinc)/sh_readconf.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_restrict.h $(srcinc)/sh_nmail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_mem.h $(srcinc)/sh_xfer.h $(srcinc)/sh_tools.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h $(srcinc)/sh_sem.h sh_MK.h $(srcinc)/sh_schedule.h 1633 sh_unix.o: $(srcsrc)/sh_unix.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_hash.h $(srcinc)/sh_tools.h $(srcinc)/sh_restrict.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_tiger.h $(srcinc)/sh_prelink.h $(srcinc)/sh_pthread.h $(srcinc)/sh_sem.h $(srcinc)/sh_static.h $(srcinc)/sh_prelude.h $(srcinc)/zAVLTree.h $(srcinc)/sh_ ignore.h1635 sh_unix.o: $(srcsrc)/sh_unix.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_hash.h $(srcinc)/sh_tools.h $(srcinc)/sh_restrict.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_tiger.h $(srcinc)/sh_prelink.h $(srcinc)/sh_pthread.h $(srcinc)/sh_sem.h $(srcinc)/sh_static.h $(srcinc)/sh_prelude.h $(srcinc)/zAVLTree.h $(srcinc)/sh_subuid.h $(srcinc)/sh_ignore.h 1634 1636 sh_utils.o: $(srcsrc)/sh_utils.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_entropy.h $(srcinc)/sh_pthread.h 1635 1637 sh_error.o: $(srcsrc)/sh_error.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_database.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_nmail.h $(srcinc)/sh_xfer.h $(srcinc)/sh_prelude.h $(srcinc)/sh_pthread.h $(srcinc)/sh_tools.h $(srcinc)/sh_extern.h $(srcinc)/sh_checksum.h … … 1727 1729 sh_xload_client.o: $(srcsrc)/sh_xload_client.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_guid.h 1728 1730 sh_sem.o: $(srcsrc)/sh_sem.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_sem.h $(srcinc)/sh_error_min.h 1731 sh_subuid.o: $(srcsrc)/sh_subuid.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_unix.h -
trunk/config.h.in
r522 r534 907 907 /* Define to 1 if you have the <sys/stat.h> header file. */ 908 908 #undef HAVE_SYS_STAT_H 909 910 /* Define to 1 if you have the <sys/sysmacros.h> header file. */ 911 #undef HAVE_SYS_SYSMACROS_H 909 912 910 913 /* Define to 1 if you have the <sys/types.h> header file. */ -
trunk/configure.ac
r531 r534 12 12 dnl start 13 13 dnl 14 AM_INIT_AUTOMAKE(samhain, 4. 2.4)14 AM_INIT_AUTOMAKE(samhain, 4.3.0) 15 15 AC_DEFINE([SAMHAIN], 1, [Application is samhain]) 16 16 AC_CANONICAL_HOST … … 244 244 245 245 AC_CHECK_HEADERS(stddef.h libgen.h sched.h malloc.h sys/uio.h \ 246 sys/mman.h sys/param.h sys/inotify.h \246 sys/mman.h sys/param.h sys/inotify.h sys/sysmacros.h \ 247 247 sys/vfs.h mntent.h \ 248 248 sys/select.h sys/socket.h netinet/in.h ifaddrs.h \ -
trunk/depend.dep
r481 r534 2 2 # DO NOT DELETE THIS LINE 3 3 samhain.o: $(srcsrc)/samhain.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_getopt.h $(srcinc)/sh_readconf.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_restrict.h $(srcinc)/sh_nmail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_mem.h $(srcinc)/sh_xfer.h $(srcinc)/sh_tools.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h $(srcinc)/sh_sem.h sh_MK.h $(srcinc)/sh_schedule.h 4 sh_unix.o: $(srcsrc)/sh_unix.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_hash.h $(srcinc)/sh_tools.h $(srcinc)/sh_restrict.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_tiger.h $(srcinc)/sh_prelink.h $(srcinc)/sh_pthread.h $(srcinc)/sh_sem.h $(srcinc)/sh_static.h $(srcinc)/sh_prelude.h $(srcinc)/zAVLTree.h $(srcinc)/sh_ ignore.h4 sh_unix.o: $(srcsrc)/sh_unix.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_hash.h $(srcinc)/sh_tools.h $(srcinc)/sh_restrict.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_tiger.h $(srcinc)/sh_prelink.h $(srcinc)/sh_pthread.h $(srcinc)/sh_sem.h $(srcinc)/sh_static.h $(srcinc)/sh_prelude.h $(srcinc)/zAVLTree.h $(srcinc)/sh_subuid.h $(srcinc)/sh_ignore.h 5 5 sh_utils.o: $(srcsrc)/sh_utils.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_entropy.h $(srcinc)/sh_pthread.h 6 6 sh_error.o: $(srcsrc)/sh_error.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_database.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_nmail.h $(srcinc)/sh_xfer.h $(srcinc)/sh_prelude.h $(srcinc)/sh_pthread.h $(srcinc)/sh_tools.h $(srcinc)/sh_extern.h $(srcinc)/sh_checksum.h … … 100 100 sh_xload_client.o: $(srcsrc)/sh_xload_client.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_guid.h 101 101 sh_sem.o: $(srcsrc)/sh_sem.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_sem.h $(srcinc)/sh_error_min.h 102 sh_subuid.o: $(srcsrc)/sh_subuid.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_unix.h -
trunk/depend.sum
r481 r534 1 2959213307 1 3903466696 -
trunk/docs/Changelog
r533 r534 1 4.3.0: 2 * add support for /etc/subuid, /etc/subgid maps 3 * fix compiler warning on Ubuntu 18.04 4 1 5 4.2.4: 2 6 * fix 'clobbered by..' compiler warning is src/sh_portcheck.c -
trunk/src/sh_hash.c
r516 r534 24 24 #include <stdio.h> 25 25 #include <sys/types.h> 26 #ifdef HAVE_SYS_SYSMACROS_H 27 #include <sys/sysmacros.h> 28 #endif 26 29 #include <sys/stat.h> 27 30 #include <unistd.h> -
trunk/src/sh_unix.c
r516 r534 2827 2827 2828 2828 /* --------- end caching code --------- */ 2829 2829 2830 #include "sh_subuid.h" 2831 2830 2832 char * sh_unix_getUIDname (int level, uid_t uid, char * out, size_t len) 2831 2833 { … … 2863 2865 status = errno; 2864 2866 #endif 2865 2866 if (tempres == NULL) 2867 { 2868 sh_error_handle (level, FIL__, __LINE__, EINVAL, MSG_E_PWNULL, 2869 sh_error_message(status, errbuf, sizeof(errbuf)), 2870 _("getpwuid"), (long) uid, _("completely missing")); 2871 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R) 2872 SH_FREE(buffer); 2873 #endif 2874 sh_userid_add(uid, NULL, CACHE_UID); 2875 SL_RETURN( NULL, _("sh_unix_getUIDname")); 2876 } 2877 2878 2879 if (tempres->pw_name != NULL) 2867 2868 /* case 1: we have it 2869 */ 2870 if (tempres && tempres->pw_name != NULL) 2880 2871 { 2881 2872 … … 2888 2879 2889 2880 SL_RETURN( out, _("sh_unix_getUIDname")); 2890 } 2891 else 2892 { 2881 } 2882 2883 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R) 2884 SH_FREE(buffer); 2885 #endif 2886 2887 if (tempres == NULL) 2888 { 2889 char * pwname = sh_get_subuid ((unsigned long) uid); 2890 2891 if (pwname) 2892 { 2893 sl_strlcpy(out, pwname, len); 2894 sh_userid_add(uid, out, CACHE_UID); 2895 SL_RETURN( out, _("sh_unix_getUIDname")); 2896 } 2897 2893 2898 sh_error_handle (level, FIL__, __LINE__, EINVAL, MSG_E_PWNULL, 2894 2899 sh_error_message(status, errbuf, sizeof(errbuf)), 2895 _("getpwuid"), (long) uid, _("pw_user")); 2896 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R) 2897 SH_FREE(buffer); 2898 #endif 2900 _("getpwuid"), (long) uid, _("completely missing")); 2901 sh_userid_add(uid, NULL, CACHE_UID); 2899 2902 SL_RETURN( NULL, _("sh_unix_getUIDname")); 2900 2903 } 2901 /* notreached */ 2904 2905 2906 /* getwpuid returns struct, but no pw_name 2907 */ 2908 sh_error_handle (level, FIL__, __LINE__, EINVAL, MSG_E_PWNULL, 2909 sh_error_message(status, errbuf, sizeof(errbuf)), 2910 _("getpwuid"), (long) uid, _("pw_user")); 2911 SL_RETURN( NULL, _("sh_unix_getUIDname")); 2902 2912 } 2903 2913 … … 2959 2969 } 2960 2970 2961 if (tempres == NULL) 2962 { 2963 sh_error_handle (level, FIL__, __LINE__, EINVAL, MSG_E_GRNULL, 2964 sh_error_message(status, errbuf, sizeof(errbuf)), 2965 _("getgrgid"), (long) gid, _("completely missing")); 2966 2967 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R) 2968 SH_FREE(buffer); 2969 #endif 2970 2971 sh_userid_add(gid, NULL, CACHE_GID); 2972 SL_RETURN( NULL, _("sh_unix_getGIDname")); 2973 } 2974 2975 if (tempres->gr_name != NULL) 2971 if (tempres && tempres->gr_name != NULL) 2976 2972 { 2977 2973 … … 2985 2981 SL_RETURN( out, _("sh_unix_getGIDname")); 2986 2982 } 2987 else 2988 { 2983 2984 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R) 2985 SH_FREE(buffer); 2986 #endif 2987 2988 if (tempres == NULL) 2989 { 2990 char * grname = sh_get_subgid ((unsigned long) gid); 2991 2992 if (grname) 2993 { 2994 sl_strlcpy(out, grname, len); 2995 sh_userid_add((uid_t)gid, out, CACHE_GID); 2996 SL_RETURN( out, _("sh_unix_getGIDname")); 2997 } 2998 2989 2999 sh_error_handle (level, FIL__, __LINE__, EINVAL, MSG_E_GRNULL, 2990 3000 sh_error_message(status, errbuf, sizeof(errbuf)), 2991 _("getgrgid"), (long) gid, _("gr_name")); 2992 2993 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R) 2994 SH_FREE(buffer); 2995 #endif 2996 3001 _("getgrgid"), (long) gid, _("completely missing")); 3002 sh_userid_add(gid, NULL, CACHE_GID); 2997 3003 SL_RETURN( NULL, _("sh_unix_getGIDname")); 2998 3004 } 2999 /* notreached */ 3005 3006 sh_error_handle (level, FIL__, __LINE__, EINVAL, MSG_E_GRNULL, 3007 sh_error_message(status, errbuf, sizeof(errbuf)), 3008 _("getgrgid"), (long) gid, _("gr_name")); 3009 SL_RETURN( NULL, _("sh_unix_getGIDname")); 3000 3010 } 3001 3011 … … 3066 3076 } 3067 3077 3068 3078 /* return >0 on success, -1 on EOF */ 3069 3079 int sh_unix_getline (SL_TICKET fd, char * line, int sizeofline) 3070 3080 {
Note:
See TracChangeset
for help on using the changeset viewer.