aboutsummaryrefslogtreecommitdiffstats
path: root/src/firejail/profile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/firejail/profile.c')
-rw-r--r--src/firejail/profile.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/firejail/profile.c b/src/firejail/profile.c
index 993acf2aa..8f98fd397 100644
--- a/src/firejail/profile.c
+++ b/src/firejail/profile.c
@@ -875,38 +875,26 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
875 if (strncmp(ptr, "rlimit", 6) == 0) { 875 if (strncmp(ptr, "rlimit", 6) == 0) {
876 if (strncmp(ptr, "rlimit-nofile ", 14) == 0) { 876 if (strncmp(ptr, "rlimit-nofile ", 14) == 0) {
877 ptr += 14; 877 ptr += 14;
878 if (not_unsigned(ptr)) { 878 check_unsigned(ptr + 14, "Error: invalid rlimit in profile file: ");
879 fprintf(stderr, "Invalid rlimit option on line %d\n", lineno); 879 sscanf(ptr, "%llu", &cfg.rlimit_nofile);
880 exit(1);
881 }
882 sscanf(ptr, "%u", &cfg.rlimit_nofile);
883 arg_rlimit_nofile = 1; 880 arg_rlimit_nofile = 1;
884 } 881 }
885 else if (strncmp(ptr, "rlimit-nproc ", 13) == 0) { 882 else if (strncmp(ptr, "rlimit-nproc ", 13) == 0) {
886 ptr += 13; 883 ptr += 13;
887 if (not_unsigned(ptr)) { 884 check_unsigned(ptr + 13, "Error: invalid rlimit in profile file: ");
888 fprintf(stderr, "Invalid rlimit option on line %d\n", lineno); 885 sscanf(ptr, "%llu", &cfg.rlimit_nproc);
889 exit(1);
890 }
891 sscanf(ptr, "%u", &cfg.rlimit_nproc);
892 arg_rlimit_nproc = 1; 886 arg_rlimit_nproc = 1;
893 } 887 }
894 else if (strncmp(ptr, "rlimit-fsize ", 13) == 0) { 888 else if (strncmp(ptr, "rlimit-fsize ", 13) == 0) {
895 ptr += 13; 889 ptr += 13;
896 if (not_unsigned(ptr)) { 890 check_unsigned(ptr + 13, "Error: invalid rlimit in profile file: ");
897 fprintf(stderr, "Invalid rlimit option on line %d\n", lineno); 891 sscanf(ptr, "%llu", &cfg.rlimit_fsize);
898 exit(1);
899 }
900 sscanf(ptr, "%u", &cfg.rlimit_fsize);
901 arg_rlimit_fsize = 1; 892 arg_rlimit_fsize = 1;
902 } 893 }
903 else if (strncmp(ptr, "rlimit-sigpending ", 18) == 0) { 894 else if (strncmp(ptr, "rlimit-sigpending ", 18) == 0) {
904 ptr += 18; 895 ptr += 18;
905 if (not_unsigned(ptr)) { 896 check_unsigned(ptr + 18, "Error: invalid rlimit in profile file: ");
906 fprintf(stderr, "Invalid rlimit option on line %d\n", lineno); 897 sscanf(ptr, "%llu", &cfg.rlimit_sigpending);
907 exit(1);
908 }
909 sscanf(ptr, "%u", &cfg.rlimit_sigpending);
910 arg_rlimit_sigpending = 1; 898 arg_rlimit_sigpending = 1;
911 } 899 }
912 else { 900 else {