Skip to content

Commit b3bef34

Browse files
Eat spaces at the beginning of the line
1 parent 1456987 commit b3bef34

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

fapolicyd.spec

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ make DESTDIR="${RPM_BUILD_ROOT}" INSTALL='install -p' install
4949
%attr(644,root,root) %{_mandir}/man5/fapolicyd.rules.5.gz
5050

5151
%changelog
52-
* Tue May 17 2016 Steve Grubb <sgrubb@redhat.com> 0.8.1-1
53-
- Initial public release
52+
* Thu May 19 2016 Steve Grubb <sgrubb@redhat.com> 0.8.1-1
53+
- New release
5454

src/mounts.c

+14-9
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,22 @@ int load_mounts(void)
127127
}
128128

129129
while (get_line(f, buf, PATH_MAX)) {
130-
if (buf[0] != '#' && buf[0] != 0) {
131-
struct stat sb;
132-
133-
if (stat(buf, &sb) == 0) {
134-
if (!S_ISDIR(sb.st_mode)) {
135-
msg(LOG_ERR,
136-
"mount point %s is not a directory", buf);
137-
exit(1);
130+
if (buf[0] != '#') {
131+
char *ptr = buf;
132+
while (*ptr == ' ')
133+
ptr++;
134+
if (*ptr != 0) {
135+
struct stat sb;
136+
137+
if (stat(ptr, &sb) == 0) {
138+
if (!S_ISDIR(sb.st_mode)) {
139+
msg(LOG_ERR,
140+
"mount point %s is not a directory", ptr);
141+
exit(1);
142+
}
138143
}
144+
mounts_append(&mounts, ptr, lineno);
139145
}
140-
mounts_append(&mounts, buf, lineno);
141146
}
142147
lineno++;
143148
}

0 commit comments

Comments
 (0)