aboutsummaryrefslogtreecommitdiff
path: root/src/util/service.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/service.c')
-rw-r--r--src/util/service.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/util/service.c b/src/util/service.c
index cab8a8aef..d8ca5eba6 100644
--- a/src/util/service.c
+++ b/src/util/service.c
@@ -101,7 +101,7 @@ GNUNET_SPEEDUP_stop_ (void);
101 * with a semicolon). The network must be given in dotted-decimal 101 * with a semicolon). The network must be given in dotted-decimal
102 * notation. The netmask can be given in CIDR notation (/16) or 102 * notation. The netmask can be given in CIDR notation (/16) or
103 * in dotted-decimal (/255.255.0.0). 103 * in dotted-decimal (/255.255.0.0).
104 * 104 *
105 * @param routeList a string specifying the forbidden networks 105 * @param routeList a string specifying the forbidden networks
106 * @return the converted list, NULL if the synatx is flawed 106 * @return the converted list, NULL if the synatx is flawed
107 */ 107 */
@@ -254,7 +254,7 @@ parse_ipv4_specification (const char *routeList)
254 * with a semicolon). The network must be given in colon-hex 254 * with a semicolon). The network must be given in colon-hex
255 * notation. The netmask must be given in CIDR notation (/16) or 255 * notation. The netmask must be given in CIDR notation (/16) or
256 * can be omitted to specify a single host. 256 * can be omitted to specify a single host.
257 * 257 *
258 * @param routeListX a string specifying the forbidden networks 258 * @param routeListX a string specifying the forbidden networks
259 * @return the converted list, NULL if the synatx is flawed 259 * @return the converted list, NULL if the synatx is flawed
260 */ 260 */
@@ -659,18 +659,18 @@ check_access (void *cls, const struct GNUNET_CONNECTION_Credentials *uc,
659#ifndef WINDOWS 659#ifndef WINDOWS
660 case AF_UNIX: 660 case AF_UNIX:
661 ret = GNUNET_OK; /* always OK for now */ 661 ret = GNUNET_OK; /* always OK for now */
662 if (GNUNET_YES == sctx->match_uid) 662 if (GNUNET_YES == sctx->match_uid)
663 { 663 {
664 /* UID match required */ 664 /* UID match required */
665 ret = (NULL != uc) && ( (0 == uc->uid) || (uc->uid == geteuid ()) ); 665 ret = (NULL != uc) && ( (0 == uc->uid) || (uc->uid == geteuid ()) );
666 } 666 }
667 else if ( (GNUNET_YES == sctx->match_gid) && 667 else if ( (GNUNET_YES == sctx->match_gid) &&
668 ( (NULL == uc) || 668 ( (NULL == uc) ||
669 ( (0 != uc->uid) && 669 ( (0 != uc->uid) &&
670 (uc->uid != geteuid ()) ) ) ) 670 (uc->uid != geteuid ()) ) ) )
671 { 671 {
672 /* group match required and UID does not match */ 672 /* group match required and UID does not match */
673 if (NULL == uc) 673 if (NULL == uc)
674 { 674 {
675 /* no credentials, group match not possible */ 675 /* no credentials, group match not possible */
676 ret = GNUNET_NO; 676 ret = GNUNET_NO;
@@ -718,7 +718,7 @@ check_access (void *cls, const struct GNUNET_CONNECTION_Credentials *uc,
718 if (GNUNET_OK != ret) 718 if (GNUNET_OK != ret)
719 { 719 {
720 LOG (GNUNET_ERROR_TYPE_WARNING, 720 LOG (GNUNET_ERROR_TYPE_WARNING,
721 _("Access from `%s' denied to service `%s'\n"), 721 _("Access from `%s' denied to service `%s'\n"),
722 GNUNET_a2s (addr, addrlen), 722 GNUNET_a2s (addr, addrlen),
723 sctx->service_name); 723 sctx->service_name);
724 } 724 }
@@ -750,9 +750,9 @@ get_pid_file_name (struct GNUNET_SERVICE_Context *sctx)
750 * Parse an IPv4 access control list. 750 * Parse an IPv4 access control list.
751 * 751 *
752 * @param ret location where to write the ACL (set) 752 * @param ret location where to write the ACL (set)
753 * @param sctx service context to use to get the configuration 753 * @param sctx service context to use to get the configuration
754 * @param option name of the ACL option to parse 754 * @param option name of the ACL option to parse
755 * @return GNUNET_SYSERR on parse error, GNUNET_OK on success (including 755 * @return GNUNET_SYSERR on parse error, GNUNET_OK on success (including
756 * no ACL configured) 756 * no ACL configured)
757 */ 757 */
758static int 758static int
@@ -763,7 +763,7 @@ process_acl4 (struct IPv4NetworkSet **ret, struct GNUNET_SERVICE_Context *sctx,
763 763
764 if (!GNUNET_CONFIGURATION_have_value (sctx->cfg, sctx->service_name, option)) 764 if (!GNUNET_CONFIGURATION_have_value (sctx->cfg, sctx->service_name, option))
765 { 765 {
766 *ret = NULL; 766 *ret = NULL;
767 return GNUNET_OK; 767 return GNUNET_OK;
768 } 768 }
769 GNUNET_break (GNUNET_OK == 769 GNUNET_break (GNUNET_OK ==
@@ -787,9 +787,9 @@ process_acl4 (struct IPv4NetworkSet **ret, struct GNUNET_SERVICE_Context *sctx,
787 * Parse an IPv6 access control list. 787 * Parse an IPv6 access control list.
788 * 788 *
789 * @param ret location where to write the ACL (set) 789 * @param ret location where to write the ACL (set)
790 * @param sctx service context to use to get the configuration 790 * @param sctx service context to use to get the configuration
791 * @param option name of the ACL option to parse 791 * @param option name of the ACL option to parse
792 * @return GNUNET_SYSERR on parse error, GNUNET_OK on success (including 792 * @return GNUNET_SYSERR on parse error, GNUNET_OK on success (including
793 * no ACL configured) 793 * no ACL configured)
794 */ 794 */
795static int 795static int
@@ -1825,7 +1825,7 @@ shutdown:
1825#if HAVE_MALLINFO 1825#if HAVE_MALLINFO
1826 { 1826 {
1827 char *counter; 1827 char *counter;
1828 1828
1829 if ( (GNUNET_YES == 1829 if ( (GNUNET_YES ==
1830 GNUNET_CONFIGURATION_have_value (sctx.cfg, service_name, 1830 GNUNET_CONFIGURATION_have_value (sctx.cfg, service_name,
1831 "GAUGER_HEAP")) && 1831 "GAUGER_HEAP")) &&
@@ -1835,11 +1835,11 @@ shutdown:
1835 &counter)) ) 1835 &counter)) )
1836 { 1836 {
1837 struct mallinfo mi; 1837 struct mallinfo mi;
1838 1838
1839 mi = mallinfo (); 1839 mi = mallinfo ();
1840 GAUGER (service_name, counter, mi.usmblks, "blocks"); 1840 GAUGER (service_name, counter, mi.usmblks, "blocks");
1841 GNUNET_free (counter); 1841 GNUNET_free (counter);
1842 } 1842 }
1843 } 1843 }
1844#endif 1844#endif
1845 GNUNET_SPEEDUP_stop_ (); 1845 GNUNET_SPEEDUP_stop_ ();
@@ -1944,7 +1944,7 @@ GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Context *sctx)
1944#if HAVE_MALLINFO 1944#if HAVE_MALLINFO
1945 { 1945 {
1946 char *counter; 1946 char *counter;
1947 1947
1948 if ( (GNUNET_YES == 1948 if ( (GNUNET_YES ==
1949 GNUNET_CONFIGURATION_have_value (sctx->cfg, sctx->service_name, 1949 GNUNET_CONFIGURATION_have_value (sctx->cfg, sctx->service_name,
1950 "GAUGER_HEAP")) && 1950 "GAUGER_HEAP")) &&
@@ -1954,11 +1954,11 @@ GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Context *sctx)
1954 &counter)) ) 1954 &counter)) )
1955 { 1955 {
1956 struct mallinfo mi; 1956 struct mallinfo mi;
1957 1957
1958 mi = mallinfo (); 1958 mi = mallinfo ();
1959 GAUGER (sctx->service_name, counter, mi.usmblks, "blocks"); 1959 GAUGER (sctx->service_name, counter, mi.usmblks, "blocks");
1960 GNUNET_free (counter); 1960 GNUNET_free (counter);
1961 } 1961 }
1962 } 1962 }
1963#endif 1963#endif
1964 if (GNUNET_SCHEDULER_NO_TASK != sctx->shutdown_task) 1964 if (GNUNET_SCHEDULER_NO_TASK != sctx->shutdown_task)