* quotactl() oddity
@ 1995-02-04 20:50 Murray S. Kucherawy
0 siblings, 0 replies; only message in thread
From: Murray S. Kucherawy @ 1995-02-04 20:50 UTC (permalink / raw)
I'm trying to set disk quotas for my users using quotactl(), but I'm finding
that if I do:
...
struct passwd *pw;
struct group *gr;
struct dqblk q;
gr = getgrnam("customer");
if (gr == (struct group *)NULL) {
fprintf(stderr,"Group \"customer\" not defined.\n");
return(1);
}
setpwent();
while ( (pw = getpwent()) != (struct passwd *)NULL ) {
if (pw->pw_gid == gr->gr_gid) { /* if it's the right group */
(void) memset ((char *)&q,'\0',sizeof(q));
q.dqb_bsoftlimit = 2000;
q.dqb_bhardlimit = 10000;
q.dqb_btime = 3*86400; /* 3 days */
fprintf(stdout,"Setting quota for %s\n",pw->pw_name);
if (quotactl(pw->pw_dir,QCMD(Q_SETQUOTA,USRQUOTA),
pw->pw_uid,&q) < 0)
fprintf(stdout,"quotactl(Q_SETQUOTA): %s\n",
strerror(errno));
}
}
...
It's setting the two quotas correctly, but the grace period that shows
up as output on "quota -v" for someone over quota, either their soft
limit or their hard limit, says "none". Am I doing something wrong?
--
Murray S. Kucherawy ==========================================================
Software Manager HookUp Communication Corporation - Ontario, CANADA
E-mail: mskucher@hookup.net NIC Handle "MSK" (905) 847-8000
--- "Intel, where quality is job 0.9999992342" ---
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1995-02-04 20:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-02-04 20:50 quotactl() oddity Murray S. Kucherawy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox