We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c778b20 commit ef323d0Copy full SHA for ef323d0
src/bin/radlock.c
@@ -90,6 +90,7 @@ int main(int argc, char *argv[])
90
int c;
91
fr_radlock_action_t action;
92
char const *file;
93
+ char *end;
94
uid_t uid = geteuid();
95
bool uid_set = false;
96
gid_t gid = getegid();
@@ -129,8 +130,8 @@ int main(int argc, char *argv[])
129
130
break;
131
132
case 'm':
- mode = strtol(optarg, NULL, 0); /* 0 base plus 0 prefix = octal */
133
- if (errno == EINVAL) {
+ mode = strtol(optarg, &end, 0); /* 0 base plus 0 prefix = octal */
134
+ if (*end || (end == optarg)) {
135
fr_perror("radlock - Bad mode value");
136
EXIT_WITH_FAILURE;
137
}
0 commit comments