Skip to content

Commit 4cc6527

Browse files
committed
Added documentation references for file system table configuration
1 parent 582c6c2 commit 4cc6527

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

cf-agent/nfs.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,9 @@ int VerifyInFstab(EvalContext *ctx, char *name, const Attributes *a, const Promi
481481
}
482482

483483
#if defined(__QNX__) || defined(__QNXNTO__)
484+
// QNX documents 4 fstab fields : https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.utilities/topic/f/fstab.html
485+
// specialdevice mountpoint type mountoptions
486+
// TODO Remove DUMP and PASS options used here (unsupported)?
484487
NDEBUG_UNUSED int ret = snprintf(fstab, CF_BUFSIZE, "%s \t %s %s\t%s 0 0", device, mountpt, fstype, opts);
485488
assert(ret >= 0 && ret < CF_BUFSIZE);
486489
#elif defined(_CRAY)
@@ -492,9 +495,13 @@ int VerifyInFstab(EvalContext *ctx, char *name, const Attributes *a, const Promi
492495
assert(ret >= 0 && ret < CF_BUFSIZE);
493496
break;
494497
#elif defined(__hpux)
498+
// HP-UX documents 7 fstab fields: https://nixdoc.net/man-pages/HP-UX/man4/fstab.4.html
499+
// deviceSpecialFile directory type options backupFrequency passNumber comment
500+
// TODO Bring promise comment in as the 7th comment field # promise comment (stripped of newlines)
495501
NDEBUG_UNUSED int ret = snprintf(fstab, CF_BUFSIZE, "%s %s \t %s \t %s 0 0", device, mountpt, fstype, opts);
496502
assert(ret >= 0 && ret < CF_BUFSIZE);
497503
#elif defined(_AIX)
504+
// AIX uses /etc/filesystems: https://www.ibm.com/docs/en/aix/7.2.0?topic=files-filesystems-file
498505
NDEBUG_UNUSED int ret = snprintf(fstab, CF_BUFSIZE,
499506
"%s:\n\tdev\t= %s\n\ttype\t= %s\n\tvfs\t= %s\n\tnodename\t= %s\n\tmount\t= true\n\toptions\t= %s\n\taccount\t= false\n",
500507
mountpt, rmountpt, fstype, fstype, host, opts);
@@ -503,12 +510,18 @@ int VerifyInFstab(EvalContext *ctx, char *name, const Attributes *a, const Promi
503510
NDEBUG_UNUSED int ret = snprintf(fstab, CF_BUFSIZE, "%s \t %s \t %s \t %s", device, mountpt, fstype, opts);
504511
assert(ret >= 0 && ret < CF_BUFSIZE);
505512
#elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__APPLE__)
513+
// BSDs document 6 fstab fields https://man.freebsd.org/cgi/man.cgi?fstab(5)
514+
// Device Mountpoint FStype Options Dump Pass
506515
NDEBUG_UNUSED int ret = snprintf(fstab, CF_BUFSIZE, "%s \t %s \t %s \t %s 0 0", device, mountpt, fstype, opts);
507516
assert(ret >= 0 && ret < CF_BUFSIZE);
508517
#elif defined(__sun) || defined(sco) || defined(__SCO_DS)
518+
// SunOS uses /etc/fstab and documents 7 fields: https://docs.oracle.com/cd/E19455-01/805-6331/fsadm-59727/index.html
519+
// deviceToMount deviceToFsck mountPoint FStype fsckPass automount? mountOptions
520+
// - is used for deviceToFsck for read-only and network based file systems
509521
NDEBUG_UNUSED int ret = snprintf(fstab, CF_BUFSIZE, "%s - %s %s - yes %s", device, mountpt, fstype, opts);
510522
assert(ret >= 0 && ret < CF_BUFSIZE);
511523
#elif defined(__CYGWIN__)
524+
// https://cygwin.com/cygwin-ug-net/using.html#mount-table
512525
NDEBUG_UNUSED int ret = snprintf(fstab, CF_BUFSIZE, "/bin/mount %s %s", device, mountpt);
513526
assert(ret >= 0 && ret < CF_BUFSIZE);
514527
#else

0 commit comments

Comments
 (0)