Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler.
Number of rules (primarily dangerous function names) in C/C++ ruleset: 223
Examining data/realmd-0.16.3/service/realm-network.c
Examining data/realmd-0.16.3/service/realm-disco-rootdse.c
Examining data/realmd-0.16.3/service/realm-disco.h
Examining data/realmd-0.16.3/service/realm-kerberos-membership.c
Examining data/realmd-0.16.3/service/realm-credential.c
Examining data/realmd-0.16.3/service/realm-samba-provider.c
Examining data/realmd-0.16.3/service/realm-credential.h
Examining data/realmd-0.16.3/service/realm-all-provider.c
Examining data/realmd-0.16.3/service/realm-sssd.h
Examining data/realmd-0.16.3/service/realm-disco-mscldap.h
Examining data/realmd-0.16.3/service/realm-usleep-async.c
Examining data/realmd-0.16.3/service/realm-sssd-ad.h
Examining data/realmd-0.16.3/service/realm-disco-mscldap.c
Examining data/realmd-0.16.3/service/realm-kerberos-provider.h
Examining data/realmd-0.16.3/service/realm-samba-winbind.c
Examining data/realmd-0.16.3/service/realm-sssd-ad.c
Examining data/realmd-0.16.3/service/realm-sssd-ipa.h
Examining data/realmd-0.16.3/service/realm-daemon.h
Examining data/realmd-0.16.3/service/realm-adcli-enroll.h
Examining data/realmd-0.16.3/service/realm-disco-dns.c
Examining data/realmd-0.16.3/service/realm-packages.c
Examining data/realmd-0.16.3/service/realm-example.h
Examining data/realmd-0.16.3/service/realm-invocation.c
Examining data/realmd-0.16.3/service/realm-kerberos.c
Examining data/realmd-0.16.3/service/realm-login-name.c
Examining data/realmd-0.16.3/service/realm-kerberos-provider.c
Examining data/realmd-0.16.3/service/realm-samba-enroll.h
Examining data/realmd-0.16.3/service/realm-provider.c
Examining data/realmd-0.16.3/service/realm-settings.h
Examining data/realmd-0.16.3/service/realm-invocation.h
Examining data/realmd-0.16.3/service/realm-provider.h
Examining data/realmd-0.16.3/service/realm-usleep-async.h
Examining data/realmd-0.16.3/service/realm-ini-config.h
Examining data/realmd-0.16.3/service/realm-sssd-config.c
Examining data/realmd-0.16.3/service/realm-samba-winbind.h
Examining data/realmd-0.16.3/service/realm-sssd-provider.c
Examining data/realmd-0.16.3/service/realm-disco.c
Examining data/realmd-0.16.3/service/realm-service.c
Examining data/realmd-0.16.3/service/realm-disco-dns.h
Examining data/realmd-0.16.3/service/realm-kerberos-membership.h
Examining data/realmd-0.16.3/service/realm-disco-domain.h
Examining data/realmd-0.16.3/service/realm-dn-util.c
Examining data/realmd-0.16.3/service/realm-disco-domain.c
Examining data/realmd-0.16.3/service/realm-sssd-config.h
Examining data/realmd-0.16.3/service/realm-errors.c
Examining data/realmd-0.16.3/service/realm-diagnostics.h
Examining data/realmd-0.16.3/service/realm-example-provider.h
Examining data/realmd-0.16.3/service/realm-network.h
Examining data/realmd-0.16.3/service/realm-daemon.c
Examining data/realmd-0.16.3/service/realm-options.h
Examining data/realmd-0.16.3/service/realm-command.c
Examining data/realmd-0.16.3/service/realm-login-name.h
Examining data/realmd-0.16.3/service/realm-ini-config.c
Examining data/realmd-0.16.3/service/realm-example-provider.c
Examining data/realmd-0.16.3/service/realm-ldap.h
Examining data/realmd-0.16.3/service/realm-samba-config.h
Examining data/realmd-0.16.3/service/realm-adcli-enroll.c
Examining data/realmd-0.16.3/service/realm-command.h
Examining data/realmd-0.16.3/service/realm-ldap.c
Examining data/realmd-0.16.3/service/realm-options.c
Examining data/realmd-0.16.3/service/realm-samba-enroll.c
Examining data/realmd-0.16.3/service/realm-all-provider.h
Examining data/realmd-0.16.3/service/realm-sssd-ipa.c
Examining data/realmd-0.16.3/service/realm-example.c
Examining data/realmd-0.16.3/service/realm-settings.c
Examining data/realmd-0.16.3/service/safe-format-string.h
Examining data/realmd-0.16.3/service/realm-dn-util.h
Examining data/realmd-0.16.3/service/realm-errors.h
Examining data/realmd-0.16.3/service/realm-samba-provider.h
Examining data/realmd-0.16.3/service/realm-packages.h
Examining data/realmd-0.16.3/service/realm-samba.c
Examining data/realmd-0.16.3/service/realm-disco-rootdse.h
Examining data/realmd-0.16.3/service/realm-diagnostics.c
Examining data/realmd-0.16.3/service/realm-samba-config.c
Examining data/realmd-0.16.3/service/realm-samba.h
Examining data/realmd-0.16.3/service/realm-sssd-provider.h
Examining data/realmd-0.16.3/service/realm-kerberos.h
Examining data/realmd-0.16.3/service/safe-format-string.c
Examining data/realmd-0.16.3/service/realm-service.h
Examining data/realmd-0.16.3/service/realm-sssd.c
Examining data/realmd-0.16.3/tools/realm-client.h
Examining data/realmd-0.16.3/tools/realm-join.c
Examining data/realmd-0.16.3/tools/realm.c
Examining data/realmd-0.16.3/tools/realm-client.c
Examining data/realmd-0.16.3/tools/realm-logins.c
Examining data/realmd-0.16.3/tools/realm.h
Examining data/realmd-0.16.3/tools/realm-leave.c
Examining data/realmd-0.16.3/tools/realm-discover.c
Examining data/realmd-0.16.3/dbus/realm-dbus-constants.h
Examining data/realmd-0.16.3/tests/test-login-name.c
Examining data/realmd-0.16.3/tests/test-dn-util.c
Examining data/realmd-0.16.3/tests/test-ini-config.c
Examining data/realmd-0.16.3/tests/test-safe-format.c
Examining data/realmd-0.16.3/tests/frob-install-packages.c
Examining data/realmd-0.16.3/tests/test-settings.c
Examining data/realmd-0.16.3/tests/test-sssd-config.c

FINAL RESULTS:

data/realmd-0.16.3/service/realm-sssd.c:408:17:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	if (g_strcmp0 (access, "simple") == 0) {
data/realmd-0.16.3/service/realm-sssd.c:424:24:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	} else if (g_strcmp0 (access, sssd_class->sssd_conf_provider_name) == 0) {
data/realmd-0.16.3/service/realm-sssd.c:426:24:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	} else if (g_strcmp0 (access, "permit") == 0) {
data/realmd-0.16.3/service/realm-sssd.c:428:24:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	} else if (g_strcmp0 (access, "deny") == 0) {
data/realmd-0.16.3/service/realm-sssd.c:443:10:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	g_free (access);
data/realmd-0.16.3/tests/frob-install-packages.c:117:2:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vfprintf (stderr, format, va);
data/realmd-0.16.3/tests/frob-install-packages.c:131:2:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vfprintf (stderr, format, va);
data/realmd-0.16.3/tools/realm-client.c:830:14:  [4] (misc) getpass:
  This function is obsolete and not portable. It was in SUSv2 but removed by
  POSIX.2. What it does exactly varies considerably between systems,
  particularly in where its prompt is displayed and where it gets its data
  (e.g., /dev/tty, stdin, stderr, etc.). In addition, some implementations
  overflow buffers. (CWE-676, CWE-120, CWE-20). Make the specific calls to do
  exactly what you want. If you continue to use it, or write your own, be
  sure to zero the password as soon as possible to avoid leaving the
  cleartext password visible in the process' address space.
		password = getpass (prompt);
data/realmd-0.16.3/service/realm-credential.c:41:14:  [3] (buffer) g_get_tmp_dir:
  This function is synonymous with 'getenv("TMP")';it returns untrustable
  input if the environment can beset by an attacker. It can have any content
  and length, and the same variable can be set more than once (CWE-807,
  CWE-20). Check environment variables carefully before using them.
	directory = g_get_tmp_dir ();
data/realmd-0.16.3/service/realm-daemon.c:515:7:  [3] (misc) chroot:
  chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22).
  Make sure the program immediately chdir("/"), closes file descriptors, and
  drops root privileges, and that all necessary files (and no more!) are in
  the new root.
		if (chroot (service_install) < 0) {
data/realmd-0.16.3/service/realm-samba-enroll.c:138:44:  [3] (buffer) g_get_tmp_dir:
  This function is synonymous with 'getenv("TMP")';it returns untrustable
  input if the environment can beset by an attacker. It can have any content
  and length, and the same variable can be set more than once (CWE-807,
  CWE-20). Check environment variables carefully before using them.
	join->custom_smb_conf = g_build_filename (g_get_tmp_dir (), "realmd-smb-conf.XXXXXX", NULL);
data/realmd-0.16.3/service/realm-samba-enroll.c:151:50:  [3] (buffer) g_get_tmp_dir:
  This function is synonymous with 'getenv("TMP")';it returns untrustable
  input if the environment can beset by an attacker. It can have any content
  and length, and the same variable can be set more than once (CWE-807,
  CWE-20). Check environment variables carefully before using them.
		g_warning ("Couldn't create temp file in: %s", g_get_tmp_dir ());
data/realmd-0.16.3/tools/realm-client.c:562:15:  [3] (buffer) g_get_tmp_dir:
  This function is synonymous with 'getenv("TMP")';it returns untrustable
  input if the environment can beset by an attacker. It can have any content
  and length, and the same variable can be set more than once (CWE-807,
  CWE-20). Check environment variables carefully before using them.
		directory = g_get_tmp_dir ();
data/realmd-0.16.3/service/realm-kerberos.c:1080:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char kt_name[MAX_KEYTAB_NAME_LEN];
data/realmd-0.16.3/service/realm-samba-enroll.c:171:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char *env[8];
data/realmd-0.16.3/service/safe-format-string.c:262:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy (cx->data + cx->length, piece, length);
data/realmd-0.16.3/tests/test-safe-format.c:180:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buffer[8];
data/realmd-0.16.3/tools/realm-logins.c:103:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy (add_or_remove, logins, sizeof (gchar *) * n_logins);
data/realmd-0.16.3/service/realm-command.c:181:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		result = read (fd, block, sizeof (block));
data/realmd-0.16.3/service/realm-command.c:635:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	memset ((char *)password, 0, strlen (password));
data/realmd-0.16.3/service/realm-credential.c:129:65:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	cred->x.password.value = g_bytes_new_with_free_func (password, strlen (password),
data/realmd-0.16.3/service/realm-diagnostics.c:85:55:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	log_syslog_and_debug (invocation, log_level, string, strlen (string));
data/realmd-0.16.3/service/realm-diagnostics.c:157:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		n_data = strlen (data);
data/realmd-0.16.3/service/realm-disco-mscldap.c:88:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen (hostname) > 15) {
data/realmd-0.16.3/service/realm-disco-rootdse.c:73:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	len = strlen (value);
data/realmd-0.16.3/service/realm-example-provider.c:115:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	length = strlen (domain);
data/realmd-0.16.3/service/realm-example-provider.c:171:25:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		if (string == NULL || strlen (string) == 0)
data/realmd-0.16.3/service/realm-example.c:111:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen (pass) != size)
data/realmd-0.16.3/service/realm-ini-config.c:562:29:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	bytes = g_bytes_new (data, strlen (data));
data/realmd-0.16.3/service/realm-ini-config.c:695:11:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			mask = umask (S_IRWXG | S_IRWXO);
data/realmd-0.16.3/service/realm-ini-config.c:700:4:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			umask (mask);
data/realmd-0.16.3/service/realm-ini-config.c:788:41:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		line->bytes = g_bytes_new_take (data, strlen (data));
data/realmd-0.16.3/service/realm-ini-config.c:823:41:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		line->bytes = g_bytes_new_take (data, strlen (data));
data/realmd-0.16.3/service/realm-ini-config.c:831:41:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		line->bytes = g_bytes_new_take (data, strlen (data));
data/realmd-0.16.3/service/realm-login-name.c:41:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	end = format + strlen (format);
data/realmd-0.16.3/service/realm-login-name.c:73:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		length = strlen (login);
data/realmd-0.16.3/service/realm-options.c:153:20:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	for (i = 0, len = strlen (name); i < len; i++) {
data/realmd-0.16.3/service/realm-packages.c:154:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			pos = id + strlen (id);
data/realmd-0.16.3/service/realm-sssd.c:127:45:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		if (strcspn (logins[i], INVALID_CHARS) != strlen (logins[i])) {
data/realmd-0.16.3/service/safe-format-string.c:193:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        len = strlen (value);
data/realmd-0.16.3/tests/test-ini-config.c:131:36:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	bytes = g_bytes_new_static (data, strlen (data));
data/realmd-0.16.3/tools/realm-client.c:616:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	                             strlen (realm_name), realm_name,
data/realmd-0.16.3/tools/realm-client.c:797:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	len = strlen (password);
data/realmd-0.16.3/tools/realm-client.c:849:32:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		memset ((char *)password, 0, strlen (password));
data/realmd-0.16.3/tools/realm-client.c:922:51:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	                                                 strlen (one_time_password),
data/realmd-0.16.3/tools/realm-client.c:968:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	                             strlen (realm_name), realm_name,

ANALYSIS SUMMARY:

Hits = 46
Lines analyzed = 22509 in approximately 0.48 seconds (47291 lines/second)
Physical Source Lines of Code (SLOC) = 16645
Hits@level = [0]   1 [1]  28 [2]   5 [3]   5 [4]   8 [5]   0
Hits@level+ = [0+]  47 [1+]  46 [2+]  18 [3+]  13 [4+]   8 [5+]   0
Hits/KSLOC@level+ = [0+] 2.82367 [1+] 2.76359 [2+] 1.08141 [3+] 0.781015 [4+] 0.480625 [5+]   0
Dot directories skipped = 1 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.