Skip to content

Commit 7de1266

Browse files
committed
Also allow scripts in paths writable by the admin group.
Fix issue #3.
1 parent acc1fdc commit 7de1266

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

LoginScriptPlugin/LoginScriptPlugin.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,9 @@ static bool GetParentDir(const char *path, char **parent) {
243243
/// Verify that a script is suitable for launching as root.
244244
///
245245
/// The script itself and its containing directories should all be owned
246-
/// by root, and not writable by anyone other than root:wheel. The path
247-
/// should be absolute, on the boot volume, and must not contain any
248-
/// symbolic links.
246+
/// by root, and not writable by anyone other than root:wheel or root:admin.
247+
/// The path should be absolute, on the boot volume, and must not contain
248+
/// any symbolic links.
249249
static bool VerifyScript(const char *path, aslclient logClient)
250250
{
251251
struct stat info;
@@ -291,8 +291,8 @@ static bool VerifyScript(const char *path, aslclient logClient)
291291
pathOK = false;
292292
}
293293

294-
// Reject group writable paths unless the gid is wheel.
295-
if (info.st_mode & S_IWGRP && info.st_gid != 0) {
294+
// Reject group writable paths unless the gid is wheel or admin.
295+
if (info.st_mode & S_IWGRP && !(info.st_gid == 0 || info.st_gid == 80)) {
296296
asl_log(logClient, NULL, ASL_LEVEL_WARNING, "%s is group writable", path);
297297
pathOK = false;
298298
}

0 commit comments

Comments
 (0)