A networked file storage system where multiple clients connect to a central server to upload, download, lock, and manage files — with role-based permissions. Think of it as a mini Google Drive with OS-level security.
| # | Concept | Implementation |
|---|---|---|
| 1 | Role-Based Authorization | 3 roles (Admin/User/Guest) with different access levels |
| 2 | File Locking | flock() — shared locks for reads, exclusive locks for writes |
| 3 | Concurrency Control | pthread per client, semaphore limits max connections, mutex for shared data |
| 4 | Data Consistency | Mutex-protected shared state, file locks prevent lost updates |
| 5 | Socket Programming | TCP client-server with structured message protocol |
| 6 | IPC | Named pipe (server → logger) + Shared memory (server → dashboard) |
SecureVault/
├── common.h — Shared definitions, protocol, role enums
├── server.c — Main server: sockets, threads, file operations, IPC
├── client.c — Interactive CLI client
├── logger.c — Audit logger process (IPC via named pipe)
├── dashboard.c — Real-time stats (IPC via shared memory)
├── Makefile — Build system
├── data/
│ └── users.txt — User credentials & roles
├── vault/ — Stored files (created at runtime)
└── logs/
└── audit.log — Audit trail
make allThis compiles 4 binaries: server, client, logger, dashboard.
You need 4 terminal windows (or use & for background):
./server./logger./dashboard./client| Username | Password | Role | Permissions |
|---|---|---|---|
admin |
admin123 |
ADMIN | Full access — upload, download, list all, delete any |
alice |
pass123 |
USER | Own files — upload, download, list own, delete own |
bob |
pass456 |
USER | Own files — upload, download, list own, delete own |
guest |
guest |
GUEST | Read-only — list all, download any file |
- Multi-client support — Multiple users can connect simultaneously
- Role-based access control — Each role has specific permissions
- File locking — Prevents data corruption during concurrent access
- Audit logging — All operations logged via IPC named pipe
- Live dashboard — Real-time stats via IPC shared memory
- Graceful shutdown — Clean cleanup on Ctrl+C
- Language: C (compiled with GCC)
- Threading: POSIX threads (
pthread) - Synchronization: Mutex, Semaphore
- File Locking:
flock()advisory locking - Networking: BSD Sockets (TCP)
- IPC: Named Pipes (FIFO), Shared Memory (System V)
EGC 301P — Operating Systems Lab Mini Project