From: mskucher@vertex.tor.hookup.net (Murray S. Kucherawy)
Subject: quotactl() oddity
Date: 4 Feb 1995 15:50:26 -0500 [thread overview]
Message-ID: <3h0pai$c1a@vertex.tor.hookup.net> (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" ---
reply other threads:[~1995-02-04 20:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox