Skip to content

Commit 1fc5e3b

Browse files
committed
Refactor: libcrmcommon: Drop pcmk__valid_script()
Unused since 73a5d63. Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
1 parent 301fe28 commit 1fc5e3b

File tree

2 files changed

+0
-38
lines changed

2 files changed

+0
-38
lines changed

include/crm/common/options_internal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ bool pcmk__valid_int(const char *value);
117117
bool pcmk__valid_positive_int(const char *value);
118118
bool pcmk__valid_no_quorum_policy(const char *value);
119119
bool pcmk__valid_percentage(const char *value);
120-
bool pcmk__valid_script(const char *value);
121120
bool pcmk__valid_placement_strategy(const char *value);
122121

123122
// from watchdog.c

lib/common/options.c

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,43 +1315,6 @@ pcmk__valid_percentage(const char *value)
13151315
return ((end == NULL) || (end[0] == '%')) && (number >= 0);
13161316
}
13171317

1318-
/*!
1319-
* \internal
1320-
* \brief Check whether a string represents a valid script
1321-
*
1322-
* Valid values include \c /dev/null and paths of executable regular files
1323-
*
1324-
* \param[in] value String to validate
1325-
*
1326-
* \return \c true if \p value is a valid script, or \c false otherwise
1327-
*/
1328-
bool
1329-
pcmk__valid_script(const char *value)
1330-
{
1331-
struct stat st;
1332-
1333-
if (pcmk__str_eq(value, "/dev/null", pcmk__str_none)) {
1334-
return true;
1335-
}
1336-
1337-
if (stat(value, &st) != 0) {
1338-
crm_err("Script %s does not exist", value);
1339-
return false;
1340-
}
1341-
1342-
if (S_ISREG(st.st_mode) == 0) {
1343-
crm_err("Script %s is not a regular file", value);
1344-
return false;
1345-
}
1346-
1347-
if ((st.st_mode & (S_IXUSR | S_IXGRP)) == 0) {
1348-
crm_err("Script %s is not executable", value);
1349-
return false;
1350-
}
1351-
1352-
return true;
1353-
}
1354-
13551318
/*!
13561319
* \internal
13571320
* \brief Check whether a string represents a valid placement strategy

0 commit comments

Comments
 (0)